Ejemplo n.º 1
0
        ControlBase CreateControls(ControlBase subject, Dock docking, string name, ControlBase container)
        {
            GroupBox gb = new GroupBox(container);

            gb.Text = name;
            {
                HorizontalLayout hlayout = new HorizontalLayout(gb);
                {
                    GroupBox dgb = new GroupBox(hlayout);
                    dgb.Text = "Dock";
                    {
                        RadioButtonGroup dock = new RadioButtonGroup(dgb);
                        dock.UserData = subject;
                        dock.AddOption("Left", null, Dock.Left);
                        dock.AddOption("Top", null, Dock.Top);
                        dock.AddOption("Right", null, Dock.Right);
                        dock.AddOption("Bottom", null, Dock.Bottom);
                        dock.AddOption("Fill", null, Dock.Fill);
                        dock.SelectByUserData(docking);
                        dock.SelectionChanged += DockChanged;
                    }

                    VerticalLayout vlayout = new VerticalLayout(hlayout);
                    {
                        HorizontalLayout hlayout2 = new HorizontalLayout(vlayout);
                        {
                            GroupBox hgb = new GroupBox(hlayout2);
                            hgb.Text = "H. Align";
                            {
                                RadioButtonGroup halign = new RadioButtonGroup(hgb);
                                halign.UserData = subject;
                                halign.AddOption("Left", null, HorizontalAlignment.Left);
                                halign.AddOption("Center", null, HorizontalAlignment.Center);
                                halign.AddOption("Right", null, HorizontalAlignment.Right);
                                halign.AddOption("Stretch", null, HorizontalAlignment.Stretch);
                                halign.SelectByUserData(subject.HorizontalAlignment);
                                halign.SelectionChanged += HAlignChanged;
                            }

                            GroupBox vgb = new GroupBox(hlayout2);
                            vgb.Text = "V. Align";
                            {
                                RadioButtonGroup valign = new RadioButtonGroup(vgb);
                                valign.UserData = subject;
                                valign.AddOption("Top", null, VerticalAlignment.Top);
                                valign.AddOption("Center", null, VerticalAlignment.Center);
                                valign.AddOption("Bottom", null, VerticalAlignment.Bottom);
                                valign.AddOption("Stretch", null, VerticalAlignment.Stretch);
                                valign.SelectByUserData(subject.VerticalAlignment);
                                valign.SelectionChanged += VAlignChanged;
                            }
                        }

                        GridLayout glayout = new GridLayout(vlayout);
                        glayout.SetColumnWidths(GridLayout.AutoSize, GridLayout.Fill);
                        {
                            Label l_width = new Label(glayout);
                            l_width.Text = "Width:";

                            HorizontalSlider width = new HorizontalSlider(glayout);
                            width.Name          = "Width";
                            width.UserData      = subject;
                            width.Min           = 50;
                            width.Max           = 350;
                            width.Value         = 100;
                            width.ValueChanged += WidthChanged;

                            Label l_height = new Label(glayout);
                            l_height.Text = "Height:";

                            HorizontalSlider height = new HorizontalSlider(glayout);
                            height.Name          = "Height";
                            height.UserData      = subject;
                            height.Min           = 50;
                            height.Max           = 350;
                            height.Value         = 100;
                            height.ValueChanged += HeightChanged;

                            Label l_margin = new Label(glayout);
                            l_margin.Text = "Margin:";

                            HorizontalSlider margin = new HorizontalSlider(glayout);
                            margin.Name          = "Margin";
                            margin.UserData      = subject;
                            margin.Min           = 0;
                            margin.Max           = 50;
                            margin.Value         = 0;
                            margin.ValueChanged += MarginChanged;
                        }
                    }
                }
            }

            return(gb);
        }