public SessionChooser() { this.Size = new Size(640, 480); _existingPage = new TabPage(); _existingPage.Text = Constants.ExistingSessionText; _picker = new SessionPicker(); _picker.SessionChosen += _pickerSessionChosen; _existingPage.Content = _picker; _newPage = new TabPage(); _newPage.Text = Constants.NewSessionText; _creator = new SessionCreator(); _creator.SessionCreated += _creatorSessionCreated; _newPage.Content = _creator; _tabs = new TabControl(); _tabs.Pages.Add(_existingPage); _tabs.Pages.Add(_newPage); this.Content = _tabs; this.Title = Constants.ChooseSessionTitle; }
public virtual Control Create() { return new TableLayout( new TableLayout(new TableRow(null, AddTab(), RemoveTab(), SelectTab(), null)), tabControl = DefaultTabs() ); }
public ImageViewSection() { var tabs = new TabControl(); tabs.Pages.Add(FixedSize()); tabs.Pages.Add(ScaledSize()); Content = tabs; }
public IconSection() { Content = new TabControl { Pages = { new TabPage { Text="Multi-resolution", Content = CreateViews(TestIcons.Logo) }, new TabPage { Text = ".ico", Content = CreateViews(TestIcons.TestIcon) } } }; }
Control Tabs() { var tabs = new TabControl(); var page = new TabPage { Text = "General" }; tabs.TabPages.Add(page); var layout = new DynamicLayout(page); var desc = string.Format("Show {0} Badge", (Generator.IsMac) ? "Dock" : "TaskBar"); layout.AddRow(new Label { Text = desc }, BadgeSelector()); if (Generator.ID == Generators.Wpf) layout.AddRow(new Panel(), UseMetroTheme()); layout.AddRow(); return tabs; }
public FontDialogSection() { var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.AddSeparateRow(null, PickFont(), PickFontWithStartingFont(), SetToFontFamily(), null); layout.AddSeparateRow(null, new Label { Text = "Set Font Family", VerticalAlignment = VerticalAlignment.Center }, PickFontFamily(), null); layout.AddSeparateRow(null, FontList(), FontStyles(), FontSizes(), null); layout.AddSeparateRow(null, new Label { Text = "Style:" }, BoldFont(), ItalicFont(), UnderlineFont(), StrikeoutFont(), null); var tabs = new TabControl(); tabs.Pages.Add(new TabPage { Text = "Preview", Content = Preview() }); tabs.Pages.Add(new TabPage { Text = "Metrics", Content = Metrics() }); layout.Add(new Panel { MinimumSize = new Size(100, 150), Content = tabs }, yscale: true); UpdatePreview(Fonts.Serif(18, FontStyle.Bold)); Content = layout; }
public FontDialogSection() { var layout = new DynamicLayout(new Size(5, 5)); layout.AddSeparateRow(null, PickFont(), PickFontWithStartingFont(), SetToFontFamily(), null); layout.AddSeparateRow(null, new Label { Text = "Set Font Family", VerticalAlign = VerticalAlign.Middle }, PickFontFamily(), null); layout.AddSeparateRow(null, FontList(), FontStyles(), FontSizes(), null); layout.AddSeparateRow(null, new Label { Text = "Style:" }, BoldFont(), ItalicFont(), UnderlineFont(), StrikeoutFont(), null); var tabs = new TabControl(); tabs.TabPages.Add(new TabPage(Preview()) { Text = "Preview" }); tabs.TabPages.Add(new TabPage(Metrics()) { Text = "Metrics" }); layout.Add(tabs, yscale: true); UpdatePreview(Fonts.Serif(18, FontStyle.Bold)); Content = layout; }
public virtual Control Create() { tabControl = DefaultTabs(); return new StackLayout { Spacing = 5, HorizontalContentAlignment = HorizontalAlignment.Stretch, Items = { new StackLayout { Orientation = Orientation.Horizontal, Items = { null, AddTab(), RemoveTab(), SelectTab(), TabPositionControl(), null } }, new StackLayoutItem(tabControl, expand: true) } }; }
Control GenerateContent() { if (Platform.IsWinForms || Platform.IsGtk) { var tabControl = new TabControlPlus(); tabControl.Pages.Add(new TabPage { Text = "Index", Content = new PanelIndex() }); _tabControl = tabControl; } else { var tabControl = new TabControl(); tabControl.Pages.Add(new TabPage { Text = "Index", Content = new PanelIndex() }); _tabControl = tabControl; } var layout = new DynamicLayout(); layout.Add(_tabControl, yscale: true); layout.Add(StatusBar()); return layout; }
void Init() { // panelSettings _panelBasicSetting = new PanelBasicSetting(); _panelUserAgentSetting = new PanelUserAgentSetting(); _panelHttpHeaderSetting = new PanelHttpHeaderSetting(); _panelPolicySetting = new PanelPolicySetting(); _panelProxySetting = new PanelProxySetting(); var tabControl = new TabControl(); tabControl.Pages.Add(new TabPage {Text = AltStrRes.Basic, Content = _panelBasicSetting}); tabControl.Pages.Add(new TabPage { Text = AltStrRes.UserAgent, Content = _panelUserAgentSetting }); tabControl.Pages.Add(new TabPage { Text = AltStrRes.HttpHeader, Content = _panelHttpHeaderSetting }); tabControl.Pages.Add(new TabPage { Text = AltStrRes.Policy, Content = _panelPolicySetting }); tabControl.Pages.Add(new TabPage { Text = AltStrRes.Proxy, Content = _panelProxySetting }); // buttons _buttonSaveSetting = new Button() {Text = AltStrRes.SaveAndExit}; _buttonSaveSetting.Click += delegate { SaveAllSetting(); Close(); }; _buttonCancel = new Button() {Text = AltStrRes.Cancel}; _buttonCancel.Click += delegate { Close(); }; var layout = new DynamicLayout {Padding = new Padding(5, 5), Spacing = new Size(5, 5)}; layout.Add(tabControl, yscale: true); layout.AddSeparateRow(null, _buttonSaveSetting, _buttonCancel); Content = layout; ClientSize = new Size(400, 400); Icon = Icons.AltmanIcon; Title = AltStrRes.Setting; }
void LogEvents (TabControl control) { control.SelectedIndexChanged += delegate { Log.Write (control, "SelectedIndexChanged, Index: {0}", control.SelectedIndex); }; }
void RenderContent() { var tabPageOverview = new TabPage { Image = Utilities.LoadImage("Overview"), Content = new OverviewView() }; tabPageOverview.SetTextBindingPath(() => " " + Desktop.Properties.Resources.MainWindowOverview); var tabPageSendCoins = new TabPage { Image = Utilities.LoadImage("Send"), Content = new SendCoinsView() }; tabPageSendCoins.SetTextBindingPath(() => " " + Desktop.Properties.Resources.MainWindowSendCoins); var tabPageTransactions = new TabPage { Image = Utilities.LoadImage("Transaction"), Content = new TransactionsView() }; tabPageTransactions.SetTextBindingPath(() => " " + Desktop.Properties.Resources.MainWindowTransactions); var tabPageAddressBook = new TabPage { Image = Utilities.LoadImage("Contact"), Content = new AddressBookView() }; tabPageAddressBook.SetTextBindingPath(() => " " + Desktop.Properties.Resources.TextAddressBook); TabControlMain = new TabControl(); TabControlMain.SelectedIndexChanged += OnTabControlMainSelectedIndexChanged; var tabControlPages = TabControlMain.Pages; tabControlPages.Add(tabPageOverview); tabControlPages.Add(tabPageSendCoins); tabControlPages.Add(tabPageTransactions); tabControlPages.Add(tabPageAddressBook); for (var i = tabControlPages.Count - 1; i >= 0; i--) { tabControlPages[i].Padding = new Padding(Utilities.Padding3); } Content = new TableLayout { Rows = { new TableRow( new Panel { Padding = new Padding(Utilities.Padding4), Content = TabControlMain } ) { ScaleHeight = true }, new TableRow( new Panel { BackgroundColor = Utilities.ColorStatusBar, Padding = new Padding(Utilities.Padding4, Utilities.Padding2), Content = new StatusBarView() } ) } }; }
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 RenderContent() { Padding = new Padding(Utilities.Padding4); TabControlMain = new TabControl(); var tabControlPages = TabControlMain.Pages; tabControlPages.Add(new TabPage { Text = Desktop.Properties.Resources.OptionsGeneral, Content = new GeneralView() }); tabControlPages.Add(new TabPage { Text = Desktop.Properties.Resources.OptionsPaths, Content = new PathsView() }); tabControlPages.Add(new TabPage { Text = Desktop.Properties.Resources.OptionsNetwork, Content = new NetworkView() }); tabControlPages.Add(new TabPage { Text = Desktop.Properties.Resources.OptionsAppearance, Content = new AppearanceView() }); // Make the window automatically sized TabControlMain.SelectedIndex = 2; SizeChanged += OnDialogSizeChanged; for (var i = tabControlPages.Count - 1; i >= 0; i--) { tabControlPages[i].Padding = new Padding(Utilities.Padding3); } var buttonOk = new Button { Text = Desktop.Properties.Resources.TextOk }; buttonOk.Click += delegate { SettingsManager.IsAutoSaveEnabled = false; for (var i = tabControlPages.Count - 1; i >= 0; i--) { var optionsTabPageView = tabControlPages[i].Content as IOptionsTabPageView; Debug.Assert(optionsTabPageView != null, "optionsTabPageView != null"); optionsTabPageView.ApplySettings(); } SettingsManager.IsAutoSaveEnabled = true; SettingsManager.SaveSettings(); Close(); }; DefaultButton = buttonOk; var buttonCancel = new Button { Text = Desktop.Properties.Resources.TextCancel }; AbortButton = buttonCancel; AbortButton.Click += delegate { Close(); }; Content = new TableLayout( new TableRow(new TableCell(TabControlMain)) { ScaleHeight = true }, new TableRow( new TableLayout( new TableRow( new TableCell { ScaleWidth = true }, buttonOk, buttonCancel ) ) { Spacing = Utilities.Spacing3 } ) ) { Spacing = Utilities.Spacing3 }; }
internal TabPageCollection(TabControl control) { this.control = control; }
static Control TestDynamic() { var control = new Button { Text = "Dynamic splitter creation" }; control.Click += (sender, e) => { var tabcontrol = new TabControl(); tabcontrol.Pages.Add(new TabPage { Text = "Index" }); var addTabButton = new Button { Text = "Add Tab With Splitter" }; addTabButton.Click += (ss, ee) => { using (Context) { var newTabpage = new TabPage { Text = "test", Content = new Splitter { Panel1 = new TreeView { Size = new Size(100, 100) }, Panel2 = new GridView(), Orientation = Orientation.Horizontal, FixedPanel = SplitterFixedPanel.Panel1, Position = 100, } }; tabcontrol.Pages.Add(newTabpage); tabcontrol.SelectedPage = newTabpage; } }; var form = new Form { Padding = new Padding(5), Content = new TableLayout( TableLayout.AutoSized(addTabButton, centered: true), tabcontrol ) }; form.Size = new Size(600, 400); form.Show(); }; return control; }
void Init() { //page1 var page1 = new DynamicLayout(); _gridViewInstalled = new GridView(); _gridViewInstalled.ColumnHeaderClick += _gridViewInstalled_ColumnHeaderClick; _gridViewInstalled.Columns.Add(new GridColumn() { DataCell = new CheckBoxCell("Checked"), HeaderText = StrRes.GetString("StrChecked","Checked"), Editable = true }); _gridViewInstalled.Columns.Add(new GridColumn() { ID = "Name", DataCell = new TextBoxCell("Name"), HeaderText = StrRes.GetString("StrName", "Name"), Sortable = true, AutoSize = false, Width = 150 }); _gridViewInstalled.Columns.Add(new GridColumn() { DataCell = new TextBoxCell("Author"), HeaderText = StrRes.GetString("StrAuthor","Author"), AutoSize = false, Width = 100 }); _gridViewInstalled.Columns.Add(new GridColumn() { DataCell = new TextBoxCell("InstalledVersion"), HeaderText = StrRes.GetString("StrInstalledVersion","InstalledVersion"), AutoSize = false, Width = 150 }); _gridViewInstalled.Columns.Add(new GridColumn() { DataCell = new TextBoxCell("FileName"), HeaderText = StrRes.GetString("StrFileName","FileName"), AutoSize = false, Width = 150 }); _gridViewInstalled.SelectionChanged += _gridViewInstalled_SelectionChanged; _textAreatInstalledDes = new TextArea(); _buttonRemove = new Button {Text = StrRes.GetString("StrRemove","Remove")}; _buttonRemove.Click += _buttonRemove_Click; page1.Add(_gridViewInstalled, true, true); page1.Add(_textAreatInstalledDes, true, false); page1.AddSeparateRow(null, _buttonRemove); //page2 var page2 = new DynamicLayout(); _gridViewAvailable = new GridView(); _gridViewAvailable.ColumnHeaderClick += _gridViewAvailable_ColumnHeaderClick; _gridViewAvailable.Columns.Add(new GridColumn() { DataCell = new CheckBoxCell("Checked"), HeaderText = StrRes.GetString("StrChecked","Checked"), Editable = true }); _gridViewAvailable.Columns.Add(new GridColumn() { ID = "Name", DataCell = new TextBoxCell("Name"), HeaderText = StrRes.GetString("StrName","Name"), Sortable = true, AutoSize = false, Width = 150 }); _gridViewAvailable.Columns.Add(new GridColumn() { DataCell = new TextBoxCell("Author"), HeaderText = StrRes.GetString("StrAuthor","Author"), AutoSize = false, Width = 100 }); _gridViewAvailable.Columns.Add(new GridColumn() { DataCell = new TextBoxCell("AvailableVersion"), HeaderText = StrRes.GetString("StrAvailableVersion","AvailableVersion"), AutoSize = false, Width = 150 }); _gridViewAvailable.Columns.Add(new GridColumn() { DataCell = new TextBoxCell("RequiredVersion"), HeaderText = StrRes.GetString("StrRequiredVersion","RequiredVersion"), AutoSize = false, Width = 150 }); _gridViewAvailable.Columns.Add(new GridColumn() { DataCell = new TextBoxCell("CanInstall"), HeaderText = StrRes.GetString("StrCanInstall","CanInstall"), AutoSize = false, Width = 100 }); _gridViewAvailable.SelectionChanged += _gridViewAvailable_SelectionChanged; _textAreatAvailableDes = new TextArea(); _buttonRefresh = new Button {Text = StrRes.GetString("StrRefresh","Refresh")}; _buttonRefresh.Click += _buttonRefresh_Click; _buttonInstall = new Button {Text = StrRes.GetString("StrInstall","Install")}; _buttonInstall.Click += _buttonInstall_Click; page2.Add(_gridViewAvailable, true, true); page2.Add(_textAreatAvailableDes, true, false); page2.AddSeparateRow(null, _buttonRefresh, _buttonInstall); //page3 var page3 = new DynamicLayout(); _gridViewUpdatable = new GridView(); _gridViewUpdatable.ColumnHeaderClick += _gridViewUpdatable_ColumnHeaderClick; _gridViewUpdatable.Columns.Add(new GridColumn() { DataCell = new CheckBoxCell("Checked"), HeaderText = StrRes.GetString("StrChecked","Checked"), Editable = true }); _gridViewUpdatable.Columns.Add(new GridColumn() { ID = "Name", DataCell = new TextBoxCell("Name"), HeaderText = StrRes.GetString("StrName","Name"), Sortable = true, AutoSize = false, Width = 150 }); _gridViewUpdatable.Columns.Add(new GridColumn() { DataCell = new TextBoxCell("Author"), HeaderText = StrRes.GetString("StrAuthor","Author"), AutoSize = false, Width = 100 }); _gridViewUpdatable.Columns.Add(new GridColumn() { DataCell = new TextBoxCell("InstalledVersion"), HeaderText = StrRes.GetString("StrInstalledVersion","InstalledVersion"), AutoSize = false, Width = 150 }); _gridViewUpdatable.Columns.Add(new GridColumn() { DataCell = new TextBoxCell("AvailableVersion"), HeaderText = StrRes.GetString("StrAvailableVersion","AvailableVersion"), AutoSize = false, Width = 150 }); _gridViewUpdatable.Columns.Add(new GridColumn() { DataCell = new TextBoxCell("CanUpdate"), HeaderText = StrRes.GetString("StrCanUpdate","CanUpdate"), AutoSize = false, Width = 100 }); _gridViewUpdatable.SelectionChanged += _gridViewUpdatable_SelectionChanged; _textAreatUpdatesDes = new TextArea(); _buttonUpdate = new Button {Text = StrRes.GetString("StrUpdate","Update")}; _buttonUpdate.Click += _buttonUpdate_Click; page3.Add(_gridViewUpdatable, true, true); page3.Add(_textAreatUpdatesDes, true, false); page3.AddSeparateRow(null, _buttonUpdate); //_tabPageInstalled _tabPageInstalled = new TabPage {Text = StrRes.GetString("StrInstalled","Installed")}; _tabPageInstalled.Content = page1; //_tabPageAvailable _tabPageAvailable = new TabPage {Text = StrRes.GetString("StrAvailable","Available")}; _tabPageAvailable.Content = page2; //_tabPageUpdatable _tabPageUpdatable = new TabPage {Text = StrRes.GetString("StrUpdatable","Updatable")}; _tabPageUpdatable.Content = page3; //_tabControl _tabControl = new TabControl(); _tabControl.Pages.Add(_tabPageInstalled); _tabControl.Pages.Add(_tabPageAvailable); _tabControl.Pages.Add(_tabPageUpdatable); _tabControl.SelectedIndexChanged += _tabControl_SelectedIndexChanged; //_buttonSetting _buttonSetting = new Button {Text = StrRes.GetString("StrSetting","Setting")}; _buttonSetting.Click += _buttonSetting_Click; //_buttonClose _buttonClose = new Button {Text = StrRes.GetString("StrClose","Close")}; _buttonClose.Click += _buttonClose_Click; //_labelMsg _labelMsg = new Label { TextColor = Colors.Red, Text = StrRes.GetString("StrYourOperationWillTakeEffectWhenTheProgramStartNextTime", "Your operation will take effect when the program start next time.") }; _labelMsg.Visible = false; var layout = new DynamicLayout { Padding = new Padding(5, 5), Spacing = new Size(5, 5) }; layout.Add(_tabControl, true, true); layout.AddSeparateRow(_buttonSetting, _labelMsg, null, _buttonClose); Content = layout; Size = new Size(610, 430); Title = "PluginManager"; Icon = Application.Instance.MainForm.Icon; }
/// <summary> /// Raises the selected index changed event. /// </summary> public void OnSelectedIndexChanged(TabControl widget, EventArgs e) { widget.Platform.Invoke(() => widget.OnSelectedIndexChanged(e)); }
Control DefaultTabs () { var control = new TabControl (); LogEvents (control); var page = new TabPage { Text = "Tab 1" }; page.AddDockedControl (TabOne ()); control.TabPages.Add (page); LogEvents (page); page = new TabPage { Text = "Tab 2", Image = Icon.FromResource ("Eto.Test.TestIcon.ico") }; LogEvents (page); page.AddDockedControl (TabTwo ()); control.TabPages.Add (page); page = new TabPage { Text = "Tab 3" }; LogEvents (page); control.TabPages.Add (page); return control; }
public ObjectPanel(ObjectInfo info) { if(info == null) { this.Content = null; return; } TabControl _tabs = new TabControl(); var tabs = ExtensionManager.GetExtensions<IObjectTab>() .OrderBy(tab => tab.Order); foreach(var tab in tabs) { if(tab.Active(info)) { _tabs.Pages.Add(tab.Create(info)); } } if (_tabs.Pages.Count > 0) this.Content = _tabs; else this.Content = null; }