Esempio n. 1
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;
        }
Esempio n. 2
0
        private void CreateControls()
        {
            const int startY = 5;
            const int height = 35;

            CreateColorControl("Red", startY);
            CreateColorControl("Green", startY + height);
            CreateColorControl("Blue", startY + height*2);
            CreateColorControl("Alpha", startY + height*3);

            GroupBox finalGroup = new GroupBox(this);
            finalGroup.SetPosition(180, 40);
            finalGroup.SetSize(60, 60);
            finalGroup.SetText("Result");
            finalGroup.Name = "ResultGroupBox";
            
            ColorDisplay disp = new ColorDisplay(finalGroup);
            disp.Name = "Result";
            disp.SetBounds(0, 10, 32, 32);
            //disp.DrawCheckers = true;

            //UpdateControls();
        }