public Right_Side_Bar(HorizontalSplitPane split)
        {
            var vsplit = new VerticalSplitPane {
            };

            split.Widgets.Add(vsplit);
            split.SetSplitterPosition(0, 0.75f);
        }
Beispiel #2
0
        private void NewItemOnClicked(object sender, EventArgs eventArgs)
        {
            var dlg = new NewProjectWizard();

            dlg.Closed += (s, a) =>
            {
                if (!dlg.Result)
                {
                    return;
                }

                Container rootWidget = null;

                if (dlg._radioButtonGrid.IsPressed)
                {
                    rootWidget = new Grid();
                }
                else
                if (dlg._radioButtonPanel.IsPressed)
                {
                    rootWidget = new Panel();
                }
                else
                if (dlg._radioButtonScrollPane.IsPressed)
                {
                    rootWidget = new ScrollPane();
                }
                else
                if (dlg._radioButtonHorizontalSplitPane.IsPressed)
                {
                    rootWidget = new HorizontalSplitPane();
                }
                else
                if (dlg._radioButtonVerticalSplitPane.IsPressed)
                {
                    rootWidget = new VerticalSplitPane();
                }
                else
                if (dlg._radioButtonWindow.IsPressed)
                {
                    rootWidget = new Window();
                }
                else
                if (dlg._radioButtonDialog.IsPressed)
                {
                    rootWidget = new Dialog();
                }

                New(rootWidget);
            };

            dlg.ShowModal(_desktop);
        }
Beispiel #3
0
        protected override void LoadContent()
        {
            base.LoadContent();

            MyraEnvironment.Game = this;

            // Widget.DrawFrames = true;
            _host = new Desktop();

            var grid = new Grid
            {
                RowSpacing    = 3,
                ColumnSpacing = 3,
                //				DrawLines = true
            };

            grid.ColumnsProportions.Add(new Grid.Proportion(Grid.ProportionType.Auto));
            grid.ColumnsProportions.Add(new Grid.Proportion(Grid.ProportionType.Auto));
            grid.ColumnsProportions.Add(new Grid.Proportion(Grid.ProportionType.Part, 1.0f));
            grid.ColumnsProportions.Add(new Grid.Proportion(Grid.ProportionType.Part, 2.0f));
            grid.ColumnsProportions.Add(new Grid.Proportion(Grid.ProportionType.Pixels, 150.0f));
            grid.ColumnsProportions.Add(new Grid.Proportion(Grid.ProportionType.Auto));
            grid.ColumnsProportions.Add(new Grid.Proportion(Grid.ProportionType.Fill));

            grid.RowsProportions.Add(new Grid.Proportion(Grid.ProportionType.Auto));
            grid.RowsProportions.Add(new Grid.Proportion(Grid.ProportionType.Auto));
            grid.RowsProportions.Add(new Grid.Proportion(Grid.ProportionType.Part, 1.0f));
            grid.RowsProportions.Add(new Grid.Proportion(Grid.ProportionType.Part, 1.0f));
            grid.RowsProportions.Add(new Grid.Proportion(Grid.ProportionType.Pixels, 200.0f));
            grid.RowsProportions.Add(new Grid.Proportion(Grid.ProportionType.Auto));
            grid.RowsProportions.Add(new Grid.Proportion(Grid.ProportionType.Fill));

            // Create headers
            for (var i = 1; i < grid.ColumnsProportions.Count; ++i)
            {
                var header = new TextBlock
                {
                    Text          = grid.ColumnsProportions[i].ToString(),
                    GridPositionX = i,
                    GridPositionY = 0
                };

                grid.Widgets.Add(header);
            }

            // Combo
            var combo = new ComboBox
            {
                GridPositionX = 1,
                GridPositionY = 1
            };

            combo.Items.Add(new ListItem("Red", Color.Red));
            combo.Items.Add(new ListItem("Green", Color.Green));
            combo.Items.Add(new ListItem("Blue", Color.Blue));
            grid.Widgets.Add(combo);

            // Button
            var button = new Button
            {
                GridPositionX       = 2,
                GridPositionY       = 1,
                GridSpanX           = 2,
                GridSpanY           = 1,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                Text = "This is 2 columns button"
            };

            button.Down += (s, a) =>
            {
                var messageBox = Dialog.CreateMessageBox("2C", "2 Columns Button pushed!");
                messageBox.ShowModal(_host);
            };

            grid.Widgets.Add(button);

            // Button
            var button2 = new Button
            {
                GridPositionX       = 2,
                GridPositionY       = 2,
                GridSpanX           = 1,
                GridSpanY           = 2,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch,
                Text = "This is 2 rows button"
            };

            button2.Down += (s, a) =>
            {
                var messageBox = Dialog.CreateMessageBox("2R", "2 Rows Button pushed!");
                messageBox.ShowModal(_host);
            };
            grid.Widgets.Add(button2);

            var label = new TextBlock
            {
                Text =
                    "Lorem ipsum [Green]dolor sit amet, [Red]consectetur adipisicing elit, sed do eiusmod [#AAAAAAAA]tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. [white]Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum!",
                VerticalSpacing = 0,
                TextColor       = Color.AntiqueWhite,
                Wrap            = true
            };

            var pane = new ScrollPane
            {
                Widget     = label,
                WidthHint  = 200,
                HeightHint = 200
            };

            _window = new Window
            {
                Title   = "Text",
                Content = pane
            };

            var button3 = new Button
            {
                Text          = "Show Window",
                GridPositionX = 4,
                GridPositionY = 3
            };

            grid.Widgets.Add(button3);

            button3.Up += (sender, args) =>
            {
                _window.ShowModal(_host);
            };

            // Horizontal slider
            var hslider = new HorizontalSlider
            {
                GridPositionX = 3,
                GridPositionY = 2
            };

            grid.Widgets.Add(hslider);

            // Horizontal slider value
            var hsliderValue = new TextBlock
            {
                GridPositionX = 4,
                GridPositionY = 2,
                Text          = "HSlider Value: 0"
            };

            hslider.ValueChanged += (sender, args) =>
            {
                hsliderValue.Text = string.Format("HSlider Value: {0:0.00}", hslider.Value);
            };

            grid.Widgets.Add(hsliderValue);

            var textBlock = new TextBlock
            {
                WidthHint     = 125,
                Text          = "This is textblock which spans for several lines to demonstrate row proportion set to Auto",
                GridPositionX = 4,
                GridPositionY = 1
            };

            grid.Widgets.Add(textBlock);

            var checkBox = new CheckBox
            {
                Text          = "This is a checkbox",
                GridPositionX = 3,
                GridPositionY = 3,
            };

            grid.Widgets.Add(checkBox);

            // Spin buttons
            var textField = new TextField
            {
                GridPositionX = 5,
                GridPositionY = 1,
                WidthHint     = 100
            };

            grid.Widgets.Add(textField);

            var spinButton2 = new SpinButton
            {
                GridPositionX = 5,
                GridPositionY = 2,
                WidthHint     = 100,
                Integer       = true
            };

            grid.Widgets.Add(spinButton2);

            // Progress bars
            _horizontalProgressBar = new HorizontalProgressBar
            {
                GridPositionX = 5,
                GridPositionY = 3,
                WidthHint     = 100
            };
            grid.Widgets.Add(_horizontalProgressBar);

            _verticalProgressBar = new VerticalProgressBar
            {
                GridPositionX = 6,
                GridPositionY = 1,
                HeightHint    = 100
            };
            grid.Widgets.Add(_verticalProgressBar);

            // List box
            var list = new ListBox
            {
                GridPositionX = 5,
                GridPositionY = 4
            };

            list.Items.Add(new ListItem("Red", Color.Red));
            list.Items.Add(new ListItem("Green", Color.Green));
            list.Items.Add(new ListItem("Blue", Color.Blue));
            grid.Widgets.Add(list);

            // Vertical slider
            var vslider = new VerticalSlider
            {
                GridPositionX = 2,
                GridPositionY = 4
            };

            grid.Widgets.Add(vslider);

            // Vertical slider value
            var vsliderValue = new TextBlock
            {
                GridPositionX = 4,
                GridPositionY = 4,
                Text          = "VSlider Value: 0"
            };

            vslider.ValueChanged += (sender, args) =>
            {
                vsliderValue.Text = string.Format("VSlider Value: {0:0.00}", vslider.Value);
            };

            grid.Widgets.Add(vsliderValue);

            var tree = new Tree
            {
                HasRoot       = false,
                GridPositionX = 3,
                GridPositionY = 4
            };
            var node1 = tree.AddSubNode("node1");
            var node2 = node1.AddSubNode("node2");
            var node3 = node2.AddSubNode("node3");

            node3.AddSubNode("node4");
            node3.AddSubNode("node5");
            node2.AddSubNode("node6");

            grid.Widgets.Add(tree);

            var textBlock2 = new TextBlock
            {
                Text          = "This is long textblock",
                GridPositionX = 1,
                GridPositionY = 4
            };

            grid.Widgets.Add(textBlock2);

            var hsplitPane = new HorizontalSplitPane
            {
                GridPositionX = 1,
                GridPositionY = 5
            };
            var hsplitPaneLabel1 = new TextBlock
            {
                Text = "Left"
            };

            hsplitPane.Widgets.Add(hsplitPaneLabel1);
            var hsplitPaneLabel2 = new TextBlock
            {
                Text = "Right"
            };

            hsplitPane.Widgets.Add(hsplitPaneLabel2);
            grid.Widgets.Add(hsplitPane);

            var vsplitPane = new VerticalSplitPane
            {
                GridPositionX = 6,
                GridPositionY = 4
            };
            var vsplitPaneLabel1 = new TextBlock
            {
                Text = "Top"
            };

            vsplitPane.Widgets.Add(vsplitPaneLabel1);
            var vsplitPaneLabel2 = new TextBlock
            {
                Text = "Bottom"
            };

            vsplitPane.Widgets.Add(vsplitPaneLabel2);
            grid.Widgets.Add(vsplitPane);

            for (var i = 1; i < grid.RowsProportions.Count; ++i)
            {
                var header = new TextBlock
                {
                    Text          = grid.RowsProportions[i].ToString(),
                    GridPositionX = 0,
                    GridPositionY = i
                };

                grid.Widgets.Add(header);
            }

            _host.Widgets.Add(grid);
        }
Beispiel #4
0
        private void BuildUI()
        {
            _menuFileNew              = new MenuItem();
            _menuFileNew.Text         = "&New";
            _menuFileNew.ShortcutText = "Ctrl+N";
            _menuFileNew.Id           = "_menuFileNew";

            _menuFileOpen              = new MenuItem();
            _menuFileOpen.Text         = "&Open";
            _menuFileOpen.ShortcutText = "Ctrl+O";
            _menuFileOpen.Id           = "_menuFileOpen";

            _menuFileReload              = new MenuItem();
            _menuFileReload.Text         = "&Reload";
            _menuFileReload.ShortcutText = "Ctrl+R";
            _menuFileReload.Id           = "_menuFileReload";

            _menuFileSave              = new MenuItem();
            _menuFileSave.Text         = "&Save";
            _menuFileSave.ShortcutText = "Ctrl+S";
            _menuFileSave.Id           = "_menuFileSave";

            _menuFileSaveAs      = new MenuItem();
            _menuFileSaveAs.Text = "Save &As...";
            _menuFileSaveAs.Id   = "_menuFileSaveAs";

            _menuFileExportToCS              = new MenuItem();
            _menuFileExportToCS.Text         = "&Export To C#...";
            _menuFileExportToCS.ShortcutText = "Ctrl+E";
            _menuFileExportToCS.Id           = "_menuFileExportToCS";

            var menuSeparator1 = new MenuSeparator();

            _menuFileLoadStylesheet      = new MenuItem();
            _menuFileLoadStylesheet.Text = "&Load Stylesheet";
            _menuFileLoadStylesheet.Id   = "_menuFileLoadStylesheet";

            _menuFileResetStylesheet      = new MenuItem();
            _menuFileResetStylesheet.Text = "Rese&t Stylesheet";
            _menuFileResetStylesheet.Id   = "_menuFileResetStylesheet";

            var menuSeparator2 = new MenuSeparator();

            _menuFileDebugOptions      = new MenuItem();
            _menuFileDebugOptions.Text = "&UI Debug Options";
            _menuFileDebugOptions.Id   = "_menuFileDebugOptions";

            var menuSeparator3 = new MenuSeparator();

            _menuFileQuit              = new MenuItem();
            _menuFileQuit.Text         = "&Quit";
            _menuFileQuit.ShortcutText = "Ctrl+Q";
            _menuFileQuit.Id           = "_menuFileQuit";

            _menuFile      = new MenuItem();
            _menuFile.Text = "&File";
            _menuFile.Id   = "_menuFile";
            _menuFile.Items.Add(_menuFileNew);
            _menuFile.Items.Add(_menuFileOpen);
            _menuFile.Items.Add(_menuFileReload);
            _menuFile.Items.Add(_menuFileSave);
            _menuFile.Items.Add(_menuFileSaveAs);
            _menuFile.Items.Add(_menuFileExportToCS);
            _menuFile.Items.Add(menuSeparator1);
            _menuFile.Items.Add(_menuFileLoadStylesheet);
            _menuFile.Items.Add(_menuFileResetStylesheet);
            _menuFile.Items.Add(menuSeparator2);
            _menuFile.Items.Add(_menuFileDebugOptions);
            _menuFile.Items.Add(menuSeparator3);
            _menuFile.Items.Add(_menuFileQuit);

            _menuItemSelectAll              = new MenuItem();
            _menuItemSelectAll.Text         = "Select &All";
            _menuItemSelectAll.ShortcutText = "Ctrl+A";
            _menuItemSelectAll.Id           = "_menuItemSelectAll";

            _menuItemCopy              = new MenuItem();
            _menuItemCopy.Text         = "&Copy";
            _menuItemCopy.ShortcutText = "Ctrl+Insert, Ctrl+C";
            _menuItemCopy.Id           = "_menuItemCopy";

            _menuItemPaste              = new MenuItem();
            _menuItemPaste.Text         = "&Paste";
            _menuItemPaste.ShortcutText = "Shift+Insert, Ctrl+V";
            _menuItemPaste.Id           = "_menuItemPaste";

            var menuSeparator4 = new MenuSeparator();

            _menuEditFormatSource              = new MenuItem();
            _menuEditFormatSource.Text         = "&Format Source";
            _menuEditFormatSource.ShortcutText = "Ctrl+F";
            _menuEditFormatSource.Id           = "_menuEditFormatSource";

            var menuItem1 = new MenuItem();

            menuItem1.Text = "&Edit";
            menuItem1.Items.Add(_menuItemSelectAll);
            menuItem1.Items.Add(_menuItemCopy);
            menuItem1.Items.Add(_menuItemPaste);
            menuItem1.Items.Add(menuSeparator4);
            menuItem1.Items.Add(_menuEditFormatSource);

            _menuHelpAbout      = new MenuItem();
            _menuHelpAbout.Text = "&About";
            _menuHelpAbout.Id   = "_menuHelpAbout";

            var menuItem2 = new MenuItem();

            menuItem2.Text = "&Help";
            menuItem2.Items.Add(_menuHelpAbout);

            _mainMenu    = new HorizontalMenu();
            _mainMenu.Id = "_mainMenu";
            _mainMenu.Items.Add(_menuFile);
            _mainMenu.Items.Add(menuItem1);
            _mainMenu.Items.Add(menuItem2);

            _projectHolder    = new Panel();
            _projectHolder.Id = "_projectHolder";

            _textSource                   = new TextBox();
            _textSource.Multiline         = true;
            _textSource.Wrap              = true;
            _textSource.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _textSource.GridRow           = 2;
            _textSource.Id                = "_textSource";

            var scrollViewer1 = new ScrollViewer();

            scrollViewer1.Content = _textSource;

            _leftSplitPane    = new VerticalSplitPane();
            _leftSplitPane.Id = "_leftSplitPane";
            _leftSplitPane.Widgets.Add(_projectHolder);
            _leftSplitPane.Widgets.Add(scrollViewer1);

            var horizontalSeparator1 = new HorizontalSeparator();

            _textStatus      = new Label();
            _textStatus.Text = "Reloading...";
            _textStatus.Id   = "_textStatus";

            var verticalStackPanel1 = new VerticalStackPanel();

            verticalStackPanel1.Proportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            verticalStackPanel1.Widgets.Add(_leftSplitPane);
            verticalStackPanel1.Widgets.Add(horizontalSeparator1);
            verticalStackPanel1.Widgets.Add(_textStatus);

            _propertyGridPane         = new ScrollViewer();
            _propertyGridPane.Content = null;
            _propertyGridPane.Id      = "_propertyGridPane";

            var horizontalSeparator2 = new HorizontalSeparator();

            _textLocation      = new Label();
            _textLocation.Text = "Line: 1, Column: 2, Indent: 3";
            _textLocation.Id   = "_textLocation";

            var verticalStackPanel2 = new VerticalStackPanel();

            verticalStackPanel2.Proportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            verticalStackPanel2.Widgets.Add(_propertyGridPane);
            verticalStackPanel2.Widgets.Add(horizontalSeparator2);
            verticalStackPanel2.Widgets.Add(_textLocation);

            _topSplitPane    = new HorizontalSplitPane();
            _topSplitPane.Id = "_topSplitPane";
            _topSplitPane.Widgets.Add(verticalStackPanel1);
            _topSplitPane.Widgets.Add(verticalStackPanel2);


            Proportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            Proportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            Widgets.Add(_mainMenu);
            Widgets.Add(_topSplitPane);
        }
