public CheckNRadioTestDialog()
            : base("Check And Radio Test", 100, 100, 320, 200)
        {
            girdLayout = new GirdLayout(4, 2);

            girdLayout.SetHorizontalAlignment(0, 0, EHAlignment.HCenter);
            girdLayout.SetHorizontalAlignment(1, 0, EHAlignment.HCenter);
            girdLayout.SetHorizontalAlignment(2, 0, EHAlignment.HCenter);
            girdLayout.SetHorizontalAlignment(3, 0, EHAlignment.HCenter);

            girdLayout.SetHorizontalAlignment(0, 1, EHAlignment.HCenter);
            girdLayout.SetHorizontalAlignment(1, 1, EHAlignment.HCenter);
            girdLayout.SetHorizontalAlignment(2, 1, EHAlignment.HCenter);
            girdLayout.SetHorizontalAlignment(3, 1, EHAlignment.HCenter);

            girdLayout.SetVerticalAlignment(0, 0, EVAlignment.VCenter);
            girdLayout.SetVerticalAlignment(1, 0, EVAlignment.VCenter);
            girdLayout.SetVerticalAlignment(2, 0, EVAlignment.VCenter);
            girdLayout.SetVerticalAlignment(3, 0, EVAlignment.VCenter);

            girdLayout.SetVerticalAlignment(0, 1, EVAlignment.VCenter);
            girdLayout.SetVerticalAlignment(1, 1, EVAlignment.VCenter);
            girdLayout.SetVerticalAlignment(2, 1, EVAlignment.VCenter);
            girdLayout.SetVerticalAlignment(3, 1, EVAlignment.VCenter);

            girdLayout.Right = 16;
            girdLayout.Left = 16;
            girdLayout.Top = 8;
            girdLayout.Bottom = 8;
            girdLayout.Spacer = 4;

            closeButton = new Button("Close");
            checkButton1 = new CheckButton("Check 1");
            checkButton2 = new CheckButton("Check 2");
            checkButton3 = new CheckButton("Check 3");
            radioGroup = new RadioGroup();
            radioButton1 = new RadioButton("Radio 1", radioGroup);
            radioButton2 = new RadioButton("Radio 2", radioGroup);
            radioButton3 = new RadioButton("Radio 3", radioGroup);
            spacer = new Spacer(ESpacerType.Fit);

            Add(checkButton1);
            Add(radioButton1);
            Add(checkButton2);
            Add(radioButton2);
            Add(checkButton3);
            Add(radioButton3);
            Add(spacer);
            Add(closeButton);
            Layout = girdLayout;

            Pack();

            closeButton.MouseReleasedEvent += new MouseReleasedHandler(closeButton_MouseReleasedEvent);
        }
Exemplo n.º 2
0
        public RadioButton(String text, RadioGroup rg)
        {
            Text_ = text;
            this.textFont = new Text("RadioButton", UI.Instance.CurrentTheme.defaultTextFont, text);

            this.rg = rg;
            Size = GetPreferedSize();
            HorizontalStyle = EElementStyle.Fit;
            VerticalStyle = EElementStyle.Fit;
        }