예제 #1
0
        private void Redraw()
        {
            backArea.X      = (int)Position.X + 12;
            backArea.Y      = (int)Position.Y;
            backArea.Width  = (int)Width - 24;
            backArea.Height = 12;

            btRight         = new Button("btRight", new Vector2(Position.X + Width - 12f, Position.Y), @"textures\controls\scrollbar\hscrollbar_button", 1f, Color.White);
            btRight.Effect  = SpriteEffects.FlipHorizontally;
            btRight.Owner   = this.Owner;
            btRight.OnPress = btDown_OnPress;
            btRight.Initialize(FormCollection.ContentManager, FormCollection.Graphics.GraphicsDevice);
        }
예제 #2
0
        private void Redraw()
        {
            btUp          = new Button("btUp", Position, @"textures\controls\scrollbar\vscrollbar_button", 1f, Color.White);
            btDown        = new Button("btDown", new Vector2(Position.X, Position.Y + Height - 12f), @"textures\controls\scrollbar\vscrollbar_button", 1f, Color.White);
            btDown.Effect = SpriteEffects.FlipVertically;

            btUp.Owner   = this.Owner;
            btDown.Owner = this.Owner;

            btUp.OnPress   = btUp_OnPress;
            btDown.OnPress = btDown_OnPress;

            btUp.Initialize(FormCollection.ContentManager, FormCollection.Graphics.GraphicsDevice);
            btDown.Initialize(FormCollection.ContentManager, FormCollection.Graphics.GraphicsDevice);
        }
예제 #3
0
파일: Form.cs 프로젝트: brunotag/Raumschach
        private void InitializeButtons()
        {
            btClose = new Button("btMinimize", new Vector2(Size.X - 22f, 4f),
                                 @"textures\controls\button\close", 1f, buttonColor)
            {
                Owner = this
            };

            btClose.Initialize(content, FormCollection.Graphics.GraphicsDevice);
            btClose.OnRelease += FormClose;

            if (hasMinimizeButton)
            {
                btMinimize = new Button("btMinimize", Vector2.Zero,
                                        @"textures\controls\button\minimize", 1f, buttonColor)
                {
                    Owner = this
                };

                btMinimize.Initialize(content, FormCollection.Graphics.GraphicsDevice);
                btMinimize.OnRelease += FormMinimize;
            }

            if (hasMaximizeButton)
            {
                btMaximize = new Button("btMaximize", Vector2.Zero,
                                        @"textures\controls\button\maximize", 1f, buttonColor)
                {
                    Owner = this
                };

                btMaximize.Initialize(content, FormCollection.Graphics.GraphicsDevice);
                btMaximize.OnRelease += FormMaximize;
            }

            if (hasMinimizeButton || hasMaximizeButton)
            {
                btRestore = new Button("btRestore", Vector2.Zero,
                                       @"textures\controls\button\restore", 1f, buttonColor)
                {
                    Owner = this
                };

                btRestore.Initialize(content, FormCollection.Graphics.GraphicsDevice);
                btRestore.OnRelease += FormRestore;
            }
        }
예제 #4
0
        public override void Initialize(Microsoft.Xna.Framework.Content.ContentManager content, GraphicsDevice graphics)
        {
            btLeft         = new Button("btLeft", Position, @"textures\controls\scrollbar\hscrollbar_button", 1f, Color.White);
            btLeft.Owner   = this.Owner;
            btLeft.OnPress = btUp_OnPress;
            btLeft.Initialize(FormCollection.ContentManager, FormCollection.Graphics.GraphicsDevice);

            background = content.Load <Texture2D>(@"textures\controls\scrollbar\hscrollbar_back");

            cursorTex     = content.Load <Texture2D>(@"textures\controls\scrollbar\hscrollbar_cursor");
            cursorLeft    = new Rectangle(0, 0, 3, cursorTex.Height);
            cursorMiddle  = new Rectangle(3, 0, 1, cursorTex.Height);
            cursorRight   = new Rectangle(cursorTex.Width - 3, 0, 3, cursorTex.Height);
            cursorMidDest = new Rectangle(0, 0, 1, cursorTex.Height);

            Redraw();

            base.Initialize(content, graphics);
        }
예제 #5
0
        public override void Initialize(ContentManager content, GraphicsDevice graphics)
        {
            // TODO: load your content here
            textbox.Font   = this.Font;
            textbox.Owner  = this.Owner;
            textbox.Locked = true;
            textbox.Initialize(content, graphics);

            button         = new Button("btOpen", Position + new Vector2(Width - 16, 0f), @"textures\controls\combobox\button", 1f, Color.White);
            button.Font    = this.Font;
            button.Owner   = this.Owner;
            button.OnPress = Button_OnPress;
            button.Initialize(content, graphics);

            listbox                   = new Listbox("combolist", Position + new Vector2(0, 19), (int)Width, 8 * Font.LineSpacing, items);
            listbox.Font              = this.Font;
            listbox.Owner             = this.Owner;
            listbox.Visible           = false;
            listbox.OnChangeSelection = Listbox_OnChangeSelection;
            listbox.OnPress           = Listbox_OnPress;
            listbox.Initialize(content, graphics);

            base.Initialize(content, graphics);
        }
