Example #1
0
        public UpDownBox(
            Int32 minValue = DEFAULT_MIN_VALUE,
            Int32 maxValue = DEFAULT_MAX_VALUE,
            Int32 scaleValue = DEFAULT_SCALE_VALUE,
            Int32 defaultValue = DEFAULT_DEFAULT_VALUE,
            String label = null,
            LabeledWidget.EMode mode = DEFAULT_MODE,
            Boolean shortCutMode = DEFAULT_SHORTCUT_MODE)
            : base(label, mode, shortCutMode)
        {
            MinValue = minValue;
            MaxValue = maxValue;
            ScaleValue = scaleValue;
            DefaultValue = defaultValue;

            MainBox = new HAutoSizeBox(true, null, 0);

            ButtonBox = new VAutoSizeBox(true, null, 0);

            DownBtn = new Button(Create.Texture("Gui_DownButtonN"), Create.Texture("Gui_DownButtonO"));
            DownBtn.Dimension *= BUTTON_RESIZE_FACTOR;
            DownBtn.Clicked += new ClickEventHandler(DownBtn_Clicked);
            AddWidget(DownBtn);

            UpBtn = new Button(Create.Texture("Gui_UpButtonN"), Create.Texture("Gui_UpButtonO"));
            UpBtn.Dimension *= BUTTON_RESIZE_FACTOR;
            UpBtn.Clicked += new ClickEventHandler(UpBtn_Clicked);

            ButtonBox.AddItem(UpBtn);
            ButtonBox.AddItem(DownBtn);

            TextBox = new TextBox(BlazeraLib.TextBox.EInputType.Numeric);

            SetCurrentValue(GetDefaultValue());
            TextBox.Dimension = new SFML.Window.Vector2f(40F, UpBtn.Dimension.Y + DownBtn.Dimension.Y);

            TextBox.TextAdded += new TextAddedEventHandler(TextBox_TextAdded);
            AddWidget(TextBox);

            ValueIsModified = false;

            MainBox.AddItem(TextBox);
            MainBox.AddItem(ButtonBox);

            AddLabeledWidget(MainBox);

            GetLabelWidget().Clicked += new ClickEventHandler(UpDownBox_Clicked);
        }
Example #2
0
        public CheckBox(Texture picture, LabeledWidget.EMode mode = LabeledWidget.DEFAULT_MODE, Boolean isChecked = DEFAULT_STATE)
            : base(picture, mode)
        {
            TextureN = Create.Texture("CheckBoxN");
            TextureN.Dimension *= RESIZE_FACTOR;
            TextureC = Create.Texture("CheckBoxC");
            TextureC.Dimension *= RESIZE_FACTOR;

            Box = new Button(TextureN, null);
            Box.ClickOffset = BUTTON_CLICK_OFFSET;
            Box.Clicked += new ClickEventHandler(Button_Clicked);

            GetLabelWidget().Clicked += new ClickEventHandler(Button_Clicked);

            AddLabeledWidget(Box);

            SetIsChecked(isChecked);
        }
Example #3
0
 public void AddButton(Texture picture, CheckEventHandler onChecked = null, LabeledWidget.EMode mode = DEFAULT_BUTTON_MODE, String name = null)
 {
     AddButton(new Item(picture, mode, RadioButtons.Count == 0) { Name = name }, onChecked);
 }
Example #4
0
 public void AddButton(String label, CheckEventHandler onChecked = null, LabeledWidget.EMode mode = DEFAULT_BUTTON_MODE, Boolean shortcutMode = false, String name = null)
 {
     AddButton(new Item(label, mode, false, shortcutMode) { Name = name }, onChecked);
 }
Example #5
0
            public Item(Texture picture, LabeledWidget.EMode mode = LabeledWidget.DEFAULT_MODE, Boolean isChecked = DEFAULT_STATE)
                : base(picture, mode)
            {
                TextureN = Create.Texture("Gui_RadioButtonN");
                TextureN.Dimension *= RESIZE_FACTOR;
                TextureC = Create.Texture("Gui_RadioButtonC");
                TextureC.Dimension *= RESIZE_FACTOR;

                Box = new Button(TextureN, null);
                Box.Clicked += new ClickEventHandler(Button_Clicked);

                GetLabelWidget().Clicked += new ClickEventHandler(Button_Clicked);

                AddLabeledWidget(Box);

                SetIsChecked(isChecked);

                IsActive = true;
            }