Beispiel #5
0
        private void BuildUI()
        {
            var label1 = new Label();

            label1.Text = "Button:";
            label1.Id   = "";

            _button              = new ImageTextButton();
            _button.Text         = "Button";
            _button.Id           = "_button";
            _button.PaddingLeft  = 8;
            _button.PaddingRight = 8;
            _button.GridColumn   = 1;

            _textButtonLabel         = new Label();
            _textButtonLabel.Text    = "Text Button:";
            _textButtonLabel.Id      = "_textButtonLabel";
            _textButtonLabel.GridRow = 1;

            _textButton              = new TextButton();
            _textButton.Text         = "Button 2";
            _textButton.Id           = "_textButton";
            _textButton.PaddingLeft  = 8;
            _textButton.PaddingRight = 8;
            _textButton.GridColumn   = 1;
            _textButton.GridRow      = 1;

            var label2 = new Label();

            label2.Text    = "Image Button:";
            label2.Id      = "";
            label2.GridRow = 2;

            _imageButton              = new ImageButton();
            _imageButton.Id           = "_imageButton";
            _imageButton.PaddingLeft  = 8;
            _imageButton.PaddingRight = 8;
            _imageButton.GridColumn   = 1;
            _imageButton.GridRow      = 2;

            var checkBox1 = new CheckBox();

            checkBox1.Text           = "This is checkbox";
            checkBox1.ImageWidth     = 10;
            checkBox1.ImageHeight    = 10;
            checkBox1.GridRow        = 3;
            checkBox1.GridColumnSpan = 2;

            var label3 = new Label();

            label3.Text    = "Horizontal Slider:";
            label3.Id      = "";
            label3.GridRow = 4;

            var horizontalSlider1 = new HorizontalSlider();

            horizontalSlider1.GridColumn = 1;
            horizontalSlider1.GridRow    = 4;

            var label4 = new Label();

            label4.Text    = "Combo Box:";
            label4.GridRow = 5;

            var listItem1 = new ListItem();

            listItem1.Id    = "";
            listItem1.Text  = "Red";
            listItem1.Color = Color.Red;

            var listItem2 = new ListItem();

            listItem2.Id    = null;
            listItem2.Text  = "Green";
            listItem2.Color = Color.Lime;

            var listItem3 = new ListItem();

            listItem3.Id    = null;
            listItem3.Text  = "Blue";
            listItem3.Color = new Color
            {
                B = 255,
                G = 128,
                R = 0,
                A = 255,
            };

            var comboBox1 = new ComboBox();

            comboBox1.Width      = 200;
            comboBox1.GridColumn = 1;
            comboBox1.GridRow    = 5;
            comboBox1.Items.Add(listItem1);
            comboBox1.Items.Add(listItem2);
            comboBox1.Items.Add(listItem3);

            var label5 = new Label();

            label5.Text    = "Text Field:";
            label5.GridRow = 6;

            var textBox1 = new TextBox();

            textBox1.Text       = "";
            textBox1.GridColumn = 1;
            textBox1.GridRow    = 6;

            var label6 = new Label();

            label6.Text    = "List Box:";
            label6.GridRow = 7;

            var listItem4 = new ListItem();

            listItem4.Id    = null;
            listItem4.Text  = "Red";
            listItem4.Color = Color.Red;

            var listItem5 = new ListItem();

            listItem5.Id    = null;
            listItem5.Text  = "Green";
            listItem5.Color = Color.Lime;

            var listItem6 = new ListItem();

            listItem6.Id    = null;
            listItem6.Text  = "Blue";
            listItem6.Color = Color.Blue;

            var listBox1 = new ListBox();

            listBox1.Width      = 200;
            listBox1.GridColumn = 1;
            listBox1.GridRow    = 7;
            listBox1.Items.Add(listItem4);
            listBox1.Items.Add(listItem5);
            listBox1.Items.Add(listItem6);

            var label7 = new Label();

            label7.Text    = "Tree";
            label7.GridRow = 8;

            _gridRight = new Grid();
            _gridRight.ColumnSpacing        = 8;
            _gridRight.RowSpacing           = 8;
            _gridRight.DefaultRowProportion = new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            };
            _gridRight.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            _gridRight.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            _gridRight.Id = "_gridRight";
            _gridRight.Widgets.Add(label1);
            _gridRight.Widgets.Add(_button);
            _gridRight.Widgets.Add(_textButtonLabel);
            _gridRight.Widgets.Add(_textButton);
            _gridRight.Widgets.Add(label2);
            _gridRight.Widgets.Add(_imageButton);
            _gridRight.Widgets.Add(checkBox1);
            _gridRight.Widgets.Add(label3);
            _gridRight.Widgets.Add(horizontalSlider1);
            _gridRight.Widgets.Add(label4);
            _gridRight.Widgets.Add(comboBox1);
            _gridRight.Widgets.Add(label5);
            _gridRight.Widgets.Add(textBox1);
            _gridRight.Widgets.Add(label6);
            _gridRight.Widgets.Add(listBox1);
            _gridRight.Widgets.Add(label7);

            var scrollViewer1 = new ScrollViewer();

            scrollViewer1.Content = _gridRight;

            var label8 = new Label();

            label8.Text = "Vertical Slider:";

            var verticalSlider1 = new VerticalSlider();

            verticalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            verticalSlider1.GridRow             = 1;

            var grid1 = new Grid();

            grid1.RowSpacing = 8;
            grid1.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            grid1.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            grid1.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            grid1.Widgets.Add(label8);
            grid1.Widgets.Add(verticalSlider1);

            var label9 = new Label();

            label9.Text = "Progress Bars:";

            _horizontalProgressBar         = new HorizontalProgressBar();
            _horizontalProgressBar.Id      = "_horizontalProgressBar";
            _horizontalProgressBar.GridRow = 1;

            _verticalProgressBar = new VerticalProgressBar();
            _verticalProgressBar.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _verticalProgressBar.Id      = "_verticalProgressBar";
            _verticalProgressBar.GridRow = 2;

            var grid2 = new Grid();

            grid2.RowSpacing = 8;
            grid2.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            grid2.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            grid2.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            grid2.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            grid2.Widgets.Add(label9);
            grid2.Widgets.Add(_horizontalProgressBar);
            grid2.Widgets.Add(_verticalProgressBar);

            var verticalSplitPane1 = new VerticalSplitPane();

            verticalSplitPane1.Widgets.Add(grid1);
            verticalSplitPane1.Widgets.Add(grid2);


            GridRow = 1;
            Widgets.Add(scrollViewer1);
            Widgets.Add(verticalSplitPane1);
        }