예제 #6
0
        private void Redraw()
        {
            backArea.X = (int)Position.X + 12;
            backArea.Y = (int)Position.Y;
            backArea.Width = (int)Width - 24;
            backArea.Height = 12;

            btRight = new Button("btRight", new Vector2(Position.X + Width - 12f, Position.Y), @"textures\controls\scrollbar\hscrollbar_button", 1f, Color.White);
            btRight.Effect = SpriteEffects.FlipHorizontally;
            btRight.Owner = this.Owner;
            btRight.OnPress = btDown_OnPress;
            btRight.Initialize(FormCollection.ContentManager, FormCollection.Graphics.GraphicsDevice);
        }
예제 #7
0
        public override void Initialize(Microsoft.Xna.Framework.Content.ContentManager content, GraphicsDevice graphics)
        {
            btLeft = new Button("btLeft", Position, @"textures\controls\scrollbar\hscrollbar_button", 1f, Color.White);
            btLeft.Owner = this.Owner;
            btLeft.OnPress = btUp_OnPress;
            btLeft.Initialize(FormCollection.ContentManager, FormCollection.Graphics.GraphicsDevice);

            background = content.Load<Texture2D>(@"textures\controls\scrollbar\hscrollbar_back");

            cursorTex = content.Load<Texture2D>(@"textures\controls\scrollbar\hscrollbar_cursor");
            cursorLeft = new Rectangle(0, 0, 3, cursorTex.Height);
            cursorMiddle = new Rectangle(3, 0, 1, cursorTex.Height);
            cursorRight = new Rectangle(cursorTex.Width - 3, 0, 3, cursorTex.Height);
            cursorMidDest = new Rectangle(0, 0, 1, cursorTex.Height);

            Redraw();

            base.Initialize(content, graphics);
        }
예제 #8
0
        public override void Initialize(ContentManager content, GraphicsDevice graphics)
        {
            // TODO: load your content here
            textbox = new Textbox("combotext", Position, (int)Width);
            textbox.Font = this.Font;
            textbox.Owner = this.Owner;
            textbox.Locked = true;
            textbox.Initialize(content, graphics);

            button = new Button("btOpen", Position + new Vector2(Width - 16, 0f), @"textures\controls\combobox\button", 1f, Color.White);
            button.Font = this.Font;
            button.Owner = this.Owner;
            button.OnPress = Button_OnPress;
            button.Initialize(content, graphics);

            listbox = new Listbox("combolist", Position + new Vector2(0, 19), (int)Width, 8 * Font.LineSpacing, items);
            listbox.Font = this.Font;
            listbox.Owner = this.Owner;
            listbox.Visible = false;
            listbox.OnChangeSelection = Listbox_OnChangeSelection;
            listbox.OnPress = Listbox_OnPress;
            listbox.Initialize(content, graphics);

            base.Initialize(content, graphics);
        }
예제 #9
0
        private void InitializeButtons()
        {
            btClose = new Button("btMinimize", new Vector2(Size.X - 22f, 4f),
                @"textures\controls\button\close", 1f, buttonColor) {Owner = this};

            btClose.Initialize(content, FormCollection.Graphics.GraphicsDevice);
            btClose.OnRelease += FormClose;

            if (hasMinimizeButton)
            {
                btMinimize = new Button("btMinimize", Vector2.Zero,
                    @"textures\controls\button\minimize", 1f, buttonColor) {Owner = this};

                btMinimize.Initialize(content, FormCollection.Graphics.GraphicsDevice);
                btMinimize.OnRelease += FormMinimize;

            }

            if (hasMaximizeButton)
            {
                btMaximize = new Button("btMaximize", Vector2.Zero,
                    @"textures\controls\button\maximize", 1f, buttonColor) {Owner = this};

                btMaximize.Initialize(content, FormCollection.Graphics.GraphicsDevice);
                btMaximize.OnRelease += FormMaximize;
            }

            if (hasMinimizeButton || hasMaximizeButton)
            {
                btRestore = new Button("btRestore", Vector2.Zero,
                    @"textures\controls\button\restore", 1f, buttonColor) {Owner = this};

                btRestore.Initialize(content, FormCollection.Graphics.GraphicsDevice);
                btRestore.OnRelease += FormRestore;
            }
        }
예제 #10
0
        private void Redraw()
        {
            btUp = new Button("btUp", Position, @"textures\controls\scrollbar\vscrollbar_button", 1f, Color.White);
            btDown = new Button("btDown", new Vector2(Position.X, Position.Y + Height - 12f), @"textures\controls\scrollbar\vscrollbar_button", 1f, Color.White);
            btDown.Effect = SpriteEffects.FlipVertically;

            btUp.Owner = this.Owner;
            btDown.Owner = this.Owner;

            btUp.OnPress = btUp_OnPress;
            btDown.OnPress = btDown_OnPress;

            btUp.Initialize(FormCollection.ContentManager, FormCollection.Graphics.GraphicsDevice);
            btDown.Initialize(FormCollection.ContentManager, FormCollection.Graphics.GraphicsDevice);
        }