Example #1
0
        public Button()
        {
            this.SetColor(33, 36, 45);
            this.SetDisabledColor(33/2, 36/2, 45/2);
            this.SetImage( Utilities.White);
            this.OnEnableChange += new Action<Panel, bool>(Button_OnEnableChange);

            TextLabel = GUIManager.Create<Label>();
            TextLabel.SetColor(255, 255, 255);
            TextLabel.SetDisabledColor(100, 100, 100);
            TextLabel.SetParent(this);
            TextLabel.Autosize = false;
            TextLabel.Dock(DockStyle.FILL);
            TextLabel.SetAlignment(Label.TextAlign.MiddleCenter);
        }
Example #2
0
        public override void Init()
        {
            base.Init();

            this.SetColor(255, 255, 255);

            this.SetImages(Resource.GetTexture("gui/checkbox_checked.png"), Resource.GetTexture("gui/checkbox_unchecked.png"));
            this.SetHeight(16);
            this.SetWidth(16);
            this.ClipChildren = false;

            TextLabel = GUIManager.Create<Label>();
            TextLabel.SetColor(255, 255, 255);
            TextLabel.SetParent(this);
            TextLabel.Autosize = false;
            TextLabel.SetHeight(this.Height);
            TextLabel.SetPos(new Vector2(this.Position.X + this.Width, 0));
            TextLabel.SetAlignment(Label.TextAlign.MiddleLeft);
        }
Example #3
0
        public override void Init()
        {
            base.Init();

            this.SetColor(255, 255, 255);
            this.SetHeight(20);
            this.SetWidth(40);

            TextLabel = GUIManager.Create<Label>();
            TextLabel.SetColor(73, 73, 73);
            TextLabel.SetParent(this);
            TextLabel.DockPadding(3, 3, 0, 0);
            TextLabel.Dock(DockStyle.FILL);
            TextLabel.SetAlignment(Label.TextAlign.MiddleLeft);

            Utilities.engine.Mouse.ButtonDown += new EventHandler<MouseButtonEventArgs>(Mouse_ButtonDown);
            Utilities.engine.Keyboard.KeyDown += new EventHandler<KeyboardKeyEventArgs>(Keyboard_KeyDown);
        }
Example #4
0
        public override void Init()
        {
            base.Init();

            contextPanel = GUIManager.Create<Panel>();
            contextPanel.ShouldPassInput = true;
            contextPanel.SetWidth(150);
            contextPanel.SetPos(this.Position.X, this.Position.Y + this.Height);

            //Create our text label
            TextLabel = GUIManager.Create<Label>();
            TextLabel.SetParent(this);
            TextLabel.Autosize = false;
            TextLabel.Dock(DockStyle.FILL);
            TextLabel.SetAlignment(Label.TextAlign.MiddleCenter);

            this.SetButtonState(State.Idle);

            Utilities.engine.Mouse.ButtonDown += new EventHandler<MouseButtonEventArgs>(Mouse_ButtonDown);
        }