示例#1
0
        public LabeledTextBox(String label = null, EMode mode = DEFAULT_MODE, TextBox.EInputType inputType = TextBox.DEFAULT_INPUT_TYPE, Boolean shortCutMode = DEFAULT_SHORTCUT_MODE)
            : base(label, mode, shortCutMode)
        {
            TextBox = new TextBox(inputType);
            AddLabeledWidget(TextBox);

            GetLabelWidget().Clicked += new ClickEventHandler(LabeledTextBox_Clicked);
        }
示例#2
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);
        }