Beispiel #6
0
        private void BuildUI()
        {
            _menuFileNew      = new MenuItem();
            _menuFileNew.Id   = "_menuFileNew";
            _menuFileNew.Text = "&New";

            _menuFileOpen      = new MenuItem();
            _menuFileOpen.Id   = "_menuFileOpen";
            _menuFileOpen.Text = "&Open";

            _menuFileSave      = new MenuItem();
            _menuFileSave.Id   = "_menuFileSave";
            _menuFileSave.Text = "&Save";

            _menuFileSaveAs      = new MenuItem();
            _menuFileSaveAs.Id   = "_menuFileSaveAs";
            _menuFileSaveAs.Text = "Save &As...";

            _menuFileExportToCS      = new MenuItem();
            _menuFileExportToCS.Id   = "_menuFileExportToCS";
            _menuFileExportToCS.Text = "&Export To C#...";

            var menuSeparator1 = new MenuSeparator();

            _menuFileDebugOptions      = new MenuItem();
            _menuFileDebugOptions.Id   = "_menuFileDebugOptions";
            _menuFileDebugOptions.Text = "&UI Debug Options";

            var menuSeparator2 = new MenuSeparator();

            _menuFileQuit      = new MenuItem();
            _menuFileQuit.Id   = "_menuFileQuit";
            _menuFileQuit.Text = "&Quit";

            var menuItem1 = new MenuItem();

            menuItem1.Id   = "";
            menuItem1.Text = "&File";
            menuItem1.Items.Add(_menuFileNew);
            menuItem1.Items.Add(_menuFileOpen);
            menuItem1.Items.Add(_menuFileSave);
            menuItem1.Items.Add(_menuFileSaveAs);
            menuItem1.Items.Add(_menuFileExportToCS);
            menuItem1.Items.Add(menuSeparator1);
            menuItem1.Items.Add(_menuFileDebugOptions);
            menuItem1.Items.Add(menuSeparator2);
            menuItem1.Items.Add(_menuFileQuit);

            _menuControlsAddButton      = new MenuItem();
            _menuControlsAddButton.Id   = "_menuControlsAddButton";
            _menuControlsAddButton.Text = "Add Button";

            _menuControlsAddCheckBox      = new MenuItem();
            _menuControlsAddCheckBox.Id   = "_menuControlsAddCheckBox";
            _menuControlsAddCheckBox.Text = "Add CheckBox";

            _menuControlsAddImageButton      = new MenuItem();
            _menuControlsAddImageButton.Id   = "_menuControlsAddImageButton";
            _menuControlsAddImageButton.Text = "Add ImageButton";

            _menuControlsAddTextButton      = new MenuItem();
            _menuControlsAddTextButton.Id   = "_menuControlsAddTextButton";
            _menuControlsAddTextButton.Text = "Add TextButton";

            _menuControlsAddHorizontalSlider      = new MenuItem();
            _menuControlsAddHorizontalSlider.Id   = "_menuControlsAddHorizontalSlider";
            _menuControlsAddHorizontalSlider.Text = "Add HorizontalSlider";

            _menuControlsAddVerticalSlider      = new MenuItem();
            _menuControlsAddVerticalSlider.Id   = "_menuControlsAddVerticalSlider";
            _menuControlsAddVerticalSlider.Text = "Add VerticalSlider";

            _menuControlsAddHorizontalProgressBar      = new MenuItem();
            _menuControlsAddHorizontalProgressBar.Id   = "_menuControlsAddHorizontalProgressBar";
            _menuControlsAddHorizontalProgressBar.Text = "Add Horizontal ProgressBar";

            _menuControlsAddVerticalProgressBar      = new MenuItem();
            _menuControlsAddVerticalProgressBar.Id   = "_menuControlsAddVerticalProgressBar";
            _menuControlsAddVerticalProgressBar.Text = "Add Vertical ProgressBar";

            _menuControlsAddComboBox      = new MenuItem();
            _menuControlsAddComboBox.Id   = "_menuControlsAddComboBox";
            _menuControlsAddComboBox.Text = "Add ComboBox";

            _menuControlsAddListBox      = new MenuItem();
            _menuControlsAddListBox.Id   = "_menuControlsAddListBox";
            _menuControlsAddListBox.Text = "Add ListBox";

            _menuControlsAddImage      = new MenuItem();
            _menuControlsAddImage.Id   = "_menuControlsAddImage";
            _menuControlsAddImage.Text = "Add Image";

            _menuControlsAddTextBlock      = new MenuItem();
            _menuControlsAddTextBlock.Id   = "_menuControlsAddTextBlock";
            _menuControlsAddTextBlock.Text = "Add TextBlock";

            _menuControlsAddTextField      = new MenuItem();
            _menuControlsAddTextField.Id   = "_menuControlsAddTextField";
            _menuControlsAddTextField.Text = "Add TextField";

            _menuControlsAddSpinButton      = new MenuItem();
            _menuControlsAddSpinButton.Id   = "_menuControlsAddSpinButton";
            _menuControlsAddSpinButton.Text = "Add SpinButton";

            var menuSeparator3 = new MenuSeparator();

            _menuControlsAddPanel      = new MenuItem();
            _menuControlsAddPanel.Id   = "_menuControlsAddPanel";
            _menuControlsAddPanel.Text = "Add Panel";

            _menuControlsAddGrid      = new MenuItem();
            _menuControlsAddGrid.Id   = "_menuControlsAddGrid";
            _menuControlsAddGrid.Text = "Add Grid";

            _menuControlsAddScrollPane      = new MenuItem();
            _menuControlsAddScrollPane.Id   = "_menuControlsAddScrollPane";
            _menuControlsAddScrollPane.Text = "Add ScrollPane";

            _menuControlsAddHorizontalSplitPane      = new MenuItem();
            _menuControlsAddHorizontalSplitPane.Id   = "_menuControlsAddHorizontalSplitPane";
            _menuControlsAddHorizontalSplitPane.Text = "Add Horizontal SplitPane";

            _menuControlsAddVerticalSplitPane      = new MenuItem();
            _menuControlsAddVerticalSplitPane.Id   = "_menuControlsAddVerticalSplitPane";
            _menuControlsAddVerticalSplitPane.Text = "Add Vertical SplitPane";

            var menuSeparator4 = new MenuSeparator();

            _menuControlsAddHorizontalMenu      = new MenuItem();
            _menuControlsAddHorizontalMenu.Id   = "_menuControlsAddHorizontalMenu";
            _menuControlsAddHorizontalMenu.Text = "Add HorizontalMenu";

            _menuControlsAddVerticalMenu      = new MenuItem();
            _menuControlsAddVerticalMenu.Id   = "_menuControlsAddVerticalMenu";
            _menuControlsAddVerticalMenu.Text = "Add Vertical Menu";

            _menuControlsAddMenuItem      = new MenuItem();
            _menuControlsAddMenuItem.Id   = "_menuControlsAddMenuItem";
            _menuControlsAddMenuItem.Text = "Add Menu Item";

            _menuControlsAddMenuSeparator      = new MenuItem();
            _menuControlsAddMenuSeparator.Id   = "_menuControlsAddMenuSeparator";
            _menuControlsAddMenuSeparator.Text = "Add Menu Separator";

            _menuControls      = new MenuItem();
            _menuControls.Id   = "_menuControls";
            _menuControls.Text = "&Controls";
            _menuControls.Items.Add(_menuControlsAddButton);
            _menuControls.Items.Add(_menuControlsAddCheckBox);
            _menuControls.Items.Add(_menuControlsAddImageButton);
            _menuControls.Items.Add(_menuControlsAddTextButton);
            _menuControls.Items.Add(_menuControlsAddHorizontalSlider);
            _menuControls.Items.Add(_menuControlsAddVerticalSlider);
            _menuControls.Items.Add(_menuControlsAddHorizontalProgressBar);
            _menuControls.Items.Add(_menuControlsAddVerticalProgressBar);
            _menuControls.Items.Add(_menuControlsAddComboBox);
            _menuControls.Items.Add(_menuControlsAddListBox);
            _menuControls.Items.Add(_menuControlsAddImage);
            _menuControls.Items.Add(_menuControlsAddTextBlock);
            _menuControls.Items.Add(_menuControlsAddTextField);
            _menuControls.Items.Add(_menuControlsAddSpinButton);
            _menuControls.Items.Add(menuSeparator3);
            _menuControls.Items.Add(_menuControlsAddPanel);
            _menuControls.Items.Add(_menuControlsAddGrid);
            _menuControls.Items.Add(_menuControlsAddScrollPane);
            _menuControls.Items.Add(_menuControlsAddHorizontalSplitPane);
            _menuControls.Items.Add(_menuControlsAddVerticalSplitPane);
            _menuControls.Items.Add(menuSeparator4);
            _menuControls.Items.Add(_menuControlsAddHorizontalMenu);
            _menuControls.Items.Add(_menuControlsAddVerticalMenu);
            _menuControls.Items.Add(_menuControlsAddMenuItem);
            _menuControls.Items.Add(_menuControlsAddMenuSeparator);

            _menuHelpAbout      = new MenuItem();
            _menuHelpAbout.Id   = "_menuHelpAbout";
            _menuHelpAbout.Text = "&About";

            var menuItem2 = new MenuItem();

            menuItem2.Id   = "";
            menuItem2.Text = "&Help";
            menuItem2.Items.Add(_menuHelpAbout);

            var horizontalMenu1 = new HorizontalMenu();

            horizontalMenu1.DrawLinesColor      = Color.White;
            horizontalMenu1.Id                  = "";
            horizontalMenu1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            horizontalMenu1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            horizontalMenu1.Items.Add(menuItem1);
            horizontalMenu1.Items.Add(_menuControls);
            horizontalMenu1.Items.Add(menuItem2);

            _projectHolder    = new Panel();
            _projectHolder.Id = "_projectHolder";
            _projectHolder.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _projectHolder.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;

            _explorerHolder    = new Panel();
            _explorerHolder.Id = "_explorerHolder";
            _explorerHolder.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _explorerHolder.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;

            _propertyGridPane    = new ScrollPane();
            _propertyGridPane.Id = "_propertyGridPane";
            _propertyGridPane.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _propertyGridPane.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _propertyGridPane.GridPositionY       = 2;
            _propertyGridPane.ClipToBounds        = true;
            _propertyGridPane.CanFocus            = true;

            _rightSplitPane    = new VerticalSplitPane();
            _rightSplitPane.Id = "_rightSplitPane";
            _rightSplitPane.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _rightSplitPane.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _rightSplitPane.GridPositionX       = 2;
            _rightSplitPane.Widgets.Add(_explorerHolder);
            _rightSplitPane.Widgets.Add(_propertyGridPane);

            _topSplitPane    = new HorizontalSplitPane();
            _topSplitPane.Id = "_topSplitPane";
            _topSplitPane.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _topSplitPane.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _topSplitPane.GridPositionY       = 1;
            _topSplitPane.Widgets.Add(_projectHolder);
            _topSplitPane.Widgets.Add(_rightSplitPane);


            DrawLinesColor = Color.White;
            RowsProportions.Add(new Proportion());
            RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            Id = "Root";
            HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            Widgets.Add(horizontalMenu1);
            Widgets.Add(_topSplitPane);
        }
        private void BuildUI()
        {
            _menuItemNew      = new MenuItem();
            _menuItemNew.Id   = "_menuItemNew";
            _menuItemNew.Text = "&New";

            _menuItemOpen      = new MenuItem();
            _menuItemOpen.Id   = "_menuItemOpen";
            _menuItemOpen.Text = "&Open";

            _menuItemSave      = new MenuItem();
            _menuItemSave.Id   = "_menuItemSave";
            _menuItemSave.Text = "&Save";

            _menuItemSaveAs      = new MenuItem();
            _menuItemSaveAs.Id   = "_menuItemSaveAs";
            _menuItemSaveAs.Text = "Save &As...";

            var menuSeparator1 = new MenuSeparator();

            _menuItemQuit      = new MenuItem();
            _menuItemQuit.Id   = "_menuItemQuit";
            _menuItemQuit.Text = "&Quit";

            var menuItem1 = new MenuItem();

            menuItem1.Id   = "";
            menuItem1.Text = "&File";
            menuItem1.Items.Add(_menuItemNew);
            menuItem1.Items.Add(_menuItemOpen);
            menuItem1.Items.Add(_menuItemSave);
            menuItem1.Items.Add(_menuItemSaveAs);
            menuItem1.Items.Add(menuSeparator1);
            menuItem1.Items.Add(_menuItemQuit);

            _menuItemCopy      = new MenuItem();
            _menuItemCopy.Id   = "_menuItemCopy";
            _menuItemCopy.Text = "&Copy";

            _menuItemPaste      = new MenuItem();
            _menuItemPaste.Id   = "_menuItemPaste";
            _menuItemPaste.Text = "&Paste";

            var menuSeparator2 = new MenuSeparator();

            _menuItemUndo      = new MenuItem();
            _menuItemUndo.Id   = "_menuItemUndo";
            _menuItemUndo.Text = "&Undo";

            _menuItemRedo      = new MenuItem();
            _menuItemRedo.Id   = "_menuItemRedo";
            _menuItemRedo.Text = "&Redo";

            var menuItem2 = new MenuItem();

            menuItem2.Id   = "";
            menuItem2.Text = "&Edit";
            menuItem2.Items.Add(_menuItemCopy);
            menuItem2.Items.Add(_menuItemPaste);
            menuItem2.Items.Add(menuSeparator2);
            menuItem2.Items.Add(_menuItemUndo);
            menuItem2.Items.Add(_menuItemRedo);

            _menuItemAbout      = new MenuItem();
            _menuItemAbout.Id   = "_menuItemAbout";
            _menuItemAbout.Text = "&About";

            var menuItem3 = new MenuItem();

            menuItem3.Id   = "";
            menuItem3.Text = "&Help";
            menuItem3.Items.Add(_menuItemAbout);

            var horizontalMenu1 = new HorizontalMenu();

            horizontalMenu1.DrawLinesColor      = Color.White;
            horizontalMenu1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            horizontalMenu1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            horizontalMenu1.Items.Add(menuItem1);
            horizontalMenu1.Items.Add(menuItem2);
            horizontalMenu1.Items.Add(menuItem3);

            var textBlock1 = new TextBlock();

            textBlock1.Text              = "Button:";
            textBlock1.TextColor         = Color.White;
            textBlock1.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock1.Id = "";

            _button                            = new Button();
            _button.Text                       = "Show Window";
            _button.TextColor                  = Color.White;
            _button.ImageTextSpacing           = 8;
            _button.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _button.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _button.Id                         = "_button";
            _button.PaddingLeft                = 8;
            _button.PaddingRight               = 8;
            _button.GridPositionX              = 1;

            var textBlock2 = new TextBlock();

            textBlock2.Text              = "Blue Button:";
            textBlock2.TextColor         = Color.White;
            textBlock2.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock2.Id            = "";
            textBlock2.GridPositionY = 1;

            _blueButton                            = new Button("blue");
            _blueButton.Text                       = "Show Window";
            _blueButton.TextColor                  = Color.White;
            _blueButton.ImageTextSpacing           = 8;
            _blueButton.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _blueButton.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _blueButton.Id                         = "_blueButton";
            _blueButton.PaddingLeft                = 8;
            _blueButton.PaddingRight               = 8;
            _blueButton.GridPositionX              = 1;
            _blueButton.GridPositionY              = 1;

            var textBlock3 = new TextBlock();

            textBlock3.Text              = "Text Button:";
            textBlock3.TextColor         = Color.White;
            textBlock3.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock3.Id            = "";
            textBlock3.GridPositionY = 2;

            _textButton           = new TextButton();
            _textButton.Text      = "Show Window";
            _textButton.TextColor = Color.White;
            _textButton.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _textButton.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Center;
            _textButton.Id            = "_textButton";
            _textButton.PaddingLeft   = 8;
            _textButton.PaddingRight  = 8;
            _textButton.GridPositionX = 1;
            _textButton.GridPositionY = 2;

            var textBlock4 = new TextBlock();

            textBlock4.Text              = "Image Button:";
            textBlock4.TextColor         = Color.White;
            textBlock4.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock4.Id            = "";
            textBlock4.GridPositionY = 3;

            _imageButton = new ImageButton();
            _imageButton.ImageVisible = true;
            _imageButton.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _imageButton.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Center;
            _imageButton.Id            = "_imageButton";
            _imageButton.PaddingLeft   = 8;
            _imageButton.PaddingRight  = 8;
            _imageButton.GridPositionX = 1;
            _imageButton.GridPositionY = 3;

            var checkBox1 = new CheckBox();

            checkBox1.Text                       = "This is checkbox";
            checkBox1.TextColor                  = Color.White;
            checkBox1.ImageWidthHint             = 10;
            checkBox1.ImageHeightHint            = 10;
            checkBox1.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            checkBox1.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            checkBox1.GridPositionY              = 4;
            checkBox1.GridSpanX                  = 2;

            var textBlock5 = new TextBlock();

            textBlock5.Text              = "Horizontal Slider:";
            textBlock5.TextColor         = Color.White;
            textBlock5.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock5.Id            = "";
            textBlock5.GridPositionY = 5;

            var horizontalSlider1 = new HorizontalSlider();

            horizontalSlider1.Maximum             = 100;
            horizontalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            horizontalSlider1.GridPositionX       = 1;
            horizontalSlider1.GridPositionY       = 5;

            var textBlock6 = new TextBlock();

            textBlock6.Text              = "Combo Box:";
            textBlock6.TextColor         = Color.White;
            textBlock6.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock6.GridPositionY = 6;

            var listItem1 = new ListItem();

            listItem1.Id    = "";
            listItem1.Text  = "Red";
            listItem1.Color = Color.Red;

            var listItem2 = new ListItem();

            listItem2.Text  = "Green";
            listItem2.Color = Color.Lime;

            var listItem3 = new ListItem();

            listItem3.Text  = "Blue";
            listItem3.Color = new Color
            {
                B           = 255,
                G           = 128,
                A           = 255,
                PackedValue = 4294934528,
            };

            var comboBox1 = new ComboBox();

            comboBox1.WidthHint     = 200;
            comboBox1.GridPositionX = 1;
            comboBox1.GridPositionY = 6;
            comboBox1.Items.Add(listItem1);
            comboBox1.Items.Add(listItem2);
            comboBox1.Items.Add(listItem3);

            var textBlock7 = new TextBlock();

            textBlock7.Text              = "Text Field:";
            textBlock7.TextColor         = Color.White;
            textBlock7.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock7.GridPositionY = 7;

            var textField1 = new TextField();

            textField1.Text              = "";
            textField1.TextColor         = Color.White;
            textField1.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textField1.MessageTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textField1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            textField1.GridPositionX       = 1;
            textField1.GridPositionY       = 7;
            textField1.CanFocus            = true;

            var textBlock8 = new TextBlock();

            textBlock8.Text              = "Spin Button:";
            textBlock8.TextColor         = Color.White;
            textBlock8.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock8.GridPositionY = 8;

            var spinButton1 = new SpinButton();

            spinButton1.Value          = 0;
            spinButton1.DrawLinesColor = Color.White;
            spinButton1.WidthHint      = 100;
            spinButton1.GridPositionX  = 1;
            spinButton1.GridPositionY  = 8;

            var textBlock9 = new TextBlock();

            textBlock9.Text              = "List Box:";
            textBlock9.TextColor         = Color.White;
            textBlock9.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock9.GridPositionY = 9;

            var listItem4 = new ListItem();

            listItem4.Text  = "Red";
            listItem4.Color = Color.Red;

            var listItem5 = new ListItem();

            listItem5.Text  = "Green";
            listItem5.Color = Color.Lime;

            var listItem6 = new ListItem();

            listItem6.Text  = "Blue";
            listItem6.Color = Color.Blue;

            var listBox1 = new ListBox();

            listBox1.DrawLinesColor      = Color.White;
            listBox1.WidthHint           = 200;
            listBox1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            listBox1.GridPositionX       = 1;
            listBox1.GridPositionY       = 9;
            listBox1.Items.Add(listItem4);
            listBox1.Items.Add(listItem5);
            listBox1.Items.Add(listItem6);

            var textBlock10 = new TextBlock();

            textBlock10.Text              = "Vertical Menu:";
            textBlock10.TextColor         = Color.White;
            textBlock10.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock10.GridPositionY = 10;

            var menuItem4 = new MenuItem();

            menuItem4.Id   = "";
            menuItem4.Text = "Start New Game";

            var menuItem5 = new MenuItem();

            menuItem5.Id   = "";
            menuItem5.Text = "Options";

            var menuItem6 = new MenuItem();

            menuItem6.Id   = "";
            menuItem6.Text = "Quit";

            var verticalMenu1 = new VerticalMenu();

            verticalMenu1.DrawLinesColor    = Color.White;
            verticalMenu1.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            verticalMenu1.GridPositionX     = 1;
            verticalMenu1.GridPositionY     = 10;
            verticalMenu1.Items.Add(menuItem4);
            verticalMenu1.Items.Add(menuItem5);
            verticalMenu1.Items.Add(menuItem6);

            var textBlock11 = new TextBlock();

            textBlock11.Text              = "Tree";
            textBlock11.TextColor         = Color.White;
            textBlock11.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock11.GridPositionY = 11;

            _gridRight = new Grid();
            _gridRight.DrawLinesColor = Color.White;
            _gridRight.ColumnSpacing  = 8;
            _gridRight.RowSpacing     = 8;
            _gridRight.ColumnsProportions.Add(new Proportion());
            _gridRight.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.Id = "_gridRight";
            _gridRight.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _gridRight.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _gridRight.Widgets.Add(textBlock1);
            _gridRight.Widgets.Add(_button);
            _gridRight.Widgets.Add(textBlock2);
            _gridRight.Widgets.Add(_blueButton);
            _gridRight.Widgets.Add(textBlock3);
            _gridRight.Widgets.Add(_textButton);
            _gridRight.Widgets.Add(textBlock4);
            _gridRight.Widgets.Add(_imageButton);
            _gridRight.Widgets.Add(checkBox1);
            _gridRight.Widgets.Add(textBlock5);
            _gridRight.Widgets.Add(horizontalSlider1);
            _gridRight.Widgets.Add(textBlock6);
            _gridRight.Widgets.Add(comboBox1);
            _gridRight.Widgets.Add(textBlock7);
            _gridRight.Widgets.Add(textField1);
            _gridRight.Widgets.Add(textBlock8);
            _gridRight.Widgets.Add(spinButton1);
            _gridRight.Widgets.Add(textBlock9);
            _gridRight.Widgets.Add(listBox1);
            _gridRight.Widgets.Add(textBlock10);
            _gridRight.Widgets.Add(verticalMenu1);
            _gridRight.Widgets.Add(textBlock11);

            var scrollPane1 = new ScrollPane();

            scrollPane1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            scrollPane1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            scrollPane1.ClipToBounds        = true;
            scrollPane1.CanFocus            = true;
            scrollPane1.Child = _gridRight;

            var textBlock12 = new TextBlock();

            textBlock12.Text              = "Vertical Slider:";
            textBlock12.TextColor         = Color.White;
            textBlock12.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };

            var verticalSlider1 = new VerticalSlider();

            verticalSlider1.Maximum             = 100;
            verticalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            verticalSlider1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            verticalSlider1.GridPositionY       = 1;

            var grid1 = new Grid();

            grid1.DrawLinesColor = Color.White;
            grid1.RowSpacing     = 8;
            grid1.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.RowsProportions.Add(new Proportion());
            grid1.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            grid1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            grid1.Widgets.Add(textBlock12);
            grid1.Widgets.Add(verticalSlider1);

            var textBlock13 = new TextBlock();

            textBlock13.Text              = "Progress Bars:";
            textBlock13.TextColor         = Color.White;
            textBlock13.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };

            _horizontalProgressBar                     = new HorizontalProgressBar();
            _horizontalProgressBar.Maximum             = 100;
            _horizontalProgressBar.DrawLinesColor      = Color.White;
            _horizontalProgressBar.Id                  = "_horizontalProgressBar";
            _horizontalProgressBar.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _horizontalProgressBar.GridPositionY       = 1;

            _verticalProgressBar                     = new VerticalProgressBar();
            _verticalProgressBar.Maximum             = 100;
            _verticalProgressBar.DrawLinesColor      = Color.White;
            _verticalProgressBar.Id                  = "_verticalProgressBar";
            _verticalProgressBar.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _verticalProgressBar.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _verticalProgressBar.GridPositionY       = 2;

            var grid2 = new Grid();

            grid2.DrawLinesColor = Color.White;
            grid2.RowSpacing     = 8;
            grid2.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.RowsProportions.Add(new Proportion());
            grid2.RowsProportions.Add(new Proportion());
            grid2.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            grid2.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            grid2.GridPositionY       = 2;
            grid2.Widgets.Add(textBlock13);
            grid2.Widgets.Add(_horizontalProgressBar);
            grid2.Widgets.Add(_verticalProgressBar);

            var verticalSplitPane1 = new VerticalSplitPane();

            verticalSplitPane1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            verticalSplitPane1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            verticalSplitPane1.GridPositionX       = 2;
            verticalSplitPane1.Widgets.Add(grid1);
            verticalSplitPane1.Widgets.Add(grid2);

            var horizontalSplitPane1 = new HorizontalSplitPane();

            horizontalSplitPane1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            horizontalSplitPane1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            horizontalSplitPane1.GridPositionY       = 1;
            horizontalSplitPane1.Widgets.Add(scrollPane1);
            horizontalSplitPane1.Widgets.Add(verticalSplitPane1);


            DrawLinesColor = Color.White;
            RowSpacing     = 8;
            RowsProportions.Add(new Proportion());
            RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            Id = "Root";
            HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            Widgets.Add(horizontalMenu1);
            Widgets.Add(horizontalSplitPane1);
        }
