Horizontal slider.
Наследование: Slider
Пример #1
0
        private void UpdateColorControls(String name, Color col, int sliderVal)
        {
            ColorDisplay disp = FindChildByName(name, true) as ColorDisplay;

            disp.Color = col;

            HorizontalSlider slider = FindChildByName(name + "Slider", true) as HorizontalSlider;

            slider.Value = sliderVal;

            TextBoxNumeric box = FindChildByName(name + "Box", true) as TextBoxNumeric;

            box.Value = sliderVal;
        }
Пример #2
0
        private void SlidersMoved(Control control)
        {
            /*
             * HorizontalSlider* redSlider		= gwen_cast<HorizontalSlider>(	FindChildByName( "RedSlider",   true ) );
             * HorizontalSlider* greenSlider	= gwen_cast<HorizontalSlider>(	FindChildByName( "GreenSlider", true ) );
             * HorizontalSlider* blueSlider	= gwen_cast<HorizontalSlider>(	FindChildByName( "BlueSlider",  true ) );
             * HorizontalSlider* alphaSlider	= gwen_cast<HorizontalSlider>(	FindChildByName( "AlphaSlider", true ) );
             */

            HorizontalSlider slider = control as HorizontalSlider;

            if (slider != null)
            {
                SetColorByName(GetColorFromName(slider.Name), (byte)slider.Value);
            }

            UpdateControls();
            //SetColor( EngineManaged::GUI::Color( redSlider->GetValue(), greenSlider->GetValue(), blueSlider->GetValue(), alphaSlider->GetValue() ) );
        }
Пример #3
0
        private void CreateColorControl(String name, int y)
        {
            const int colorSize = 12;

            GroupBox colorGroup = new GroupBox(this);
            colorGroup.SetPosition(10, y);
            colorGroup.SetText(name);
            colorGroup.SetSize(160, 35);
            colorGroup.Name = name + "groupbox";

            ColorDisplay disp = new ColorDisplay(colorGroup);
            disp.Name = name;
            disp.SetBounds(0, 10, colorSize, colorSize);

            TextBoxNumeric numeric = new TextBoxNumeric(colorGroup);
            numeric.Name = name + "Box";
            numeric.SetPosition(105, 7);
            numeric.SetSize(26, 16);
            numeric.SelectAllOnFocus = true;
            numeric.TextChanged += NumericTyped;

            HorizontalSlider slider = new HorizontalSlider(colorGroup);
            slider.SetPosition(colorSize + 5, 10);
            slider.SetRange(0, 255);
            slider.SetSize(80, colorSize);
            slider.Name = name + "Slider";
            slider.ValueChanged += SlidersMoved;
        }
Пример #4
0
        public void TestHorizontalSlider()
        {
            var control = new HorizontalSlider(canvas);
            control.SetSize(128, 32);

            GUI.Test(control, "HorizontalSlider1");
        }