public About () { this.Title = "About Eto Test"; #if DESKTOP this.Resizable = true; #endif var layout = new DynamicLayout (this, new Padding (20, 5), new Size(10, 10)); layout.AddCentered(new ImageView{ Image = Icon.FromResource ("Eto.Test.TestIcon.ico") }, true, true); layout.Add (new Label{ Text = "Test Application", Font = new Font(SystemFont.Bold, 16), HorizontalAlign = HorizontalAlign.Center }); var version = Assembly.GetEntryAssembly ().GetName ().Version; layout.Add (new Label { Text = string.Format("Version {0}", version), Font = new Font(SystemFont.Default, 8), HorizontalAlign = HorizontalAlign.Center }); layout.Add (new Label{ Text = "Copyright 2011 by Curtis Wensley aka Eto", Font = new Font(SystemFont.Default, 8), HorizontalAlign = HorizontalAlign.Center }); layout.AddCentered (CloseButton ()); }
void Init() { //_textBoxUrl _textBoxUrl = new TextBox(); //_buttonReadFile _buttonReadFile = new Button { Text = StrRes.GetString("StrLoad", "Load") }; _buttonReadFile.Click += _buttonReadFile_Click; //_buttonSaveFile _buttonSaveFile = new Button {Text = StrRes.GetString("StrSave","Save")}; _buttonSaveFile.Click += _buttonSaveFile_Click; //_textAreaBody _textAreaBody = new TextArea(); var layout = new DynamicLayout { Padding = new Padding(5, 5), Spacing = new Size(5, 5) }; layout.BeginVertical(); layout.BeginHorizontal(); layout.AddCentered(_textBoxUrl, xscale: true, horizontalCenter: false); layout.AddCentered(_buttonReadFile, horizontalCenter: false); layout.AddCentered(_buttonSaveFile, horizontalCenter: false); layout.EndBeginHorizontal(); layout.EndVertical(); layout.AddRow(_textAreaBody); Content = layout; }
public About () { this.Title = "About Eto Test"; #if DESKTOP this.Resizable = true; #endif var layout = new DynamicLayout (this); layout.AddCentered(new ImageView{ Image = Icon.FromResource ("Eto.Test.TestIcon.ico"), Size = new Size(128, 128) }, true, true); layout.Add (new Label{ Text = "Test Application", Font = new Font(FontFamily.Sans, 16, FontStyle.Bold), HorizontalAlign = HorizontalAlign.Center }); var version = Assembly.GetEntryAssembly ().GetName ().Version; layout.Add (new Label { Text = string.Format("Version {0}", version), HorizontalAlign = HorizontalAlign.Center }); layout.Add (new Label{ Text = "Copyright 2011 by Curtis Wensley aka Eto", HorizontalAlign = HorizontalAlign.Center }); layout.AddCentered (CloseButton ()); }
public AboutDialog() { this.MinimumSize = new Size(250, 250); var smallFont = new Font(SystemFont.Default, 10); var largeFont = new Font(SystemFont.Bold, 14); var version = GetType().Assembly.GetName().Version; var versionString = string.Format("Version {0}.{1} ({2}.{3})", version.Major, version.Minor, version.Build, version.Revision); var layout = new DynamicLayout(); layout.AddCentered(new ImageView { Image = Icon.FromResource ("JabbR.Desktop.Resources.JabbR.ico"), Size = new Size(128, 128) }, yscale: true); layout.AddCentered(new Label { Text = Application.Instance.Name, Font = largeFont }); layout.AddCentered(new Label { Text = versionString, Font = smallFont }, new Padding(2)); layout.AddCentered(new Label { Text = "Copyright © 2013 Curtis Wensley", Font = smallFont }, new Padding(2)); if (!Generator.IsMac) { layout.AddCentered(CloseButton()); } Content = layout; }
public About() { this.Title = AltStrRes.AboutAltman; this.Resizable = false; //this.Size = new Size(300, 300); var layout = new DynamicLayout { Padding = new Padding(0, 0), Spacing = new Size(5, 5) }; layout.AddCentered(new ImageView { Image = Icons.AltmanAboutPng }, padding: null, xscale: true, yscale: false); //Version layout.Add(new Label { Text = "Version", Font = new Font(SystemFont.Bold, 10), }); layout.Add(new Label { Text = " " + AppEnvironment.AppVersion, Font = new Font(SystemFont.Default, 10), }); //License layout.Add(new Label { Text = "License", Font = new Font(SystemFont.Bold, 10), }); layout.Add(new Label { Text = " " + "Released under the GNU General Public License v2", Font = new Font(SystemFont.Default, 10), }); //Copyright layout.Add(new Label { Text = "Copyright", Font = new Font(SystemFont.Bold, 10), }); layout.Add(new Label { Text = " " + "(C) 2013-2014 by KeePwn", Font = new Font(SystemFont.Default, 10), }); layout.AddCentered(CloseButton()); Content = layout; }
Dialog CreateDialog() { var dialog = new Dialog(); dialog.DisplayMode = DisplayMode; var layout = new DynamicLayout(); layout.AddCentered(new Label { Text = "Content" }, yscale: true); dialog.DefaultButton = new Button { Text = "Default Button" }; dialog.AbortButton = new Button { Text = "Abort Button" }; dialog.DefaultButton.Click += delegate { MessageBox.Show("Default button clicked"); }; dialog.AbortButton.Click += delegate { MessageBox.Show("Abort button clicked"); dialog.Close(); }; layout.BeginVertical(); layout.AddRow(null, dialog.DefaultButton, dialog.AbortButton); layout.EndVertical(); dialog.Content = layout; return dialog; }
public RuntimeSection () { var layout = new DynamicLayout (this); layout.AddCentered (ToggleButton ()); layout.Add (MainTable ()); }
Control Vertical() { var control = SetInitialValue(); control.Size = new Size(-1, 150); control.Orientation = SliderOrientation.Vertical; var layout = new DynamicLayout(); layout.AddCentered(control); return layout; }
public RuntimeSection() { var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.AddCentered(ToggleButton()); layout.Add(MainTable()); Content = layout; }
void Init() { _textAreaInput = new TextArea(); _textAreaInput.Font = new Font(FontFamilies.Monospace, 10); _dropDownServices = new DropDown {Width = 200}; _dropDownServices.SelectedIndexChanged += DropDownServicesSelectedIndexChanged; _radioButtonEncode = new RadioButton {Text = "Encode"}; _radioButtonEncode.CheckedChanged += _radioButtonEncode_CheckedChanged; _radioButtonDecode = new RadioButton(_radioButtonEncode) {Text = "Decode"}; _buttonRun = new Button { Text = "Run" }; _buttonRun.Click += _buttonRun_Click; _textAreaOutput = new TextArea(); _textAreaOutput.Font = new Font(FontFamilies.Monospace, 10); var inputLayout = new DynamicLayout {Padding = new Padding(5, 5, 5, 0), Spacing = new Size(5, 5)}; inputLayout.AddSeparateRow(_textAreaInput); var outputLayout = new DynamicLayout {Padding = new Padding(5, 5), Spacing = new Size(5, 5)}; outputLayout.BeginVertical(); outputLayout.BeginHorizontal(); outputLayout.AddCentered(_radioButtonEncode, horizontalCenter: false); outputLayout.AddCentered(_radioButtonDecode, horizontalCenter: false); outputLayout.Add(null); outputLayout.AddCentered(_dropDownServices, horizontalCenter: false); outputLayout.AddCentered(_buttonRun, horizontalCenter: false); outputLayout.EndHorizontal(); outputLayout.EndVertical(); outputLayout.AddSeparateRow(_textAreaOutput); var layout = new Splitter { Panel1 = inputLayout, Panel2 = outputLayout, Orientation = SplitterOrientation.Vertical, Position = 130 }; Content = layout; }
public About() { this.Title = "About Eto Test"; this.Resizable = true; var layout = new DynamicLayout { Padding = new Padding(20, 5), Spacing = new Size(10, 10) }; layout.AddCentered(new ImageView { Image = Icon.FromResource ("Eto.Test.TestIcon.ico", GetType()) }, padding: null, xscale: true, yscale: true); layout.Add(new Label { Text = "Test Application", Font = new Font(SystemFont.Bold, 20), HorizontalAlign = HorizontalAlign.Center }); #if PCL var version = GetType().GetTypeInfo().Assembly.GetName().Version; #else var version = Assembly.GetEntryAssembly().GetName().Version; #endif layout.Add(new Label { Text = string.Format("Version {0}", version), Font = new Font(SystemFont.Default, 10), HorizontalAlign = HorizontalAlign.Center }); layout.Add(new Label { Text = "Copyright 2013 by Curtis Wensley aka Eto", Font = new Font(SystemFont.Default, 10), HorizontalAlign = HorizontalAlign.Center }); layout.AddCentered(CloseButton()); Content = layout; }
public SplitterSection() { var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.Add(null); var xthemed = new CheckBox { Text = "Use Themed Splitter" }; layout.AddCentered(xthemed); layout.AddSeparateRow(null, Test1WithSize(), Test1AutoSize(), null); layout.AddSeparateRow(null, Test1WithFullScreenAndSize(), Test1FullScreenAndAutoSize(), null); layout.AddSeparateRow(null, Test2WithSize(), Test2AutoSize(), null); layout.AddCentered(TestDynamic()); layout.AddCentered(TestInitResize()); layout.AddCentered(TestHiding()); layout.Add(null); Content = layout; xthemed.CheckedChanged += (s, e) => { useThemed = xthemed.Checked == true; }; }
public PenSection() { PenThickness = 4; var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.AddSeparateRow(null, PenJoinControl(), PenCapControl(), DashStyleControl(), null); if (Platform.Supports<NumericUpDown>()) layout.AddSeparateRow(null, PenThicknessControl(), null); layout.AddCentered(GetDrawable()); Content = layout; }
Control PickFontFamily() { var fontFamilyName = new TextBox { Text = "Times, serif", Size = new Size (200, -1) }; var button = new Button { Text = "Set" }; button.Click += (sender, e) => { try { UpdatePreview(new Font(fontFamilyName.Text, selectedFont.Size)); } catch (Exception ex) { Log.Write(this, "Exception: {0}", ex); } }; var layout = new DynamicLayout(Padding.Empty); layout.BeginHorizontal(); layout.AddCentered(fontFamilyName, Padding.Empty, Size.Empty); layout.AddCentered(button, Padding.Empty, Size.Empty); return layout; }
Control Default(Size? size = null) { var control = new Spinner(); if (size != null) control.Size = size.Value; var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5) }; layout.AddCentered(control); layout.BeginVertical(); layout.AddRow(null, StartStopButton(control), null); layout.EndVertical(); return layout; }
static Control SetBadgeLabel() { var layout = new DynamicLayout { Spacing = new Size(5, 5) }; layout.BeginHorizontal(); var text = new TextBox(); var button = new Button { Text = "Set Badge Label" }; button.Click += (sender, e) => Application.Instance.BadgeLabel = text.Text; layout.Add(new Label { Text = "Badge Label Text:", VerticalAlignment = VerticalAlignment.Center }); layout.AddCentered(text); layout.Add(button); layout.EndHorizontal(); return layout; }
public SplitterSection() { var layout = new DynamicLayout(); layout.Add(null); layout.AddCentered(Test1WithSize()); layout.AddCentered(Test1AutoSize()); layout.AddCentered(Test1WithFullScreenAndSize()); layout.AddCentered(Test1FullScreenAndAutoSize()); layout.AddCentered(Test2WithSize()); layout.AddCentered(Test2AutoSize()); layout.AddCentered(TestDynamic()); layout.Add(null); Content = layout; }
public DateTimePickerSection() { var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.BeginVertical(); layout.AddRow("Default", Default(), "Default with Value", DefaultWithValue(), null); layout.AddRow("Date", DateControl(), "Date with Value", DateControlWithValue()); layout.AddRow("Time", TimeControl(), "Time with Value", TimeControlWithValue()); layout.AddRow("Date/Time", DateTimeControl(), "Date/Time with Value", DateTimeControlWithValue()); layout.EndVertical(); layout.AddCentered(TestProperties()); // growing space at end is blank! layout.Add(null); Content = layout; }
Control SetBadgeLabel() { var layout = new DynamicLayout(); layout.BeginHorizontal(); TextBox text = new TextBox(); Button button = new Button { Text = "Set Badge Label" }; button.Click += (sender, e) => { Application.Instance.BadgeLabel = text.Text; }; layout.Add(new Label { Text = "Badge Label Text:", VerticalAlign = VerticalAlign.Middle }); layout.AddCentered(text); layout.Add(button); layout.EndHorizontal(); return layout; }
public DateTimePickerSection() { var layout = new DynamicLayout(); layout.BeginVertical(); layout.AddRow(new Label { Text = "Default" }, Default(), new Label { Text = "Default with Value" }, DefaultWithValue(), null); layout.AddRow(new Label { Text = "Date" }, DateControl(), new Label { Text = "Date with Value" }, DateControlWithValue()); layout.AddRow(new Label { Text = "Time" }, TimeControl(), new Label { Text = "Time with Value" }, TimeControlWithValue()); layout.AddRow(new Label { Text = "Date/Time" }, DateTimeControl(), new Label { Text = "Date/Time with Value" }, DateTimeControlWithValue()); layout.EndVertical(); layout.AddCentered(TestProperties()); // growing space at end is blank! layout.Add(null); Content = layout; }
public About() { /* dialog attributes */ this.Text = "About Notedown"; this.ClientSize = new Size(300, 280); this.Resizable = false; /* dialog controls */ var imageView = new ImageView(); imageView.Image = Icon.FromResource("Icon.ico"); imageView.Size = new Size(128, 128); var labelTitle = new Label(); labelTitle.Text = "Notedown"; labelTitle.Size = new Size(240, 24); labelTitle.Font = new Font(FontFamily.Sans, 16); labelTitle.HorizontalAlign = HorizontalAlign.Center; var version = Assembly.GetExecutingAssembly().GetName().Version; var labelVersion = new Label(); labelVersion.Text = string.Format("Version {0}", version); labelVersion.HorizontalAlign = HorizontalAlign.Center; var labelCopyright = new Label(); labelCopyright.Text = "Copyright by Andre Straubmeier"; labelCopyright.HorizontalAlign = HorizontalAlign.Center; var button = new Button(); button.Text = "Close"; button.Size = new Size(90, 26); button.Click += delegate { Close(); }; /* dialog layout */ var layout = new DynamicLayout(this); layout.AddColumn(imageView, labelTitle, labelVersion, labelCopyright); layout.AddCentered(button); }
void RenderContent() { var linkButtonCreditIcons = new LinkButton { Text = "VisualPharm" }; linkButtonCreditIcons.Click += delegate { Process.Start("http://www.visualpharm.com"); }; ButtonShowThirdPartyLicenses.Click += delegate { if (CheckThirdPartyLicensesAvailability()) { Process.Start(Utilities.PathDirectoryThirdPartyLicenses); } }; var dynamicLayoutMain = new DynamicLayout { Padding = new Padding(Utilities.Padding6), Spacing = Utilities.Spacing6 }; dynamicLayoutMain.BeginHorizontal(); dynamicLayoutMain.BeginVertical(); dynamicLayoutMain.AddCentered(new ImageView { Image = Utilities.LoadImage("Icon-192x192", true) }); dynamicLayoutMain.EndVertical(); dynamicLayoutMain.BeginVertical(); dynamicLayoutMain.Add(new TableLayout( new TableRow( new Label { Text = Desktop.Properties.Resources.TextClientName, TextAlignment = TextAlignment.Center, Font = new Font(SystemFont.Default, Utilities.FontSize3) } ), new TableRow( new Label { Text = "v" + Utilities.ApplicationVersionString, TextAlignment = TextAlignment.Center } ), new Panel { Height = Utilities.Padding3 }, new TableRow( TextAreaLicense ) { ScaleHeight = true }, new Panel { Height = Utilities.Padding3 }, new TableRow( new TableRow( new TableCell( new TableLayout( new TableRow( new TableCell(new Label { Text = Desktop.Properties.Resources.AboutWindowCreditIcons + " " }, true) ), new TableRow( new TableCell(linkButtonCreditIcons, true) ) ), true ), new TableCell(ButtonShowThirdPartyLicenses) ) ) )); dynamicLayoutMain.EndVertical(); dynamicLayoutMain.EndHorizontal(); Content = dynamicLayoutMain; }
void Init() { //_buttonConnect _buttonConnect = new Button { Text = StrRes.GetString("StrConnect","Connect"), Image = Icons.ConnectIcon }; _buttonConnect.Click += ButtonConnect_Click; //_buttonDisconnect _buttonDisconnect = new Button { Text = StrRes.GetString("StrDisconnect","Disconnect"), Image = Icons.DisconnectIcon }; _buttonDisconnect.Click += _buttonDisconnect_Click; //_dropDownDbs _dropDownDbs = new DropDown {Width = 200}; //_buttonRunScript _buttonRunScript = new Button {Text = StrRes.GetString("StrExecute","Execute"), Image = Icons.RunScripIcon}; _buttonRunScript.Click += _buttonRunScript_Click; //_itemSaveAsCsv _itemSaveAsCsv = new ButtonMenuItem { Text = StrRes.GetString("StrSaveAsCsv","SaveAs .Csv") }; _itemSaveAsCsv.Click += _itemSaveAsCsv_Click; //_itemViewTable _itemViewTable = new ButtonMenuItem { Text = StrRes.GetString("StrViewTable","ViewTable") }; _itemViewTable.Click += _itemViewTable_Click; _itemViewTable.Enabled = false; //_itemCopyName _itemCopyName = new ButtonMenuItem { Text = StrRes.GetString("StrCopyName","CopyName") }; _itemCopyName.Click += _itemCopyName_Click; //_menuDbView _menuDbView = new ContextMenu(); _menuDbView.Items.Add(_itemCopyName); _menuDbView.Items.Add(_itemViewTable); //_menuResultView _menuResultView = new ContextMenu(); _menuResultView.Items.Add(_itemSaveAsCsv); //_treeViewDbs _treeViewDbs = new TreeView(); _treeViewDbs.ContextMenu = _menuDbView; _treeViewDbs.SelectionChanged += _treeViewDbs_SelectionChanged; _treeViewDbs.Activated += _treeViewDbs_Activated; _treeViewDbs.MouseUp += (sender, e) => { if (e.Buttons == MouseButtons.Alternate) { _treeViewDbs.ContextMenu.Show(_treeViewDbs); } }; //_textAreaSql _textAreaSql = new TextArea {Font = new Font(FontFamilies.Sans, 12, FontStyle.Bold | FontStyle.Italic)}; //_gridViewResult _gridViewResult = new GridView(); _gridViewResult.ContextMenu = _menuResultView; _gridViewResult.Style = "GridViewResult"; _gridViewResult.MouseUp += (sender, e) => { if (e.Buttons == MouseButtons.Alternate) { _gridViewResult.ContextMenu.Show(_treeViewDbs); } }; //topLayout var topLayout = new DynamicLayout(); topLayout.BeginHorizontal(); topLayout.AddCentered(_buttonConnect, horizontalCenter: false); topLayout.AddCentered(_buttonDisconnect, horizontalCenter: false); topLayout.AddCentered(_dropDownDbs, horizontalCenter: false); topLayout.AddCentered(_buttonRunScript, horizontalCenter: false); topLayout.Add(null); topLayout.EndVertical(); //rightPanel var rightPanel = new Splitter { Panel1 = _textAreaSql, Panel2 = _gridViewResult, Orientation = SplitterOrientation.Vertical, Position = 100 }; //mainLayout var mainLayout = new Splitter { Panel1 = _treeViewDbs, Panel2 = rightPanel, Orientation = SplitterOrientation.Horizontal, Position = 200 }; //layout var layout = new DynamicLayout { Padding = new Padding(0, 0), Spacing = new Size(5, 5) }; layout.AddRow(topLayout); layout.AddRow(mainLayout); Content = layout; }
private void Init() { _textBoxInput = new TextBox { Size = new Size(200, -1) }; _buttonOnline = new Button { Text = "Online Query", Size = new Size(150, -1) }; _buttonOnline.Click += _buttonOnline_Click; _buttonOffline = new Button { Text = "Offline Query", Size = new Size(150, -1) }; _buttonOffline.Click += _buttonOffline_Click; var cellPadding = new Padding(1, 1, 1, 1); var cellPaddingLeft = new Padding(1, 1, 0, 1); var cellPaddingRight = new Padding(0, 1, 1, 1); _labelA = ColumnContent(""); _labelB = ColumnContent(""); _labelC = ColumnContent(""); _labelD = ColumnContent(""); _labelE = ColumnContent(""); _labelF = ColumnContent(""); _otherTable = new TableLayout(3, 5); //{ BackgroundColor = Colors.Black }; //row1 _otherTable.Add(new Panel { Content = ColumnTitle("From Taobao"), Padding = new Padding(1, 0, 0, 0) }, 0, 1, true, false); _otherTable.Add(new Panel { Content = ColumnTitle("From Tencent") }, 1, 1, true, false); _otherTable.Add(new Panel { Content = ColumnTitle("From Sina"), Padding = new Padding(0, 0, 1, 0) }, 2, 1, true, false); //row2 _otherTable.Add(new Panel { Content = _labelA, Padding = cellPaddingLeft }, 0, 2, true, true); _otherTable.Add(new Panel { Content = _labelB, Padding = cellPaddingLeft }, 1, 2, true, true); _otherTable.Add(new Panel { Content = _labelC, Padding = cellPadding }, 2, 2, true, true); //row3 //_otherTable.Add(new Panel { Content = ColumnTitle("From IPB"), Padding = new Padding(1, 0, 0, 0) }, 0, 3, true, false); //_otherTable.Add(new Panel { Content = ColumnTitle("From Cz88") }, 1, 3, true, false); //_otherTable.Add(new Panel { Content = ColumnTitle("From MaxMind GeoLite2"), Padding = new Padding(0, 0, 1, 0) }, 2, 3, true, false); //row4 //_otherTable.Add(new Panel { Content = _labelD, Padding = cellPaddingLeft }, 0, 4, true, true); //_otherTable.Add(new Panel { Content = _labelE, Padding = cellPaddingLeft }, 1, 4, true, true); //_otherTable.Add(new Panel { Content = _labelF, Padding = cellPadding }, 2, 4, true, true); _mainTable = new TableLayout(1, 2) {BackgroundColor = Colors.LightGrey}; _mainTable.Add(new Panel { Content = _lableIp = new Label { Text = "", Font = new Font(FontFamilies.Sans, 20), VerticalAlign = VerticalAlign.Middle, HorizontalAlign = HorizontalAlign.Center, Size = new Size(-1, 100), BackgroundColor = Colors.White }, Padding = cellPadding }, 0, 0, true, false); _mainTable.Add(_otherTable, 0, 1, true, true); var layout = new DynamicLayout { Padding = new Padding(10, 10), Spacing = new Size(5, 5) }; layout.BeginVertical(); layout.BeginHorizontal(); layout.AddCentered(_textBoxInput); layout.Add(_buttonOnline); layout.Add(_buttonOffline); layout.Add(null); layout.AddCentered(new Label { Text = "Data from 17mon.cn" }); layout.EndHorizontal(); layout.EndVertical(); layout.Add(_mainTable); Content = layout; }
void CreateChild() { if (child != null) child.Close(); child = new Form { Title = "Child Window", ClientSize = new Size (300, 200), WindowStyle = styleCombo.SelectedValue, WindowState = stateCombo.SelectedValue, Topmost = topMostCheckBox.Checked ?? false, Resizable = resizableCheckBox.Checked ?? false, Maximizable = maximizableCheckBox.Checked ?? false, Minimizable = minimizableCheckBox.Checked ?? false, ShowInTaskbar = showInTaskBarCheckBox.Checked ?? false }; var layout = new DynamicLayout(); layout.Add(null); layout.AddCentered(SendToBackButton()); layout.AddCentered(CloseButton()); layout.Add(null); child.Content = layout; child.WindowStateChanged += child_WindowStateChanged; child.Closed += child_Closed; child.Shown += child_Shown; child.GotFocus += child_GotFocus; child.LostFocus += child_LostFocus; child.LocationChanged += child_LocationChanged; child.SizeChanged += child_SizeChanged; bringToFrontButton.Enabled = true; child.Show(); }
private void CreateInputSection() { var inGrp = new GroupBox { Text = "Input" }; var layout = new DynamicLayout(inGrp); layout.BeginVertical(); _tabGroup = new TabControl(); var fileTab = CreateFromFileTab(); var deviceTab = CreateFromDeviceTab(); _tabGroup.TabPages.Add(fileTab); _tabGroup.TabPages.Add(deviceTab); layout.AddRow(_tabGroup); var parseButton = new Button { Text = "Parse" }; parseButton.Click += parseButton_Click; layout.BeginHorizontal(); layout.AddCentered(parseButton); layout.EndHorizontal(); layout.EndVertical(); _inputSection = inGrp; }
void Init() { //_textboxUrl _textboxUrl = new TextBox(); _textboxUrl.KeyDown += _textboxUrl_KeyDown; //_buttonDir _buttonDir = new Button {Text = StrRes.GetString("StrDir","Dir")}; _buttonDir.Click += _buttonDir_Click; //_treeViewDirs _treeViewDirs = new TreeViewPlus(); _treeViewDirs.Activated += _treeViewDirs_Activated; //_itemCopyNodePath _itemCopyNodePath = new ButtonMenuItem { Text = StrRes.GetString("StrCopyNodePath", "Copy Path") }; _itemCopyNodePath.Click += _itemCopyNodePath_Click; //rightMenu_TreeViewDirs var rightMenuTreeViewDirs = new ContextMenu(); rightMenuTreeViewDirs.Items.Add(_itemCopyNodePath); _treeViewDirs.ContextMenu = rightMenuTreeViewDirs; _treeViewDirs.MouseUp += (sender, e) => { if (e.Buttons == MouseButtons.Alternate) { _treeViewDirs.ContextMenu.Show(_treeViewDirs); } }; _gridViewFile = new GridView { AllowMultipleSelection = false, BackgroundColor = Colors.White, ShowCellBorders = false, RowHeight = 21 }; _gridViewFile.CellEditing += _gridViewFile_CellEditing; _gridViewFile.CellEdited += _gridViewFile_CellEdited; _gridViewFile.CellDoubleClick += _gridViewFile_CellDoubleClick; _gridViewFile.ColumnHeaderClick += _gridViewFile_ColumnHeaderClick; _gridViewFile.Columns.Add(new GridColumn { ID = "Image", HeaderText = ">", //DataCell = new ImageTextCell("Image","Name"), DataCell = new ImageViewCell("Image"), Sortable = true, Resizable = false, Width = 21 }); _gridViewFile.Columns.Add(new GridColumn { ID = "Name", HeaderText = StrRes.GetString("StrName","Name"), DataCell = new TextBoxCell("Name"), Sortable = true, AutoSize = false, Editable = true, Width = 200 }); _gridViewFile.Columns.Add(new GridColumn { ID = "Time", HeaderText = StrRes.GetString("StrTime","Time"), DataCell = new TextBoxCell("FileMTime"), Sortable = true, AutoSize = false, Editable = true, Width = 150 }); _gridViewFile.Columns.Add(new GridColumn { ID = "Size", HeaderText = StrRes.GetString("StrSize","Size"), DataCell = new TextBoxCell("FileSize"), Sortable = true, AutoSize = false, Width = 100 }); _gridViewFile.Columns.Add(new GridColumn { ID = "Attribute", HeaderText = StrRes.GetString("StrAttribute","Attribute"), DataCell = new TextBoxCell("FileAttributes"), Sortable = true, AutoSize = false, Width = 70 }); _gridViewFile.MouseUp += (sender, e) => { if (e.Buttons == MouseButtons.Alternate) { if (_gridViewFile.ContextMenu!=null) _gridViewFile.ContextMenu.Show(_gridViewFile); } }; var layout = new DynamicLayout { Padding = new Padding(0, 0), Spacing = new Size(5, 5) }; layout.BeginVertical(); layout.BeginHorizontal(); layout.AddCentered(_textboxUrl, xscale: true, horizontalCenter: false); layout.AddCentered(_buttonDir, horizontalCenter: false); layout.EndHorizontal(); layout.EndVertical(); layout.AddRow(new Splitter { Panel1 = _treeViewDirs, Panel2 = _gridViewFile, Orientation = SplitterOrientation.Horizontal, Position = 200, }); Content = layout; }
void CreateChild() { if (child != null) child.Close(); Action show; var layout = new DynamicLayout(); layout.Add(null); layout.AddCentered(TestChangeSizeButton()); layout.AddCentered(TestChangeClientSizeButton()); layout.AddCentered(SendToBackButton()); layout.AddCentered(CreateCancelClose()); layout.AddCentered(CloseButton()); if (typeRadio.SelectedKey == "form") { var form = new Form(); child = form; show = form.Show; } else { var dialog = new Dialog(); dialog.DefaultButton = new Button { Text = "Default" }; dialog.DefaultButton.Click += (sender, e) => Log.Write(dialog, "Default button clicked"); dialog.AbortButton = new Button { Text = "Abort" }; dialog.AbortButton.Click += (sender, e) => Log.Write(dialog, "Abort button clicked"); layout.AddSeparateRow(null, dialog.DefaultButton, dialog.AbortButton, null); child = dialog; show = dialog.ShowModal; } layout.Add(null); child.Content = layout; child.OwnerChanged += child_OwnerChanged; child.WindowStateChanged += child_WindowStateChanged; child.Closed += child_Closed; child.Closing += child_Closing; child.Shown += child_Shown; child.GotFocus += child_GotFocus; child.LostFocus += child_LostFocus; child.LocationChanged += child_LocationChanged; child.SizeChanged += child_SizeChanged; child.Title = "Child Window"; child.WindowStyle = styleCombo.SelectedValue; child.WindowState = stateCombo.SelectedValue; child.Topmost = topMostCheckBox.Checked ?? false; child.Resizable = resizableCheckBox.Checked ?? false; child.Maximizable = maximizableCheckBox.Checked ?? false; child.Minimizable = minimizableCheckBox.Checked ?? false; child.ShowInTaskbar = showInTaskBarCheckBox.Checked ?? false; if (setInitialLocation) child.Location = initialLocation; if (setInitialClientSize) child.ClientSize = initialClientSize; if (setInitialMinimumSize) child.MinimumSize = initialMinimumSize; if (setOwnerCheckBox.Checked ?? false) child.Owner = ParentWindow; bringToFrontButton.Enabled = true; show(); // show that the child is now referenced Log.Write(null, "Open Windows: {0}", Application.Instance.Windows.Count()); }
void Init() { //_textBoxUrl _textBoxUrl = new TextBox(); //_buttonReadFile _buttonReadFile = new Button { Text = StrRes.GetString("StrLoad", "Load") }; _buttonReadFile.Click += _buttonReadFile_Click; //_buttonSaveFile _buttonSaveFile = new Button {Text = StrRes.GetString("StrSave","Save")}; _buttonSaveFile.Click += _buttonSaveFile_Click; //_textAreaBody _textAreaBody = new TextArea(); //rightMenu_Body var rightMenuBody = new ContextMenu(); var findCommand = new Command { MenuText = StrRes.GetString("StrFind", "Find"), Shortcut = Keys.F | Application.Instance.CommonModifier }; findCommand.Executed += findCommand_Executed; rightMenuBody.Items.Add(findCommand); var layout = new DynamicLayout { Padding = new Padding(5, 5), Spacing = new Size(5, 5) }; layout.BeginVertical(); layout.BeginHorizontal(); layout.AddCentered(_textBoxUrl, xscale: true, horizontalCenter: false); layout.AddCentered(_buttonReadFile, horizontalCenter: false); layout.AddCentered(_buttonSaveFile, horizontalCenter: false); layout.EndBeginHorizontal(); layout.EndVertical(); layout.AddRow(_textAreaBody); // bug in gtk2 layout.ContextMenu = rightMenuBody; layout.MouseUp += (sender, e) => { if (e.Buttons == MouseButtons.Alternate) { layout.ContextMenu.Show(_textAreaBody); } }; Content = layout; }