Beispiel #8
0
        private void BuildUI()
        {
            _menuFileNew      = new MenuItem();
            _menuFileNew.Id   = "_menuFileNew";
            _menuFileNew.Text = "&New";

            _menuFileOpen      = new MenuItem();
            _menuFileOpen.Id   = "_menuFileOpen";
            _menuFileOpen.Text = "&Open";

            _menuFileReload      = new MenuItem();
            _menuFileReload.Id   = "_menuFileReload";
            _menuFileReload.Text = "&Reload";

            _menuFileSave      = new MenuItem();
            _menuFileSave.Id   = "_menuFileSave";
            _menuFileSave.Text = "&Save";

            _menuFileSaveAs      = new MenuItem();
            _menuFileSaveAs.Id   = "_menuFileSaveAs";
            _menuFileSaveAs.Text = "Save &As...";

            _menuFileExportToCS      = new MenuItem();
            _menuFileExportToCS.Id   = "_menuFileExportToCS";
            _menuFileExportToCS.Text = "&Export To C#...";

            var menuSeparator1 = new MenuSeparator();

            _menuFileLoadStylesheet      = new MenuItem();
            _menuFileLoadStylesheet.Id   = "_menuFileLoadStylesheet";
            _menuFileLoadStylesheet.Text = "&Load Stylesheet";

            _menuFileReloadStylesheet      = new MenuItem();
            _menuFileReloadStylesheet.Id   = "_menuFileReloadStylesheet";
            _menuFileReloadStylesheet.Text = "Rel&oad Stylesheet";

            _menuFileResetStylesheet      = new MenuItem();
            _menuFileResetStylesheet.Id   = "_menuFileResetStylesheet";
            _menuFileResetStylesheet.Text = "Rese&t Stylesheet";

            var menuSeparator2 = new MenuSeparator();

            _menuFileDebugOptions      = new MenuItem();
            _menuFileDebugOptions.Id   = "_menuFileDebugOptions";
            _menuFileDebugOptions.Text = "&UI Debug Options";

            var menuSeparator3 = new MenuSeparator();

            _menuFileQuit      = new MenuItem();
            _menuFileQuit.Id   = "_menuFileQuit";
            _menuFileQuit.Text = "&Quit";

            var menuItem1 = new MenuItem();

            menuItem1.Id   = "";
            menuItem1.Text = "&File";
            menuItem1.Items.Add(_menuFileNew);
            menuItem1.Items.Add(_menuFileOpen);
            menuItem1.Items.Add(_menuFileReload);
            menuItem1.Items.Add(_menuFileSave);
            menuItem1.Items.Add(_menuFileSaveAs);
            menuItem1.Items.Add(_menuFileExportToCS);
            menuItem1.Items.Add(menuSeparator1);
            menuItem1.Items.Add(_menuFileLoadStylesheet);
            menuItem1.Items.Add(_menuFileReloadStylesheet);
            menuItem1.Items.Add(_menuFileResetStylesheet);
            menuItem1.Items.Add(menuSeparator2);
            menuItem1.Items.Add(_menuFileDebugOptions);
            menuItem1.Items.Add(menuSeparator3);
            menuItem1.Items.Add(_menuFileQuit);

            _menuEditFormatSource      = new MenuItem();
            _menuEditFormatSource.Id   = "_menuEditFormatSource";
            _menuEditFormatSource.Text = "&Format Source";

            var menuItem2 = new MenuItem();

            menuItem2.Id   = "";
            menuItem2.Text = "&Edit";
            menuItem2.Items.Add(_menuEditFormatSource);

            _menuHelpAbout      = new MenuItem();
            _menuHelpAbout.Id   = "_menuHelpAbout";
            _menuHelpAbout.Text = "&About";

            var menuItem3 = new MenuItem();

            menuItem3.Id   = "";
            menuItem3.Text = "&Help";
            menuItem3.Items.Add(_menuHelpAbout);

            var horizontalMenu1 = new HorizontalMenu();

            horizontalMenu1.Id = "";
            horizontalMenu1.Items.Add(menuItem1);
            horizontalMenu1.Items.Add(menuItem2);
            horizontalMenu1.Items.Add(menuItem3);

            _projectHolder    = new Panel();
            _projectHolder.Id = "_projectHolder";

            _textSource                   = new TextField();
            _textSource.Text              = "";
            _textSource.Multiline         = true;
            _textSource.Wrap              = true;
            _textSource.Id                = "_textSource";
            _textSource.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _textSource.GridRow           = 2;

            var scrollPane1 = new ScrollPane();

            scrollPane1.GridRow = 2;
            scrollPane1.Content = _textSource;

            _leftSplitPane    = new VerticalSplitPane();
            _leftSplitPane.Id = "_leftSplitPane";
            _leftSplitPane.Widgets.Add(_projectHolder);
            _leftSplitPane.Widgets.Add(scrollPane1);

            var horizontalSeparator1 = new HorizontalSeparator();

            horizontalSeparator1.GridRow = 1;

            _textStatus         = new TextBlock();
            _textStatus.Text    = "Reloading...";
            _textStatus.Id      = "_textStatus";
            _textStatus.GridRow = 2;

            var grid1 = new Grid();

            grid1.RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.RowsProportions.Add(new Grid.Proportion());
            grid1.RowsProportions.Add(new Grid.Proportion());
            grid1.Widgets.Add(_leftSplitPane);
            grid1.Widgets.Add(horizontalSeparator1);
            grid1.Widgets.Add(_textStatus);

            _propertyGridPane         = new ScrollPane();
            _propertyGridPane.Content = null;
            _propertyGridPane.Id      = "_propertyGridPane";

            var horizontalSeparator2 = new HorizontalSeparator();

            horizontalSeparator2.GridRow = 1;

            _textLocation         = new TextBlock();
            _textLocation.Text    = "Line: 1, Column: 2, Indent: 3";
            _textLocation.Id      = "_textLocation";
            _textLocation.GridRow = 2;

            var grid2 = new Grid();

            grid2.RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.RowsProportions.Add(new Grid.Proportion());
            grid2.RowsProportions.Add(new Grid.Proportion());
            grid2.GridColumn = 2;
            grid2.Widgets.Add(_propertyGridPane);
            grid2.Widgets.Add(horizontalSeparator2);
            grid2.Widgets.Add(_textLocation);

            _topSplitPane         = new HorizontalSplitPane();
            _topSplitPane.Id      = "_topSplitPane";
            _topSplitPane.GridRow = 1;
            _topSplitPane.Widgets.Add(grid1);
            _topSplitPane.Widgets.Add(grid2);


            RowsProportions.Add(new Grid.Proportion());
            RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            Id = "Root";
            Widgets.Add(horizontalMenu1);
            Widgets.Add(_topSplitPane);
        }
        private void BuildUI()
        {
            _menuItemOpenFile              = new MenuItem();
            _menuItemOpenFile.Text         = "&Open";
            _menuItemOpenFile.ShortcutText = "Ctrl+O";
            _menuItemOpenFile.Id           = "_menuItemOpenFile";

            _menuItemSaveFile              = new MenuItem();
            _menuItemSaveFile.Text         = "&Save";
            _menuItemSaveFile.ShortcutText = "Ctrl+S";
            _menuItemSaveFile.Id           = "_menuItemSaveFile";

            _menuItemChooseFolder              = new MenuItem();
            _menuItemChooseFolder.Text         = "Choose Fol&der";
            _menuItemChooseFolder.ShortcutText = "Ctrl+D";
            _menuItemChooseFolder.Id           = "_menuItemChooseFolder";

            _menuItemChooseColor              = new MenuItem();
            _menuItemChooseColor.Text         = "Choose Co&lor";
            _menuItemChooseColor.ShortcutText = "Ctrl+L";
            _menuItemChooseColor.Id           = "_menuItemChooseColor";

            var menuSeparator1 = new MenuSeparator();

            _menuItemQuit              = new MenuItem();
            _menuItemQuit.Text         = "&Quit";
            _menuItemQuit.ShortcutText = "Ctrl+Q";
            _menuItemQuit.Id           = "_menuItemQuit";

            _menuFile      = new MenuItem();
            _menuFile.Text = "&File";
            _menuFile.Id   = "_menuFile";
            _menuFile.Items.Add(_menuItemOpenFile);
            _menuFile.Items.Add(_menuItemSaveFile);
            _menuFile.Items.Add(_menuItemChooseFolder);
            _menuFile.Items.Add(_menuItemChooseColor);
            _menuFile.Items.Add(menuSeparator1);
            _menuFile.Items.Add(_menuItemQuit);

            _menuItemCopy              = new MenuItem();
            _menuItemCopy.Text         = "&Copy";
            _menuItemCopy.ShortcutText = "Ctrl+Insert, Ctrl+C";
            _menuItemCopy.Id           = "_menuItemCopy";

            _menuItemPaste              = new MenuItem();
            _menuItemPaste.Text         = "&Paste";
            _menuItemPaste.ShortcutText = "Shift+Insert, Ctrl+V";
            _menuItemPaste.Id           = "_menuItemPaste";

            var menuSeparator2 = new MenuSeparator();

            _menuItemUndo              = new MenuItem();
            _menuItemUndo.Text         = "&Undo";
            _menuItemUndo.ShortcutText = "Ctrl+Z";
            _menuItemUndo.Id           = "_menuItemUndo";

            _menuItemRedo              = new MenuItem();
            _menuItemRedo.Text         = "&Redo";
            _menuItemRedo.ShortcutText = "Ctrl+Y";
            _menuItemRedo.Id           = "_menuItemRedo";

            _menuEdit      = new MenuItem();
            _menuEdit.Text = "&Edit";
            _menuEdit.Id   = "_menuEdit";
            _menuEdit.Items.Add(_menuItemCopy);
            _menuEdit.Items.Add(_menuItemPaste);
            _menuEdit.Items.Add(menuSeparator2);
            _menuEdit.Items.Add(_menuItemUndo);
            _menuEdit.Items.Add(_menuItemRedo);

            _menuItemAbout      = new MenuItem();
            _menuItemAbout.Text = "&About";
            _menuItemAbout.Id   = "_menuItemAbout";

            _menuHelp      = new MenuItem();
            _menuHelp.Text = "&Help";
            _menuHelp.Id   = "_menuHelp";
            _menuHelp.Items.Add(_menuItemAbout);

            _mainMenu = new HorizontalMenu();
            _mainMenu.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _mainMenu.Id = "_mainMenu";
            _mainMenu.Items.Add(_menuFile);
            _mainMenu.Items.Add(_menuEdit);
            _mainMenu.Items.Add(_menuHelp);

            var label1 = new Label();

            label1.Text = "Button:";

            _buttonSaveFile            = new ImageTextButton();
            _buttonSaveFile.Text       = "Save File";
            _buttonSaveFile.Padding    = new Thickness(8, 0);
            _buttonSaveFile.GridColumn = 1;
            _buttonSaveFile.Id         = "_buttonSaveFile";

            _textSaveFile            = new TextBox();
            _textSaveFile.GridColumn = 2;
            _textSaveFile.Id         = "_textSaveFile";

            var label2 = new Label();

            label2.Text    = "Another Button:";
            label2.GridRow = 1;

            _buttonOpenFile            = new ImageTextButton();
            _buttonOpenFile.Text       = "Open File";
            _buttonOpenFile.Padding    = new Thickness(8, 0);
            _buttonOpenFile.GridColumn = 1;
            _buttonOpenFile.GridRow    = 1;
            _buttonOpenFile.Id         = "_buttonOpenFile";

            _textOpenFile            = new TextBox();
            _textOpenFile.GridColumn = 2;
            _textOpenFile.GridRow    = 1;
            _textOpenFile.Id         = "_textOpenFile";

            var label3 = new Label();

            label3.Text    = "Blue Button:";
            label3.GridRow = 2;

            _buttonChooseFolder            = new ImageTextButton("blue");
            _buttonChooseFolder.Text       = "Choose Folder";
            _buttonChooseFolder.Padding    = new Thickness(8, 0);
            _buttonChooseFolder.GridColumn = 1;
            _buttonChooseFolder.GridRow    = 2;
            _buttonChooseFolder.Id         = "_buttonChooseFolder";

            _textChooseFolder            = new TextBox();
            _textChooseFolder.GridColumn = 2;
            _textChooseFolder.GridRow    = 2;
            _textChooseFolder.Id         = "_textChooseFolder";

            _textButtonLabel         = new Label();
            _textButtonLabel.Text    = "Text Button:";
            _textButtonLabel.GridRow = 3;
            _textButtonLabel.Id      = "_textButtonLabel";

            _buttonChooseColor            = new TextButton();
            _buttonChooseColor.Text       = "Choose Color";
            _buttonChooseColor.Padding    = new Thickness(8, 0);
            _buttonChooseColor.GridColumn = 1;
            _buttonChooseColor.GridRow    = 3;
            _buttonChooseColor.Id         = "_buttonChooseColor";

            var label4 = new Label();

            label4.Text    = "Image Button:";
            label4.GridRow = 4;

            _imageButton            = new ImageButton();
            _imageButton.Padding    = new Thickness(8, 0);
            _imageButton.GridColumn = 1;
            _imageButton.GridRow    = 4;
            _imageButton.Id         = "_imageButton";

            var checkBox1 = new CheckBox();

            checkBox1.Text           = "This is checkbox";
            checkBox1.ImageWidth     = 10;
            checkBox1.ImageHeight    = 10;
            checkBox1.GridRow        = 5;
            checkBox1.GridColumnSpan = 2;

            var label5 = new Label();

            label5.Text    = "Horizontal Slider:";
            label5.GridRow = 6;

            var horizontalSlider1 = new HorizontalSlider();

            horizontalSlider1.GridColumn     = 1;
            horizontalSlider1.GridRow        = 6;
            horizontalSlider1.GridColumnSpan = 2;

            var label6 = new Label();

            label6.Text    = "Combo Box:";
            label6.GridRow = 7;

            var listItem1 = new ListItem();

            listItem1.Text  = "Red";
            listItem1.Color = Color.Red;

            var listItem2 = new ListItem();

            listItem2.Text  = "Green";
            listItem2.Color = Color.Lime;

            var listItem3 = new ListItem();

            listItem3.Text  = "Blue";
            listItem3.Color = ColorStorage.CreateColor(0, 128, 255, 255);

            var comboBox1 = new ComboBox();

            comboBox1.Width          = 200;
            comboBox1.GridColumn     = 1;
            comboBox1.GridRow        = 7;
            comboBox1.GridColumnSpan = 2;
            comboBox1.Items.Add(listItem1);
            comboBox1.Items.Add(listItem2);
            comboBox1.Items.Add(listItem3);

            var label7 = new Label();

            label7.Text    = "Text Field:";
            label7.GridRow = 8;

            var textBox1 = new TextBox();

            textBox1.GridColumn     = 1;
            textBox1.GridRow        = 8;
            textBox1.GridColumnSpan = 2;

            var label8 = new Label();

            label8.Text    = "Spin Button:";
            label8.GridRow = 9;

            var spinButton1 = new SpinButton();

            spinButton1.Value      = 1;
            spinButton1.Width      = 100;
            spinButton1.GridColumn = 1;
            spinButton1.GridRow    = 9;

            var label9 = new Label();

            label9.Text    = "List Box:";
            label9.GridRow = 10;

            var listItem4 = new ListItem();

            listItem4.Text  = "Red";
            listItem4.Color = Color.Red;

            var listItem5 = new ListItem();

            listItem5.Text  = "Green";
            listItem5.Color = Color.Lime;

            var listItem6 = new ListItem();

            listItem6.Text  = "Blue";
            listItem6.Color = Color.Blue;

            var listBox1 = new ListBox();

            listBox1.Width          = 200;
            listBox1.GridColumn     = 1;
            listBox1.GridRow        = 10;
            listBox1.GridColumnSpan = 2;
            listBox1.Items.Add(listItem4);
            listBox1.Items.Add(listItem5);
            listBox1.Items.Add(listItem6);

            var label10 = new Label();

            label10.Text    = "Vertical Menu:";
            label10.GridRow = 11;

            var menuItem1 = new MenuItem();

            menuItem1.Text = "Start New Game";

            var menuItem2 = new MenuItem();

            menuItem2.Text = "Options";

            var menuItem3 = new MenuItem();

            menuItem3.Text = "Quit";

            var verticalMenu1 = new VerticalMenu();

            verticalMenu1.GridColumn = 1;
            verticalMenu1.GridRow    = 11;
            verticalMenu1.Items.Add(menuItem1);
            verticalMenu1.Items.Add(menuItem2);
            verticalMenu1.Items.Add(menuItem3);

            var label11 = new Label();

            label11.Text    = "Tree";
            label11.GridRow = 12;

            _gridRight = new Grid();
            _gridRight.ColumnSpacing        = 8;
            _gridRight.RowSpacing           = 8;
            _gridRight.DefaultRowProportion = new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            };
            _gridRight.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            _gridRight.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            _gridRight.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            _gridRight.Id = "_gridRight";
            _gridRight.Widgets.Add(label1);
            _gridRight.Widgets.Add(_buttonSaveFile);
            _gridRight.Widgets.Add(_textSaveFile);
            _gridRight.Widgets.Add(label2);
            _gridRight.Widgets.Add(_buttonOpenFile);
            _gridRight.Widgets.Add(_textOpenFile);
            _gridRight.Widgets.Add(label3);
            _gridRight.Widgets.Add(_buttonChooseFolder);
            _gridRight.Widgets.Add(_textChooseFolder);
            _gridRight.Widgets.Add(_textButtonLabel);
            _gridRight.Widgets.Add(_buttonChooseColor);
            _gridRight.Widgets.Add(label4);
            _gridRight.Widgets.Add(_imageButton);
            _gridRight.Widgets.Add(checkBox1);
            _gridRight.Widgets.Add(label5);
            _gridRight.Widgets.Add(horizontalSlider1);
            _gridRight.Widgets.Add(label6);
            _gridRight.Widgets.Add(comboBox1);
            _gridRight.Widgets.Add(label7);
            _gridRight.Widgets.Add(textBox1);
            _gridRight.Widgets.Add(label8);
            _gridRight.Widgets.Add(spinButton1);
            _gridRight.Widgets.Add(label9);
            _gridRight.Widgets.Add(listBox1);
            _gridRight.Widgets.Add(label10);
            _gridRight.Widgets.Add(verticalMenu1);
            _gridRight.Widgets.Add(label11);

            var scrollViewer1 = new ScrollViewer();

            scrollViewer1.Content = _gridRight;

            var label12 = new Label();

            label12.Text = "Vertical Slider:";

            var verticalSlider1 = new VerticalSlider();

            verticalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            verticalSlider1.GridRow             = 1;

            var grid1 = new Grid();

            grid1.RowSpacing = 8;
            grid1.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            grid1.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            grid1.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            grid1.Widgets.Add(label12);
            grid1.Widgets.Add(verticalSlider1);

            var label13 = new Label();

            label13.Text = "Progress Bars:";

            _horizontalProgressBar         = new HorizontalProgressBar();
            _horizontalProgressBar.GridRow = 1;
            _horizontalProgressBar.Id      = "_horizontalProgressBar";

            _verticalProgressBar = new VerticalProgressBar();
            _verticalProgressBar.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _verticalProgressBar.GridRow             = 2;
            _verticalProgressBar.Id = "_verticalProgressBar";

            var grid2 = new Grid();

            grid2.RowSpacing = 8;
            grid2.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            grid2.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            grid2.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            grid2.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            grid2.Widgets.Add(label13);
            grid2.Widgets.Add(_horizontalProgressBar);
            grid2.Widgets.Add(_verticalProgressBar);

            var verticalSplitPane1 = new VerticalSplitPane();

            verticalSplitPane1.Widgets.Add(grid1);
            verticalSplitPane1.Widgets.Add(grid2);

            var horizontalSplitPane1 = new HorizontalSplitPane();

            horizontalSplitPane1.Widgets.Add(scrollViewer1);
            horizontalSplitPane1.Widgets.Add(verticalSplitPane1);


            Spacing = 8;
            Proportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            Proportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            Widgets.Add(_mainMenu);
            Widgets.Add(horizontalSplitPane1);
        }
