void UpdateChildren() { Proportions.Clear(); Splitters.Clear(); if (Items.Count > 0) { for (int i = 0; i < Items.Count - 1; i++) { Children.Add(Items[i]); var thumb = GenerateSplitThumb(); Splitters.Add(thumb); Children.Add(thumb); Proportions.Add(1d); } Children.Add(Items.Last()); Proportions.Add(1d); } }
private void BuildUI() { _imageCharacter = new Image(); _imageCharacter.Id = "_imageCharacter"; _labelName = new Label(); _labelName.Text = "Estelle"; _labelName.Id = "_labelName"; _labelText = new Label(); _labelText.Text = "Daddy's really late."; _labelText.Id = "_labelText"; var verticalStackPanel1 = new VerticalStackPanel(); verticalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); verticalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); verticalStackPanel1.Widgets.Add(_labelName); verticalStackPanel1.Widgets.Add(_labelText); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center; VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; Width = 700; Height = 220; Background = new SolidBrush("#0000007C"); Widgets.Add(_imageCharacter); Widgets.Add(verticalStackPanel1); }
public void AddFontSystem(string title, IFontLoader fontLoader) { var panel = new DesktopPanel { FontLoader = fontLoader }; panel._labelHeader.Text = title; if (Widgets.Count > 0) { Proportions.Add(new Proportion(ProportionType.Auto)); Widgets.Add(new VerticalSeparator()); } Proportions.Add(new Proportion(ProportionType.Auto)); Widgets.Add(panel); _panels.Add(panel); }
private void BuildUI() { menuItemOpen = new MenuItem(); menuItemOpen.Text = "Open ROM..."; menuItemOpen.Id = "menuItemOpen"; var menuSeparator1 = new MenuSeparator(); menuItemQuit = new MenuItem(); menuItemQuit.Text = "Quit"; menuItemQuit.Id = "menuItemQuit"; menuItemFile = new MenuItem(); menuItemFile.Text = "File"; menuItemFile.Id = "menuItemFile"; menuItemFile.Items.Add(menuItemOpen); menuItemFile.Items.Add(menuSeparator1); menuItemFile.Items.Add(menuItemQuit); _mainMenu = new HorizontalMenu(); _mainMenu.VerticalAlignment = VerticalAlignment.Stretch; _mainMenu.AcceptsKeyboardFocus = true; _mainMenu.Id = "_mainMenu"; _mainMenu.Items.Add(menuItemFile); Proportions.Add(new Proportion { Type = ProportionType.Auto, }); Proportions.Add(new Proportion { Type = ProportionType.Auto, }); Proportions.Add(new Proportion { Type = ProportionType.Fill, }); AcceptsKeyboardFocus = false; Widgets.Add(_mainMenu); }
private void BuildUI() { _mapViewContainer = new Panel(); _mapViewContainer.Id = "_mapViewContainer"; var horizontalSeparator1 = new HorizontalSeparator(); _buttonUse = new TextButton(); _buttonUse.Text = "\\c[green]E\\c[white]|Use"; _buttonUse.Width = 100; _buttonUse.Id = "_buttonUse"; _buttonCharacter = new TextButton(); _buttonCharacter.Text = "\\c[green]C\\c[white]haracter"; _buttonCharacter.Width = 100; _buttonCharacter.Id = "_buttonCharacter"; _buttonInventory = new TextButton(); _buttonInventory.Text = "\\c[green]I\\c[white]nventory"; _buttonInventory.Width = 100; _buttonInventory.Id = "_buttonInventory"; _buttonAbilities = new TextButton(); _buttonAbilities.Text = "\\c[green]A\\c[white]bilities"; _buttonAbilities.Width = 100; _buttonAbilities.Id = "_buttonAbilities"; var horizontalStackPanel1 = new HorizontalStackPanel(); horizontalStackPanel1.Spacing = 8; horizontalStackPanel1.Widgets.Add(_buttonUse); horizontalStackPanel1.Widgets.Add(_buttonCharacter); horizontalStackPanel1.Widgets.Add(_buttonInventory); horizontalStackPanel1.Widgets.Add(_buttonAbilities); var verticalStackPanel1 = new VerticalStackPanel(); verticalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); verticalStackPanel1.Widgets.Add(_mapViewContainer); verticalStackPanel1.Widgets.Add(horizontalSeparator1); verticalStackPanel1.Widgets.Add(horizontalStackPanel1); var verticalSeparator1 = new VerticalSeparator(); _labelHp = new Label(); _labelHp.Text = "HP: 50/100"; _labelHp.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center; _labelHp.Id = "_labelHp"; var verticalSeparator2 = new VerticalSeparator(); _labelMana = new Label(); _labelMana.Text = "MA: 50/100"; _labelMana.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center; _labelMana.Id = "_labelMana"; var verticalSeparator3 = new VerticalSeparator(); _labelStamina = new Label(); _labelStamina.Text = "ST: 50/100"; _labelStamina.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center; _labelStamina.Id = "_labelStamina"; var horizontalStackPanel2 = new HorizontalStackPanel(); horizontalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); horizontalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); horizontalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); horizontalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); horizontalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); horizontalStackPanel2.Widgets.Add(_labelHp); horizontalStackPanel2.Widgets.Add(verticalSeparator2); horizontalStackPanel2.Widgets.Add(_labelMana); horizontalStackPanel2.Widgets.Add(verticalSeparator3); horizontalStackPanel2.Widgets.Add(_labelStamina); var horizontalSeparator2 = new HorizontalSeparator(); _mapContainer = new Panel(); _mapContainer.Height = 247; _mapContainer.Id = "_mapContainer"; var horizontalSeparator3 = new HorizontalSeparator(); _logContainer = new Panel(); _logContainer.Id = "_logContainer"; var verticalStackPanel2 = new VerticalStackPanel(); verticalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); verticalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); verticalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); verticalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); verticalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); verticalStackPanel2.Widgets.Add(horizontalStackPanel2); verticalStackPanel2.Widgets.Add(horizontalSeparator2); verticalStackPanel2.Widgets.Add(_mapContainer); verticalStackPanel2.Widgets.Add(horizontalSeparator3); verticalStackPanel2.Widgets.Add(_logContainer); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, Value = 2, }); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); Widgets.Add(verticalStackPanel1); Widgets.Add(verticalSeparator1); Widgets.Add(verticalStackPanel2); }
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); }
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); }
private void BuildUI() { var label1 = new Label(); label1.Text = "Font Resolution Factor:"; _spinButtonFontResolutionFactor = new SpinButton(); _spinButtonFontResolutionFactor.Value = 2; _spinButtonFontResolutionFactor.Width = 50; _spinButtonFontResolutionFactor.Id = "_spinButtonFontResolutionFactor"; var horizontalStackPanel1 = new HorizontalStackPanel(); horizontalStackPanel1.Spacing = 8; horizontalStackPanel1.Widgets.Add(label1); horizontalStackPanel1.Widgets.Add(_spinButtonFontResolutionFactor); var verticalSeparator1 = new VerticalSeparator(); var label2 = new Label(); label2.Text = "Kernel Width:"; _spinButtonKernelWidth = new SpinButton(); _spinButtonKernelWidth.Value = 2; _spinButtonKernelWidth.Integer = true; _spinButtonKernelWidth.Width = 50; _spinButtonKernelWidth.Id = "_spinButtonKernelWidth"; var horizontalStackPanel2 = new HorizontalStackPanel(); horizontalStackPanel2.Spacing = 8; horizontalStackPanel2.Widgets.Add(label2); horizontalStackPanel2.Widgets.Add(_spinButtonKernelWidth); var verticalSeparator2 = new VerticalSeparator(); var label3 = new Label(); label3.Text = "Kernel Height:"; _spinButtonKernelHeight = new SpinButton(); _spinButtonKernelHeight.Value = 2; _spinButtonKernelHeight.Integer = true; _spinButtonKernelHeight.Width = 50; _spinButtonKernelHeight.Id = "_spinButtonKernelHeight"; var horizontalStackPanel3 = new HorizontalStackPanel(); horizontalStackPanel3.Spacing = 8; horizontalStackPanel3.Widgets.Add(label3); horizontalStackPanel3.Widgets.Add(_spinButtonKernelHeight); var verticalSeparator3 = new VerticalSeparator(); var label4 = new Label(); label4.Text = "Scale:"; _spinButtonScale = new SpinButton(); _spinButtonScale.Value = 2; _spinButtonScale.Width = 50; _spinButtonScale.Id = "_spinButtonScale"; var horizontalStackPanel4 = new HorizontalStackPanel(); horizontalStackPanel4.Spacing = 8; horizontalStackPanel4.Widgets.Add(label4); horizontalStackPanel4.Widgets.Add(_spinButtonScale); var verticalSeparator4 = new VerticalSeparator(); _checkBoxDrawBackground = new CheckBox(); _checkBoxDrawBackground.Text = "Draw Background"; _checkBoxDrawBackground.Id = "_checkBoxDrawBackground"; var horizontalStackPanel5 = new HorizontalStackPanel(); horizontalStackPanel5.Widgets.Add(horizontalStackPanel1); horizontalStackPanel5.Widgets.Add(verticalSeparator1); horizontalStackPanel5.Widgets.Add(horizontalStackPanel2); horizontalStackPanel5.Widgets.Add(verticalSeparator2); horizontalStackPanel5.Widgets.Add(horizontalStackPanel3); horizontalStackPanel5.Widgets.Add(verticalSeparator3); horizontalStackPanel5.Widgets.Add(horizontalStackPanel4); horizontalStackPanel5.Widgets.Add(verticalSeparator4); horizontalStackPanel5.Widgets.Add(_checkBoxDrawBackground); var horizontalSeparator1 = new HorizontalSeparator(); _panelTopContainer = new Panel(); _panelTopContainer.Id = "_panelTopContainer"; var horizontalSeparator2 = new HorizontalSeparator(); _panelBottomContainer = new Panel(); _panelBottomContainer.Id = "_panelBottomContainer"; Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); Widgets.Add(horizontalStackPanel5); Widgets.Add(horizontalSeparator1); Widgets.Add(_panelTopContainer); Widgets.Add(horizontalSeparator2); Widgets.Add(_panelBottomContainer); }
private void BuildUI() { menuItemNew = new MenuItem(); menuItemNew.Id = "menuItemNew"; menuItemNew.Text = "&New"; menuItemNew.ShortcutText = "Ctrl+N"; menuItemOpen = new MenuItem(); menuItemOpen.Id = "menuItemOpen"; menuItemOpen.Text = "&Open..."; menuItemOpen.ShortcutText = "Ctrl+O"; menuItemSave = new MenuItem(); menuItemSave.Id = "menuItemSave"; menuItemSave.Text = "&Save"; menuItemSave.ShortcutText = "Ctrl+S"; menuItemSaveAs = new MenuItem(); menuItemSaveAs.Id = "menuItemSaveAs"; menuItemSaveAs.Text = "Save &As..."; menuItemSaveAs.ShortcutText = "Ctrl+A"; var menuSeparator1 = new MenuSeparator(); menuItemDebugOptions = new MenuItem(); menuItemDebugOptions.Id = "menuItemDebugOptions"; menuItemDebugOptions.Text = "Debug Options"; var menuSeparator2 = new MenuSeparator(); menuItemQuit = new MenuItem(); menuItemQuit.Id = "menuItemQuit"; menuItemQuit.Text = "&Quit"; menuItemQuit.ShortcutText = "Ctrl+Q"; menuItemFile = new MenuItem(); menuItemFile.Id = "menuItemFile"; menuItemFile.Text = "&File"; menuItemFile.Items.Add(menuItemNew); menuItemFile.Items.Add(menuItemOpen); menuItemFile.Items.Add(menuItemSave); menuItemFile.Items.Add(menuItemSaveAs); menuItemFile.Items.Add(menuSeparator1); menuItemFile.Items.Add(menuItemDebugOptions); menuItemFile.Items.Add(menuSeparator2); menuItemFile.Items.Add(menuItemQuit); menuItemAbout = new MenuItem(); menuItemAbout.Id = "menuItemAbout"; menuItemAbout.Text = "About"; menuItemHelp = new MenuItem(); menuItemHelp.Id = "menuItemHelp"; menuItemHelp.Text = "&Help"; menuItemHelp.Items.Add(menuItemAbout); _mainMenu = new HorizontalMenu(); _mainMenu.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch; _mainMenu.Id = "_mainMenu"; _mainMenu.Items.Add(menuItemFile); _mainMenu.Items.Add(menuItemHelp); var horizontalSeparator1 = new HorizontalSeparator(); textArea = new TextBox(); textArea.Text = ""; textArea.Multiline = true; textArea.Wrap = true; textArea.Id = "textArea"; textArea.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch; var scrollViewer1 = new ScrollViewer(); scrollViewer1.Content = textArea; Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); 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(horizontalSeparator1); Widgets.Add(scrollViewer1); }
private void BuildUI() { _textPath = new TextBox(); _textPath.Readonly = true; _textPath.Width = 300; _textPath.Id = "_textPath"; _buttonChange = new TextButton(); _buttonChange.Text = "Change..."; _buttonChange.Id = "_buttonChange"; _labelIndex = new Label(); _labelIndex.Text = "Index: "; _labelIndex.Id = "_labelIndex"; var label1 = new Label(); label1.Text = "Start"; _numericAnimationStart = new SpinButton(); _numericAnimationStart.Minimum = 0; _numericAnimationStart.Integer = true; _numericAnimationStart.Width = 32; _numericAnimationStart.Id = "_numericAnimationStart"; var label2 = new Label(); label2.Text = "Step"; _numericAnimationStep = new SpinButton(); _numericAnimationStep.Maximum = 8; _numericAnimationStep.Minimum = 0; _numericAnimationStep.Value = 8; _numericAnimationStep.Integer = true; _numericAnimationStep.Width = 32; _numericAnimationStep.Id = "_numericAnimationStep"; _textAnimationTotal = new Label(); _textAnimationTotal.Text = "Total: 64"; _textAnimationTotal.Id = "_textAnimationTotal"; _boxAnimation = new HorizontalStackPanel(); _boxAnimation.Spacing = 8; _boxAnimation.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center; _boxAnimation.Id = "_boxAnimation"; _boxAnimation.Widgets.Add(label1); _boxAnimation.Widgets.Add(_numericAnimationStart); _boxAnimation.Widgets.Add(label2); _boxAnimation.Widgets.Add(_numericAnimationStep); _boxAnimation.Widgets.Add(_textAnimationTotal); _textScenarioLocation = new Label(); _textScenarioLocation.Text = "Location:"; _textScenarioLocation.Id = "_textScenarioLocation"; var label3 = new Label(); label3.Text = "Functions"; var listItem1 = new ListItem(); listItem1.Text = "0x3AA"; var listItem2 = new ListItem(); listItem2.Text = "0x77B"; var listItem3 = new ListItem(); listItem3.Text = "0x7B3"; var listItem4 = new ListItem(); listItem4.Text = "0x7C9"; var listItem5 = new ListItem(); listItem5.Text = "0x1DFD"; _comboFunctions = new ComboBox(); _comboFunctions.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _comboFunctions.Id = "_comboFunctions"; _comboFunctions.Items.Add(listItem1); _comboFunctions.Items.Add(listItem2); _comboFunctions.Items.Add(listItem3); _comboFunctions.Items.Add(listItem4); _comboFunctions.Items.Add(listItem5); _boxScenarios = new HorizontalStackPanel(); _boxScenarios.Spacing = 8; _boxScenarios.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center; _boxScenarios.Id = "_boxScenarios"; _boxScenarios.Widgets.Add(_textScenarioLocation); _boxScenarios.Widgets.Add(label3); _boxScenarios.Widgets.Add(_comboFunctions); _buttonAbout = new TextButton(); _buttonAbout.Text = "About"; _buttonAbout.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Right; _buttonAbout.Id = "_buttonAbout"; _boxTop = new HorizontalStackPanel(); _boxTop.Spacing = 8; _boxTop.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); _boxTop.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); _boxTop.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); _boxTop.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); _boxTop.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); _boxTop.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); _boxTop.Id = "_boxTop"; _boxTop.Widgets.Add(_textPath); _boxTop.Widgets.Add(_buttonChange); _boxTop.Widgets.Add(_labelIndex); _boxTop.Widgets.Add(_boxAnimation); _boxTop.Widgets.Add(_boxScenarios); _boxTop.Widgets.Add(_buttonAbout); var listItem6 = new ListItem(); listItem6.Text = "Textures"; var listItem7 = new ListItem(); listItem7.Text = "Models"; var listItem8 = new ListItem(); listItem8.Text = "Images"; var listItem9 = new ListItem(); listItem9.Text = "Animations"; var listItem10 = new ListItem(); listItem10.Text = "Scenes"; _comboResourceType = new ComboBox(); _comboResourceType.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _comboResourceType.Id = "_comboResourceType"; _comboResourceType.Items.Add(listItem6); _comboResourceType.Items.Add(listItem7); _comboResourceType.Items.Add(listItem8); _comboResourceType.Items.Add(listItem9); _comboResourceType.Items.Add(listItem10); _textFilter = new TextBox(); _textFilter.Id = "_textFilter"; var listItem11 = new ListItem(); listItem11.Text = "TEXTURE1._DS"; var listItem12 = new ListItem(); listItem12.Text = "TEXTURE2._DS"; _listFiles = new ListBox(); _listFiles.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _listFiles.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch; _listFiles.Id = "_listFiles"; _listFiles.Items.Add(listItem11); _listFiles.Items.Add(listItem12); var verticalStackPanel1 = new VerticalStackPanel(); verticalStackPanel1.Spacing = 8; verticalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); verticalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); verticalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); verticalStackPanel1.Width = 150; verticalStackPanel1.Widgets.Add(_comboResourceType); verticalStackPanel1.Widgets.Add(_textFilter); verticalStackPanel1.Widgets.Add(_listFiles); _panelViewer = new Panel(); _panelViewer.Id = "_panelViewer"; _textStatus = new Label(); _textStatus.Text = "Processing mesh 23/40..."; _textStatus.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Bottom; _textStatus.Id = "_textStatus"; var panel1 = new Panel(); panel1.Widgets.Add(_panelViewer); panel1.Widgets.Add(_textStatus); _buttonPlayPause = new TextButton(); _buttonPlayPause.Text = "Play/Pause"; _buttonPlayPause.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _buttonPlayPause.Id = "_buttonPlayPause"; _sliderPlayer = new HorizontalSlider(); _sliderPlayer.Id = "_sliderPlayer"; _labelDuration = new Label(); _labelDuration.Text = "03:10/15:00"; _labelDuration.Id = "_labelDuration"; _panelPlayer = new HorizontalStackPanel(); _panelPlayer.Spacing = 8; _panelPlayer.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); _panelPlayer.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); _panelPlayer.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Bottom; _panelPlayer.Id = "_panelPlayer"; _panelPlayer.Widgets.Add(_buttonPlayPause); _panelPlayer.Widgets.Add(_sliderPlayer); _panelPlayer.Widgets.Add(_labelDuration); var verticalStackPanel2 = new VerticalStackPanel(); verticalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); verticalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); verticalStackPanel2.Widgets.Add(panel1); verticalStackPanel2.Widgets.Add(_panelPlayer); var horizontalStackPanel1 = new HorizontalStackPanel(); horizontalStackPanel1.Spacing = 8; horizontalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); horizontalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); horizontalStackPanel1.Widgets.Add(verticalStackPanel1); horizontalStackPanel1.Widgets.Add(verticalStackPanel2); Spacing = 8; Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); Widgets.Add(_boxTop); Widgets.Add(horizontalStackPanel1); }