Ejemplo n.º 1
0
        public RadioButton(Base parent)
            : base(parent)
        {
            Control.RadioButtonGroup rbg = new Control.RadioButtonGroup(this);
            rbg.Text = "Sample radio group";
            rbg.SetPosition(10, 10);

            rbg.AddOption("Option 1");
            rbg.AddOption("Option 2");
            rbg.AddOption("Option 3");
            rbg.AddOption("\u0627\u0644\u0622\u0646 \u0644\u062D\u0636\u0648\u0631");
            //rbg.SizeToContents(); // it's auto

            rbg.SelectionChanged += OnChange;

            Control.LabeledRadioButton rb1 = new LabeledRadioButton(this);
            rb1.Text = "Option 1";
            rb1.SetPosition(300, 10);

            Control.LabeledRadioButton rb2 = new LabeledRadioButton(this);
            rb2.Text = "Option 2222222222222222222222222222222222";
            rb2.SetPosition(300, 30);

            Control.LabeledRadioButton rb3 = new LabeledRadioButton(this);
            rb3.Text = "\u0627\u0644\u0622\u0646 \u0644\u062D\u0636\u0648\u0631";
            rb3.SetPosition(300, 50);

            {
                EnumRadioButtonGroup<Choices> erbg = new EnumRadioButtonGroup<Choices>(this);
                erbg.SetPosition(10, 100);
                erbg.SelectedValue = Choices.HallC;
            }

            //this.DrawDebugOutlines = true;
        }
Ejemplo n.º 2
0
        public RadioButtonTest(ControlBase parent)
            : base(parent)
        {
            VerticalLayout layout = new VerticalLayout(this);

            GroupBox group = new GroupBox(layout);

            group.Margin = Margin.Five;
            group.Text   = "Sample radio group";
            {
                RadioButtonGroup rbg = new RadioButtonGroup(group);

                rbg.AddOption("Option 1");
                rbg.AddOption("Option 2");
                rbg.AddOption("Option 3");
                rbg.AddOption("\u0627\u0644\u0622\u0646 \u0644\u062D\u0636\u0648\u0631");

                rbg.SelectionChanged += OnChange;
            }

            {
                EnumRadioButtonGroup <Choices> erbg = new EnumRadioButtonGroup <Choices>(layout);
                erbg.Margin        = Margin.Five;
                erbg.SelectedValue = Choices.HallC;
            }
        }
Ejemplo n.º 3
0
        public RadioButton(Base parent)
            : base(parent)
        {
            Control.RadioButtonGroup rbg = new Control.RadioButtonGroup(this)
            {
                Text = "Sample radio group"
            };
            rbg.SetPosition(10, 10);

            rbg.AddOption("Option 1");
            rbg.AddOption("Option 2");
            rbg.AddOption("Option 3");
            rbg.AddOption("\u0627\u0644\u0622\u0646 \u0644\u062D\u0636\u0648\u0631");
            //rbg.SizeToContents(); // it's auto

            rbg.SelectionChanged += OnChange;

            Control.LabeledRadioButton rb1 = new LabeledRadioButton(this)
            {
                Text = "Option 1"
            };
            rb1.SetPosition(300, 10);

            Control.LabeledRadioButton rb2 = new LabeledRadioButton(this)
            {
                Text = "Option 2222222222222222222222222222222222"
            };
            rb2.SetPosition(300, 30);

            Control.LabeledRadioButton rb3 = new LabeledRadioButton(this)
            {
                Text = "\u0627\u0644\u0622\u0646 \u0644\u062D\u0636\u0648\u0631"
            };
            rb3.SetPosition(300, 50);

            {
                EnumRadioButtonGroup <Choices> erbg = new EnumRadioButtonGroup <Choices>(this);
                erbg.SetPosition(10, 100);
                erbg.SelectedValue = Choices.HallC;
            }


            //this.DrawDebugOutlines = true;
        }