Beispiel #10
0
        private void BuildUI()
        {
            _openModuleMenuItem              = new MenuItem();
            _openModuleMenuItem.Text         = "&Open Module...";
            _openModuleMenuItem.ShortcutText = "Ctrl+O";
            _openModuleMenuItem.Id           = "_openModuleMenuItem";

            _reloadModuleMenuItem              = new MenuItem();
            _reloadModuleMenuItem.Text         = "&Reload Module";
            _reloadModuleMenuItem.ShortcutText = "Ctrl+R";
            _reloadModuleMenuItem.Id           = "_reloadModuleMenuItem";

            var menuSeparator1 = new MenuSeparator();

            _switchMapMenuItem              = new MenuItem();
            _switchMapMenuItem.Text         = "S&witch Map...";
            _switchMapMenuItem.ShortcutText = "Ctrl+W";
            _switchMapMenuItem.Id           = "_switchMapMenuItem";

            _newMapMenuItem              = new MenuItem();
            _newMapMenuItem.Text         = "&New Map...";
            _newMapMenuItem.ShortcutText = "Ctrl+N";
            _newMapMenuItem.Id           = "_newMapMenuItem";

            _saveMapMenuItem              = new MenuItem();
            _saveMapMenuItem.Text         = "&Save Map";
            _saveMapMenuItem.ShortcutText = "Ctrl+S";
            _saveMapMenuItem.Id           = "_saveMapMenuItem";

            _saveMapAsMenuItem      = new MenuItem();
            _saveMapAsMenuItem.Text = "Save Map &As";
            _saveMapAsMenuItem.Id   = "_saveMapAsMenuItem";

            _resizeMapMenuItem      = new MenuItem();
            _resizeMapMenuItem.Text = "Resize &Map";
            _resizeMapMenuItem.Id   = "_resizeMapMenuItem";

            var menuSeparator2 = new MenuSeparator();

            _debugOptionsMenuItem      = new MenuItem();
            _debugOptionsMenuItem.Text = "&UI Debug Options";
            _debugOptionsMenuItem.Id   = "_debugOptionsMenuItem";

            var menuSeparator3 = new MenuSeparator();

            _quitMenuItem              = new MenuItem();
            _quitMenuItem.Text         = "&Quit";
            _quitMenuItem.ShortcutText = "Ctrl+Q";
            _quitMenuItem.Id           = "_quitMenuItem";

            var menuItem1 = new MenuItem();

            menuItem1.Text = "&File";
            menuItem1.Items.Add(_openModuleMenuItem);
            menuItem1.Items.Add(_reloadModuleMenuItem);
            menuItem1.Items.Add(menuSeparator1);
            menuItem1.Items.Add(_switchMapMenuItem);
            menuItem1.Items.Add(_newMapMenuItem);
            menuItem1.Items.Add(_saveMapMenuItem);
            menuItem1.Items.Add(_saveMapAsMenuItem);
            menuItem1.Items.Add(_resizeMapMenuItem);
            menuItem1.Items.Add(menuSeparator2);
            menuItem1.Items.Add(_debugOptionsMenuItem);
            menuItem1.Items.Add(menuSeparator3);
            menuItem1.Items.Add(_quitMenuItem);

            _aboutMenuItem      = new MenuItem();
            _aboutMenuItem.Text = "&About";
            _aboutMenuItem.Id   = "_aboutMenuItem";

            var menuItem2 = new MenuItem();

            menuItem2.Text = "&Help";
            menuItem2.Items.Add(_aboutMenuItem);

            _mainMenu = new HorizontalMenu();
            _mainMenu.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _mainMenu.Id = "_mainMenu";
            _mainMenu.Items.Add(menuItem1);
            _mainMenu.Items.Add(menuItem2);

            _textPosition         = new Label();
            _textPosition.GridRow = 1;
            _textPosition.Id      = "_textPosition";

            _leftContainer = new Grid();
            _leftContainer.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            _leftContainer.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            _leftContainer.Id = "_leftContainer";
            _leftContainer.Widgets.Add(_textPosition);

            _mapViewerContainer    = new Panel();
            _mapViewerContainer.Id = "_mapViewerContainer";

            _tilesItem      = new ListItem();
            _tilesItem.Text = "Tiles";
            _tilesItem.Id   = "_tilesItem";

            _tileObjectsItem      = new ListItem();
            _tileObjectsItem.Text = "Tile Objects";
            _tileObjectsItem.Id   = "_tileObjectsItem";

            _creaturesItem      = new ListItem();
            _creaturesItem.Text = "Creatures";
            _creaturesItem.Id   = "_creaturesItem";

            _comboItemTypes    = new ComboBox();
            _comboItemTypes.Id = "_comboItemTypes";
            _comboItemTypes.Items.Add(_tilesItem);
            _comboItemTypes.Items.Add(_tileObjectsItem);
            _comboItemTypes.Items.Add(_creaturesItem);

            var listItem1 = new ListItem();

            listItem1.Text = "testTile1";

            var listItem2 = new ListItem();

            listItem2.Text = "testTile2";

            _listBoxItems         = new ListBox();
            _listBoxItems.GridRow = 1;
            _listBoxItems.Id      = "_listBoxItems";
            _listBoxItems.Items.Add(listItem1);
            _listBoxItems.Items.Add(listItem2);

            var grid1 = new Grid();

            grid1.DefaultRowProportion = new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            };
            grid1.Widgets.Add(_comboItemTypes);
            grid1.Widgets.Add(_listBoxItems);

            var verticalSplitPane1 = new VerticalSplitPane();

            verticalSplitPane1.Widgets.Add(_mapViewerContainer);
            verticalSplitPane1.Widgets.Add(grid1);

            _topSplitPane         = new HorizontalSplitPane();
            _topSplitPane.GridRow = 1;
            _topSplitPane.Id      = "_topSplitPane";
            _topSplitPane.Widgets.Add(_leftContainer);
            _topSplitPane.Widgets.Add(verticalSplitPane1);


            RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            Id = "Root";
            Widgets.Add(_mainMenu);
            Widgets.Add(_topSplitPane);
        }
Beispiel #11
0
        private void BuildUI()
        {
            _menuFileNew      = new MenuItem();
            _menuFileNew.Id   = "_menuFileNew";
            _menuFileNew.Text = "&New";

            _menuFileOpen      = new MenuItem();
            _menuFileOpen.Id   = "_menuFileOpen";
            _menuFileOpen.Text = "&Open";

            _menuFileSave      = new MenuItem();
            _menuFileSave.Id   = "_menuFileSave";
            _menuFileSave.Text = "&Save";

            var menuSeparator1 = new MenuSeparator();

            _menuFileDebugOptions      = new MenuItem();
            _menuFileDebugOptions.Id   = "_menuFileDebugOptions";
            _menuFileDebugOptions.Text = "&UI Debug Options";

            var menuSeparator2 = new MenuSeparator();

            _quitMenuItem      = new MenuItem();
            _quitMenuItem.Id   = "_quitMenuItem";
            _quitMenuItem.Text = "&Quit";

            var menuItem1 = new MenuItem();

            menuItem1.Id   = "";
            menuItem1.Text = "&File";
            menuItem1.Items.Add(_menuFileNew);
            menuItem1.Items.Add(_menuFileOpen);
            menuItem1.Items.Add(_menuFileSave);
            menuItem1.Items.Add(menuSeparator1);
            menuItem1.Items.Add(_menuFileDebugOptions);
            menuItem1.Items.Add(menuSeparator2);
            menuItem1.Items.Add(_quitMenuItem);

            _menuControlsAddTileInfo      = new MenuItem();
            _menuControlsAddTileInfo.Id   = "_menuControlsAddTileInfo";
            _menuControlsAddTileInfo.Text = "Add &Tile Info";

            _menuControlsAddCreatureInfo      = new MenuItem();
            _menuControlsAddCreatureInfo.Id   = "_menuControlsAddCreatureInfo";
            _menuControlsAddCreatureInfo.Text = "Add &Creature Info";

            _menuControlsAddMap      = new MenuItem();
            _menuControlsAddMap.Id   = "_menuControlsAddMap";
            _menuControlsAddMap.Text = "Add &Map";

            _menuItems      = new MenuItem();
            _menuItems.Id   = "_menuItems";
            _menuItems.Text = "&Items";
            _menuItems.Items.Add(_menuControlsAddTileInfo);
            _menuItems.Items.Add(_menuControlsAddCreatureInfo);
            _menuItems.Items.Add(_menuControlsAddMap);

            _aboutMenuItem      = new MenuItem();
            _aboutMenuItem.Id   = "_aboutMenuItem";
            _aboutMenuItem.Text = "&About";

            var menuItem2 = new MenuItem();

            menuItem2.Id   = "";
            menuItem2.Text = "&Help";
            menuItem2.Items.Add(_aboutMenuItem);

            _mainMenu = new HorizontalMenu();
            _mainMenu.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _mainMenu.Id       = "_mainMenu";
            _mainMenu.CanFocus = true;
            _mainMenu.Items.Add(menuItem1);
            _mainMenu.Items.Add(_menuItems);
            _mainMenu.Items.Add(menuItem2);

            _leftContainer    = new Panel();
            _leftContainer.Id = "_leftContainer";

            _explorerContainer    = new Panel();
            _explorerContainer.Id = "_explorerContainer";

            _rightSplitPane            = new VerticalSplitPane();
            _rightSplitPane.Id         = "_rightSplitPane";
            _rightSplitPane.GridColumn = 2;
            _rightSplitPane.GridRow    = 1;
            _rightSplitPane.Widgets.Add(_explorerContainer);

            _topSplitPane         = new HorizontalSplitPane();
            _topSplitPane.Id      = "_topSplitPane";
            _topSplitPane.GridRow = 1;
            _topSplitPane.Widgets.Add(_leftContainer);
            _topSplitPane.Widgets.Add(_rightSplitPane);


            RowsProportions.Add(new Grid.Proportion());
            RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            Id = "Root";
            Widgets.Add(_mainMenu);
            Widgets.Add(_topSplitPane);
        }
Beispiel #12
0
        private void BuildUI()
        {
            _menuItemNew      = new MenuItem();
            _menuItemNew.Id   = "_menuItemNew";
            _menuItemNew.Text = "&New";

            _menuItemOpen      = new MenuItem();
            _menuItemOpen.Id   = "_menuItemOpen";
            _menuItemOpen.Text = "&Open";

            _menuItemSave      = new MenuItem();
            _menuItemSave.Id   = "_menuItemSave";
            _menuItemSave.Text = "&Save";

            _menuItemSaveAs      = new MenuItem();
            _menuItemSaveAs.Id   = "_menuItemSaveAs";
            _menuItemSaveAs.Text = "Save &As...";

            var menuSeparator1 = new MenuSeparator();

            _menuItemQuit      = new MenuItem();
            _menuItemQuit.Id   = "_menuItemQuit";
            _menuItemQuit.Text = "&Quit";

            var menuItem1 = new MenuItem();

            menuItem1.Id   = "";
            menuItem1.Text = "&File";
            menuItem1.Items.Add(_menuItemNew);
            menuItem1.Items.Add(_menuItemOpen);
            menuItem1.Items.Add(_menuItemSave);
            menuItem1.Items.Add(_menuItemSaveAs);
            menuItem1.Items.Add(menuSeparator1);
            menuItem1.Items.Add(_menuItemQuit);

            _menuItemCopy      = new MenuItem();
            _menuItemCopy.Id   = "_menuItemCopy";
            _menuItemCopy.Text = "&Copy";

            _menuItemPaste      = new MenuItem();
            _menuItemPaste.Id   = "_menuItemPaste";
            _menuItemPaste.Text = "&Paste";

            var menuSeparator2 = new MenuSeparator();

            _menuItemUndo      = new MenuItem();
            _menuItemUndo.Id   = "_menuItemUndo";
            _menuItemUndo.Text = "&Undo";

            _menuItemRedo      = new MenuItem();
            _menuItemRedo.Id   = "_menuItemRedo";
            _menuItemRedo.Text = "&Redo";

            var menuItem2 = new MenuItem();

            menuItem2.Id   = "";
            menuItem2.Text = "&Edit";
            menuItem2.Items.Add(_menuItemCopy);
            menuItem2.Items.Add(_menuItemPaste);
            menuItem2.Items.Add(menuSeparator2);
            menuItem2.Items.Add(_menuItemUndo);
            menuItem2.Items.Add(_menuItemRedo);

            _menuItemAbout      = new MenuItem();
            _menuItemAbout.Id   = "_menuItemAbout";
            _menuItemAbout.Text = "&About";

            var menuItem3 = new MenuItem();

            menuItem3.Id   = "";
            menuItem3.Text = "&Help";
            menuItem3.Items.Add(_menuItemAbout);

            var horizontalMenu1 = new HorizontalMenu();

            horizontalMenu1.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            horizontalMenu1.Items.Add(menuItem1);
            horizontalMenu1.Items.Add(menuItem2);
            horizontalMenu1.Items.Add(menuItem3);

            var textBlock1 = new TextBlock();

            textBlock1.Text = "Button:";
            textBlock1.Id   = "";

            _buttonSaveFile              = new Button();
            _buttonSaveFile.Text         = "Save File";
            _buttonSaveFile.Id           = "_buttonSaveFile";
            _buttonSaveFile.PaddingLeft  = 8;
            _buttonSaveFile.PaddingRight = 8;
            _buttonSaveFile.GridColumn   = 1;

            _textSaveFile            = new TextField();
            _textSaveFile.Text       = "";
            _textSaveFile.Id         = "_textSaveFile";
            _textSaveFile.GridColumn = 2;

            var textBlock2 = new TextBlock();

            textBlock2.Text    = "Another Button:";
            textBlock2.Id      = "";
            textBlock2.GridRow = 1;

            _buttonOpenFile              = new Button();
            _buttonOpenFile.Text         = "Open File";
            _buttonOpenFile.Id           = "_buttonOpenFile";
            _buttonOpenFile.PaddingLeft  = 8;
            _buttonOpenFile.PaddingRight = 8;
            _buttonOpenFile.GridColumn   = 1;
            _buttonOpenFile.GridRow      = 1;

            _textOpenFile            = new TextField();
            _textOpenFile.Text       = "";
            _textOpenFile.Id         = "_textOpenFile";
            _textOpenFile.GridColumn = 2;
            _textOpenFile.GridRow    = 1;

            var textBlock3 = new TextBlock();

            textBlock3.Text    = "Blue Button:";
            textBlock3.Id      = "";
            textBlock3.GridRow = 2;

            _buttonChooseFolder              = new Button("blue");
            _buttonChooseFolder.Text         = "Choose Folder";
            _buttonChooseFolder.Id           = "_buttonChooseFolder";
            _buttonChooseFolder.PaddingLeft  = 8;
            _buttonChooseFolder.PaddingRight = 8;
            _buttonChooseFolder.GridColumn   = 1;
            _buttonChooseFolder.GridRow      = 2;

            _textChooseFolder            = new TextField();
            _textChooseFolder.Text       = "";
            _textChooseFolder.Id         = "_textChooseFolder";
            _textChooseFolder.GridColumn = 2;
            _textChooseFolder.GridRow    = 2;

            _textButtonLabel         = new TextBlock();
            _textButtonLabel.Text    = "Text Button:";
            _textButtonLabel.Id      = "_textButtonLabel";
            _textButtonLabel.GridRow = 3;

            _buttonChooseColor              = new TextButton();
            _buttonChooseColor.Text         = "Choose Color";
            _buttonChooseColor.Id           = "_buttonChooseColor";
            _buttonChooseColor.PaddingLeft  = 8;
            _buttonChooseColor.PaddingRight = 8;
            _buttonChooseColor.GridColumn   = 1;
            _buttonChooseColor.GridRow      = 3;

            var textBlock4 = new TextBlock();

            textBlock4.Text    = "Image Button:";
            textBlock4.Id      = "";
            textBlock4.GridRow = 4;

            _imageButton              = new ImageButton();
            _imageButton.Id           = "_imageButton";
            _imageButton.PaddingLeft  = 8;
            _imageButton.PaddingRight = 8;
            _imageButton.GridColumn   = 1;
            _imageButton.GridRow      = 4;

            var checkBox1 = new CheckBox();

            checkBox1.Text           = "This is checkbox";
            checkBox1.ImageWidth     = 10;
            checkBox1.ImageHeight    = 10;
            checkBox1.GridRow        = 5;
            checkBox1.GridColumnSpan = 2;

            var textBlock5 = new TextBlock();

            textBlock5.Text    = "Horizontal Slider:";
            textBlock5.Id      = "";
            textBlock5.GridRow = 6;

            var horizontalSlider1 = new HorizontalSlider();

            horizontalSlider1.GridColumn     = 1;
            horizontalSlider1.GridRow        = 6;
            horizontalSlider1.GridColumnSpan = 2;

            var textBlock6 = new TextBlock();

            textBlock6.Text    = "Combo Box:";
            textBlock6.GridRow = 7;

            var listItem1 = new ListItem();

            listItem1.Id    = "";
            listItem1.Text  = "Red";
            listItem1.Color = Color.Red;

            var listItem2 = new ListItem();

            listItem2.Id    = null;
            listItem2.Text  = "Green";
            listItem2.Color = Color.Lime;

            var listItem3 = new ListItem();

            listItem3.Id    = null;
            listItem3.Text  = "Blue";
            listItem3.Color = new Color
            {
                B = 255,
                G = 128,
                R = 0,
                A = 255,
            };

            var comboBox1 = new ComboBox();

            comboBox1.SelectedIndex  = 1;
            comboBox1.Width          = 200;
            comboBox1.GridColumn     = 1;
            comboBox1.GridRow        = 7;
            comboBox1.GridColumnSpan = 2;
            comboBox1.Items.Add(listItem1);
            comboBox1.Items.Add(listItem2);
            comboBox1.Items.Add(listItem3);

            var textBlock7 = new TextBlock();

            textBlock7.Text    = "Text Field:";
            textBlock7.GridRow = 8;

            var textField1 = new TextField();

            textField1.Text           = "";
            textField1.GridColumn     = 1;
            textField1.GridRow        = 8;
            textField1.GridColumnSpan = 2;

            var textBlock8 = new TextBlock();

            textBlock8.Text    = "Spin Button:";
            textBlock8.GridRow = 9;

            var spinButton1 = new SpinButton();

            spinButton1.Width      = 100;
            spinButton1.GridColumn = 1;
            spinButton1.GridRow    = 9;

            var textBlock9 = new TextBlock();

            textBlock9.Text    = "List Box:";
            textBlock9.GridRow = 10;

            var listItem4 = new ListItem();

            listItem4.Id    = null;
            listItem4.Text  = "Red";
            listItem4.Color = Color.Red;

            var listItem5 = new ListItem();

            listItem5.Id    = null;
            listItem5.Text  = "Green";
            listItem5.Color = Color.Lime;

            var listItem6 = new ListItem();

            listItem6.Id    = null;
            listItem6.Text  = "Blue";
            listItem6.Color = Color.Blue;

            var listBox1 = new ListBox();

            listBox1.Width          = 200;
            listBox1.GridColumn     = 1;
            listBox1.GridRow        = 10;
            listBox1.GridColumnSpan = 2;
            listBox1.Items.Add(listItem4);
            listBox1.Items.Add(listItem5);
            listBox1.Items.Add(listItem6);

            var textBlock10 = new TextBlock();

            textBlock10.Text    = "Vertical Menu:";
            textBlock10.GridRow = 11;

            var menuItem4 = new MenuItem();

            menuItem4.Id   = "";
            menuItem4.Text = "Start New Game";

            var menuItem5 = new MenuItem();

            menuItem5.Id   = "";
            menuItem5.Text = "Options";

            var menuItem6 = new MenuItem();

            menuItem6.Id   = "";
            menuItem6.Text = "Quit";

            var verticalMenu1 = new VerticalMenu();

            verticalMenu1.GridColumn = 1;
            verticalMenu1.GridRow    = 11;
            verticalMenu1.Items.Add(menuItem4);
            verticalMenu1.Items.Add(menuItem5);
            verticalMenu1.Items.Add(menuItem6);

            var textBlock11 = new TextBlock();

            textBlock11.Text    = "Tree";
            textBlock11.GridRow = 12;

            _gridRight = new Grid();
            _gridRight.ColumnSpacing = 8;
            _gridRight.RowSpacing    = 8;
            _gridRight.ColumnsProportions.Add(new Grid.Proportion());
            _gridRight.ColumnsProportions.Add(new Grid.Proportion());
            _gridRight.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.Id = "_gridRight";
            _gridRight.Widgets.Add(textBlock1);
            _gridRight.Widgets.Add(_buttonSaveFile);
            _gridRight.Widgets.Add(_textSaveFile);
            _gridRight.Widgets.Add(textBlock2);
            _gridRight.Widgets.Add(_buttonOpenFile);
            _gridRight.Widgets.Add(_textOpenFile);
            _gridRight.Widgets.Add(textBlock3);
            _gridRight.Widgets.Add(_buttonChooseFolder);
            _gridRight.Widgets.Add(_textChooseFolder);
            _gridRight.Widgets.Add(_textButtonLabel);
            _gridRight.Widgets.Add(_buttonChooseColor);
            _gridRight.Widgets.Add(textBlock4);
            _gridRight.Widgets.Add(_imageButton);
            _gridRight.Widgets.Add(checkBox1);
            _gridRight.Widgets.Add(textBlock5);
            _gridRight.Widgets.Add(horizontalSlider1);
            _gridRight.Widgets.Add(textBlock6);
            _gridRight.Widgets.Add(comboBox1);
            _gridRight.Widgets.Add(textBlock7);
            _gridRight.Widgets.Add(textField1);
            _gridRight.Widgets.Add(textBlock8);
            _gridRight.Widgets.Add(spinButton1);
            _gridRight.Widgets.Add(textBlock9);
            _gridRight.Widgets.Add(listBox1);
            _gridRight.Widgets.Add(textBlock10);
            _gridRight.Widgets.Add(verticalMenu1);
            _gridRight.Widgets.Add(textBlock11);

            var scrollPane1 = new ScrollPane();

            scrollPane1.Child = _gridRight;

            var textBlock12 = new TextBlock();

            textBlock12.Text = "Vertical Slider:";

            var verticalSlider1 = new VerticalSlider();

            verticalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            verticalSlider1.GridRow             = 1;

            var grid1 = new Grid();

            grid1.RowSpacing = 8;
            grid1.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.RowsProportions.Add(new Grid.Proportion());
            grid1.RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.Widgets.Add(textBlock12);
            grid1.Widgets.Add(verticalSlider1);

            var textBlock13 = new TextBlock();

            textBlock13.Text = "Progress Bars:";

            _horizontalProgressBar         = new HorizontalProgressBar();
            _horizontalProgressBar.Id      = "_horizontalProgressBar";
            _horizontalProgressBar.GridRow = 1;

            _verticalProgressBar = new VerticalProgressBar();
            _verticalProgressBar.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _verticalProgressBar.Id      = "_verticalProgressBar";
            _verticalProgressBar.GridRow = 2;

            var grid2 = new Grid();

            grid2.RowSpacing = 8;
            grid2.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.RowsProportions.Add(new Grid.Proportion());
            grid2.RowsProportions.Add(new Grid.Proportion());
            grid2.RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.GridRow = 2;
            grid2.Widgets.Add(textBlock13);
            grid2.Widgets.Add(_horizontalProgressBar);
            grid2.Widgets.Add(_verticalProgressBar);

            var verticalSplitPane1 = new VerticalSplitPane();

            verticalSplitPane1.GridColumn = 2;
            verticalSplitPane1.Widgets.Add(grid1);
            verticalSplitPane1.Widgets.Add(grid2);

            var horizontalSplitPane1 = new HorizontalSplitPane();

            horizontalSplitPane1.GridRow = 1;
            horizontalSplitPane1.Widgets.Add(scrollPane1);
            horizontalSplitPane1.Widgets.Add(verticalSplitPane1);


            RowSpacing = 8;
            RowsProportions.Add(new Grid.Proportion());
            RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            Id = "Root";
            Widgets.Add(horizontalMenu1);
            Widgets.Add(horizontalSplitPane1);
        }
Beispiel #13
0
        private void BuildUI()
        {
            var textBlock1 = new TextBlock();

            textBlock1.Text = "Button:";
            textBlock1.Id   = "";

            _button      = new Button();
            _button.Text = "Button";
            _button.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _button.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _button.Id            = "_button";
            _button.PaddingLeft   = 8;
            _button.PaddingRight  = 8;
            _button.GridPositionX = 1;

            _textButtonLabel               = new TextBlock();
            _textButtonLabel.Text          = "Text Button:";
            _textButtonLabel.Id            = "_textButtonLabel";
            _textButtonLabel.GridPositionY = 1;

            _textButton      = new TextButton();
            _textButton.Text = "Text Button";
            _textButton.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _textButton.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Center;
            _textButton.Id            = "_textButton";
            _textButton.PaddingLeft   = 8;
            _textButton.PaddingRight  = 8;
            _textButton.GridPositionX = 1;
            _textButton.GridPositionY = 1;

            var textBlock2 = new TextBlock();

            textBlock2.Text          = "Image Button:";
            textBlock2.Id            = "";
            textBlock2.GridPositionY = 2;

            _imageButton = new ImageButton();
            _imageButton.ImageVisible = true;
            _imageButton.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _imageButton.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Center;
            _imageButton.Id            = "_imageButton";
            _imageButton.PaddingLeft   = 8;
            _imageButton.PaddingRight  = 8;
            _imageButton.GridPositionX = 1;
            _imageButton.GridPositionY = 2;

            var checkBox1 = new CheckBox();

            checkBox1.Text                       = "This is checkbox";
            checkBox1.ImageWidthHint             = 10;
            checkBox1.ImageHeightHint            = 10;
            checkBox1.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            checkBox1.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            checkBox1.GridPositionY              = 3;
            checkBox1.GridSpanX                  = 2;

            var textBlock3 = new TextBlock();

            textBlock3.Text          = "Horizontal Slider:";
            textBlock3.Id            = "";
            textBlock3.GridPositionY = 4;

            var horizontalSlider1 = new HorizontalSlider();

            horizontalSlider1.Maximum             = 100;
            horizontalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            horizontalSlider1.GridPositionX       = 1;
            horizontalSlider1.GridPositionY       = 4;

            var textBlock4 = new TextBlock();

            textBlock4.Text          = "Combo Box:";
            textBlock4.GridPositionY = 5;

            var listItem1 = new ListItem();

            listItem1.Id   = "";
            listItem1.Text = "Item 1";

            var listItem2 = new ListItem();

            listItem2.Text = "Item 2";

            var listItem3 = new ListItem();

            listItem3.Text = "Item 3";

            var comboBox1 = new ComboBox();

            comboBox1.WidthHint     = 200;
            comboBox1.GridPositionX = 1;
            comboBox1.GridPositionY = 5;
            comboBox1.Items.Add(listItem1);
            comboBox1.Items.Add(listItem2);
            comboBox1.Items.Add(listItem3);

            var textBlock5 = new TextBlock();

            textBlock5.Text          = "Text Field:";
            textBlock5.GridPositionY = 6;

            var textField1 = new TextField();

            textField1.Text = "";
            textField1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            textField1.GridPositionX       = 1;
            textField1.GridPositionY       = 6;
            textField1.ClipToBounds        = true;
            textField1.CanFocus            = true;

            var textBlock6 = new TextBlock();

            textBlock6.Text          = "List Box:";
            textBlock6.GridPositionY = 7;

            var listItem4 = new ListItem();

            listItem4.Text = "Item 1";

            var listItem5 = new ListItem();

            listItem5.Text = "Item 2";

            var listItem6 = new ListItem();

            listItem6.Text = "Item 3";

            var listBox1 = new ListBox();

            listBox1.DrawLinesColor      = Color.White;
            listBox1.WidthHint           = 200;
            listBox1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            listBox1.GridPositionX       = 1;
            listBox1.GridPositionY       = 7;
            listBox1.Items.Add(listItem4);
            listBox1.Items.Add(listItem5);
            listBox1.Items.Add(listItem6);

            var textBlock7 = new TextBlock();

            textBlock7.Text          = "Tree";
            textBlock7.GridPositionY = 8;

            _gridRight = new Grid();
            _gridRight.DrawLinesColor = Color.White;
            _gridRight.ColumnSpacing  = 8;
            _gridRight.RowSpacing     = 8;
            _gridRight.ColumnsProportions.Add(new Grid.Proportion());
            _gridRight.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.Id = "_gridRight";
            _gridRight.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _gridRight.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _gridRight.Widgets.Add(textBlock1);
            _gridRight.Widgets.Add(_button);
            _gridRight.Widgets.Add(_textButtonLabel);
            _gridRight.Widgets.Add(_textButton);
            _gridRight.Widgets.Add(textBlock2);
            _gridRight.Widgets.Add(_imageButton);
            _gridRight.Widgets.Add(checkBox1);
            _gridRight.Widgets.Add(textBlock3);
            _gridRight.Widgets.Add(horizontalSlider1);
            _gridRight.Widgets.Add(textBlock4);
            _gridRight.Widgets.Add(comboBox1);
            _gridRight.Widgets.Add(textBlock5);
            _gridRight.Widgets.Add(textField1);
            _gridRight.Widgets.Add(textBlock6);
            _gridRight.Widgets.Add(listBox1);
            _gridRight.Widgets.Add(textBlock7);

            var scrollPane1 = new ScrollPane();

            scrollPane1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            scrollPane1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            scrollPane1.ClipToBounds        = true;
            scrollPane1.CanFocus            = true;
            scrollPane1.Child = _gridRight;

            var textBlock8 = new TextBlock();

            textBlock8.Text = "Vertical Slider:";

            var verticalSlider1 = new VerticalSlider();

            verticalSlider1.Maximum             = 100;
            verticalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            verticalSlider1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            verticalSlider1.GridPositionY       = 1;

            var grid1 = new Grid();

            grid1.DrawLinesColor = Color.White;
            grid1.RowSpacing     = 8;
            grid1.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.RowsProportions.Add(new Grid.Proportion());
            grid1.RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            grid1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            grid1.Widgets.Add(textBlock8);
            grid1.Widgets.Add(verticalSlider1);

            var textBlock9 = new TextBlock();

            textBlock9.Text = "Progress Bars:";

            _horizontalProgressBar                     = new HorizontalProgressBar();
            _horizontalProgressBar.Maximum             = 100;
            _horizontalProgressBar.DrawLinesColor      = Color.White;
            _horizontalProgressBar.Id                  = "_horizontalProgressBar";
            _horizontalProgressBar.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _horizontalProgressBar.GridPositionY       = 1;

            _verticalProgressBar                     = new VerticalProgressBar();
            _verticalProgressBar.Maximum             = 100;
            _verticalProgressBar.DrawLinesColor      = Color.White;
            _verticalProgressBar.Id                  = "_verticalProgressBar";
            _verticalProgressBar.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _verticalProgressBar.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _verticalProgressBar.GridPositionY       = 2;

            var grid2 = new Grid();

            grid2.DrawLinesColor = Color.White;
            grid2.RowSpacing     = 8;
            grid2.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.RowsProportions.Add(new Grid.Proportion());
            grid2.RowsProportions.Add(new Grid.Proportion());
            grid2.RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            grid2.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            grid2.GridPositionY       = 2;
            grid2.Widgets.Add(textBlock9);
            grid2.Widgets.Add(_horizontalProgressBar);
            grid2.Widgets.Add(_verticalProgressBar);

            var verticalSplitPane1 = new VerticalSplitPane();

            verticalSplitPane1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            verticalSplitPane1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            verticalSplitPane1.GridPositionX       = 2;
            verticalSplitPane1.Widgets.Add(grid1);
            verticalSplitPane1.Widgets.Add(grid2);


            HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            GridPositionY       = 1;
            Widgets.Add(scrollPane1);
            Widgets.Add(verticalSplitPane1);
        }
        private void BuildUI()
        {
            _menuFileNew      = new MenuItem();
            _menuFileNew.Id   = "_menuFileNew";
            _menuFileNew.Text = "&New";

            _menuFileOpen      = new MenuItem();
            _menuFileOpen.Id   = "_menuFileOpen";
            _menuFileOpen.Text = "&Open";

            _menuFileReload      = new MenuItem();
            _menuFileReload.Id   = "_menuFileReload";
            _menuFileReload.Text = "&Reload";

            _menuFileSave      = new MenuItem();
            _menuFileSave.Id   = "_menuFileSave";
            _menuFileSave.Text = "&Save";

            _menuFileSaveAs      = new MenuItem();
            _menuFileSaveAs.Id   = "_menuFileSaveAs";
            _menuFileSaveAs.Text = "Save &As...";

            _menuFileExportToCS      = new MenuItem();
            _menuFileExportToCS.Id   = "_menuFileExportToCS";
            _menuFileExportToCS.Text = "&Export To C#...";

            var menuSeparator1 = new MenuSeparator();

            _menuFileLoadStylesheet      = new MenuItem();
            _menuFileLoadStylesheet.Id   = "_menuFileLoadStylesheet";
            _menuFileLoadStylesheet.Text = "&Load Stylesheet";

            _menuFileReloadStylesheet      = new MenuItem();
            _menuFileReloadStylesheet.Id   = "_menuFileReloadStylesheet";
            _menuFileReloadStylesheet.Text = "Rel&oad Stylesheet";

            _menuFileResetStylesheet      = new MenuItem();
            _menuFileResetStylesheet.Id   = "_menuFileResetStylesheet";
            _menuFileResetStylesheet.Text = "Rese&t Stylesheet";

            var menuSeparator2 = new MenuSeparator();

            _menuFileDebugOptions      = new MenuItem();
            _menuFileDebugOptions.Id   = "_menuFileDebugOptions";
            _menuFileDebugOptions.Text = "&UI Debug Options";

            var menuSeparator3 = new MenuSeparator();

            _menuFileQuit      = new MenuItem();
            _menuFileQuit.Id   = "_menuFileQuit";
            _menuFileQuit.Text = "&Quit";

            var menuItem1 = new MenuItem();

            menuItem1.Id   = "";
            menuItem1.Text = "&File";
            menuItem1.Items.Add(_menuFileNew);
            menuItem1.Items.Add(_menuFileOpen);
            menuItem1.Items.Add(_menuFileReload);
            menuItem1.Items.Add(_menuFileSave);
            menuItem1.Items.Add(_menuFileSaveAs);
            menuItem1.Items.Add(_menuFileExportToCS);
            menuItem1.Items.Add(menuSeparator1);
            menuItem1.Items.Add(_menuFileLoadStylesheet);
            menuItem1.Items.Add(_menuFileReloadStylesheet);
            menuItem1.Items.Add(_menuFileResetStylesheet);
            menuItem1.Items.Add(menuSeparator2);
            menuItem1.Items.Add(_menuFileDebugOptions);
            menuItem1.Items.Add(menuSeparator3);
            menuItem1.Items.Add(_menuFileQuit);

            _menuControlsAddButton      = new MenuItem();
            _menuControlsAddButton.Id   = "_menuControlsAddButton";
            _menuControlsAddButton.Text = "Add Button";

            _menuControlsAddCheckBox      = new MenuItem();
            _menuControlsAddCheckBox.Id   = "_menuControlsAddCheckBox";
            _menuControlsAddCheckBox.Text = "Add CheckBox";

            _menuControlsAddRadioButton      = new MenuItem();
            _menuControlsAddRadioButton.Id   = "_menuControlsAddRadioButton";
            _menuControlsAddRadioButton.Text = "Add RadioButton";

            _menuControlsAddImageButton      = new MenuItem();
            _menuControlsAddImageButton.Id   = "_menuControlsAddImageButton";
            _menuControlsAddImageButton.Text = "Add ImageButton";

            _menuControlsAddTextButton      = new MenuItem();
            _menuControlsAddTextButton.Id   = "_menuControlsAddTextButton";
            _menuControlsAddTextButton.Text = "Add TextButton";

            _menuControlsAddHorizontalSlider      = new MenuItem();
            _menuControlsAddHorizontalSlider.Id   = "_menuControlsAddHorizontalSlider";
            _menuControlsAddHorizontalSlider.Text = "Add Horizontal Slider";

            _menuControlsAddVerticalSlider      = new MenuItem();
            _menuControlsAddVerticalSlider.Id   = "_menuControlsAddVerticalSlider";
            _menuControlsAddVerticalSlider.Text = "Add Vertical Slider";

            _menuControlsAddHorizontalProgressBar      = new MenuItem();
            _menuControlsAddHorizontalProgressBar.Id   = "_menuControlsAddHorizontalProgressBar";
            _menuControlsAddHorizontalProgressBar.Text = "Add Horizontal ProgressBar";

            _menuControlsAddVerticalProgressBar      = new MenuItem();
            _menuControlsAddVerticalProgressBar.Id   = "_menuControlsAddVerticalProgressBar";
            _menuControlsAddVerticalProgressBar.Text = "Add Vertical ProgressBar";

            _menuControlsAddHorizontalSeparator      = new MenuItem();
            _menuControlsAddHorizontalSeparator.Id   = "_menuControlsAddHorizontalSeparator";
            _menuControlsAddHorizontalSeparator.Text = "Add Horizontal Separator";

            _menuControlsAddVerticalSeparator      = new MenuItem();
            _menuControlsAddVerticalSeparator.Id   = "_menuControlsAddVerticalSeparator";
            _menuControlsAddVerticalSeparator.Text = "Add Vertical Separator";

            _menuControlsAddComboBox      = new MenuItem();
            _menuControlsAddComboBox.Id   = "_menuControlsAddComboBox";
            _menuControlsAddComboBox.Text = "Add ComboBox";

            _menuControlsAddListBox      = new MenuItem();
            _menuControlsAddListBox.Id   = "_menuControlsAddListBox";
            _menuControlsAddListBox.Text = "Add ListBox";

            _menuControlsAddTabControl      = new MenuItem();
            _menuControlsAddTabControl.Id   = "_menuControlsAddTabControl";
            _menuControlsAddTabControl.Text = "Add TabControl";

            _menuControlsAddImage      = new MenuItem();
            _menuControlsAddImage.Id   = "_menuControlsAddImage";
            _menuControlsAddImage.Text = "Add Image";

            _menuControlsAddTextBlock      = new MenuItem();
            _menuControlsAddTextBlock.Id   = "_menuControlsAddTextBlock";
            _menuControlsAddTextBlock.Text = "Add TextBlock";

            _menuControlsAddTextField      = new MenuItem();
            _menuControlsAddTextField.Id   = "_menuControlsAddTextField";
            _menuControlsAddTextField.Text = "Add TextField";

            _menuControlsAddSpinButton      = new MenuItem();
            _menuControlsAddSpinButton.Id   = "_menuControlsAddSpinButton";
            _menuControlsAddSpinButton.Text = "Add SpinButton";

            var menuSeparator4 = new MenuSeparator();

            _menuControlsAddPanel      = new MenuItem();
            _menuControlsAddPanel.Id   = "_menuControlsAddPanel";
            _menuControlsAddPanel.Text = "Add Panel";

            _menuControlsAddGrid      = new MenuItem();
            _menuControlsAddGrid.Id   = "_menuControlsAddGrid";
            _menuControlsAddGrid.Text = "Add Grid";

            _menuControlsAddScrollPane      = new MenuItem();
            _menuControlsAddScrollPane.Id   = "_menuControlsAddScrollPane";
            _menuControlsAddScrollPane.Text = "Add ScrollPane";

            _menuControlsAddHorizontalSplitPane      = new MenuItem();
            _menuControlsAddHorizontalSplitPane.Id   = "_menuControlsAddHorizontalSplitPane";
            _menuControlsAddHorizontalSplitPane.Text = "Add Horizontal SplitPane";

            _menuControlsAddVerticalSplitPane      = new MenuItem();
            _menuControlsAddVerticalSplitPane.Id   = "_menuControlsAddVerticalSplitPane";
            _menuControlsAddVerticalSplitPane.Text = "Add Vertical SplitPane";

            _menuControlsAddWindow      = new MenuItem();
            _menuControlsAddWindow.Id   = "_menuControlsAddWindow";
            _menuControlsAddWindow.Text = "Add Window";

            _menuControlsAddDialog      = new MenuItem();
            _menuControlsAddDialog.Id   = "_menuControlsAddDialog";
            _menuControlsAddDialog.Text = "Add Dialog";

            var menuSeparator5 = new MenuSeparator();

            _menuControlsAddHorizontalMenu      = new MenuItem();
            _menuControlsAddHorizontalMenu.Id   = "_menuControlsAddHorizontalMenu";
            _menuControlsAddHorizontalMenu.Text = "Add HorizontalMenu";

            _menuControlsAddVerticalMenu      = new MenuItem();
            _menuControlsAddVerticalMenu.Id   = "_menuControlsAddVerticalMenu";
            _menuControlsAddVerticalMenu.Text = "Add Vertical Menu";

            _menuControlsAddMenuItem      = new MenuItem();
            _menuControlsAddMenuItem.Id   = "_menuControlsAddMenuItem";
            _menuControlsAddMenuItem.Text = "Add Menu Item";

            _menuControlsAddMenuSeparator      = new MenuItem();
            _menuControlsAddMenuSeparator.Id   = "_menuControlsAddMenuSeparator";
            _menuControlsAddMenuSeparator.Text = "Add Menu Separator";

            _menuControls      = new MenuItem();
            _menuControls.Id   = "_menuControls";
            _menuControls.Text = "&Controls";
            _menuControls.Items.Add(_menuControlsAddButton);
            _menuControls.Items.Add(_menuControlsAddCheckBox);
            _menuControls.Items.Add(_menuControlsAddRadioButton);
            _menuControls.Items.Add(_menuControlsAddImageButton);
            _menuControls.Items.Add(_menuControlsAddTextButton);
            _menuControls.Items.Add(_menuControlsAddHorizontalSlider);
            _menuControls.Items.Add(_menuControlsAddVerticalSlider);
            _menuControls.Items.Add(_menuControlsAddHorizontalProgressBar);
            _menuControls.Items.Add(_menuControlsAddVerticalProgressBar);
            _menuControls.Items.Add(_menuControlsAddHorizontalSeparator);
            _menuControls.Items.Add(_menuControlsAddVerticalSeparator);
            _menuControls.Items.Add(_menuControlsAddComboBox);
            _menuControls.Items.Add(_menuControlsAddListBox);
            _menuControls.Items.Add(_menuControlsAddTabControl);
            _menuControls.Items.Add(_menuControlsAddImage);
            _menuControls.Items.Add(_menuControlsAddTextBlock);
            _menuControls.Items.Add(_menuControlsAddTextField);
            _menuControls.Items.Add(_menuControlsAddSpinButton);
            _menuControls.Items.Add(menuSeparator4);
            _menuControls.Items.Add(_menuControlsAddPanel);
            _menuControls.Items.Add(_menuControlsAddGrid);
            _menuControls.Items.Add(_menuControlsAddScrollPane);
            _menuControls.Items.Add(_menuControlsAddHorizontalSplitPane);
            _menuControls.Items.Add(_menuControlsAddVerticalSplitPane);
            _menuControls.Items.Add(_menuControlsAddWindow);
            _menuControls.Items.Add(_menuControlsAddDialog);
            _menuControls.Items.Add(menuSeparator5);
            _menuControls.Items.Add(_menuControlsAddHorizontalMenu);
            _menuControls.Items.Add(_menuControlsAddVerticalMenu);
            _menuControls.Items.Add(_menuControlsAddMenuItem);
            _menuControls.Items.Add(_menuControlsAddMenuSeparator);

            _menuHelpAbout      = new MenuItem();
            _menuHelpAbout.Id   = "_menuHelpAbout";
            _menuHelpAbout.Text = "&About";

            var menuItem2 = new MenuItem();

            menuItem2.Id   = "";
            menuItem2.Text = "&Help";
            menuItem2.Items.Add(_menuHelpAbout);

            var horizontalMenu1 = new HorizontalMenu();

            horizontalMenu1.Id = "";
            horizontalMenu1.Items.Add(menuItem1);
            horizontalMenu1.Items.Add(_menuControls);
            horizontalMenu1.Items.Add(menuItem2);

            _projectHolder    = new Panel();
            _projectHolder.Id = "_projectHolder";

            _explorerHolder    = new Panel();
            _explorerHolder.Id = "_explorerHolder";

            _propertyGridPane         = new ScrollPane();
            _propertyGridPane.Child   = null;
            _propertyGridPane.Id      = "_propertyGridPane";
            _propertyGridPane.GridRow = 2;

            _rightSplitPane            = new VerticalSplitPane();
            _rightSplitPane.Id         = "_rightSplitPane";
            _rightSplitPane.GridColumn = 2;
            _rightSplitPane.Widgets.Add(_explorerHolder);
            _rightSplitPane.Widgets.Add(_propertyGridPane);

            _topSplitPane         = new HorizontalSplitPane();
            _topSplitPane.Id      = "_topSplitPane";
            _topSplitPane.GridRow = 1;
            _topSplitPane.Widgets.Add(_projectHolder);
            _topSplitPane.Widgets.Add(_rightSplitPane);


            RowsProportions.Add(new Grid.Proportion());
            RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            Id = "Root";
            Widgets.Add(horizontalMenu1);
            Widgets.Add(_topSplitPane);
        }