/// <summary> /// Creates the tab page /// </summary> /// <param name="objectInfo">The object info to create the tab for</param> /// <returns>The tab page instance</returns> public TabPage Create(ObjectInfo objectInfo) { var page = new TabPage(); page.Text = Constants.InfoTabText; page.Content = new Panel(objectInfo); return page; }
/// <summary> /// Creates the tab page /// </summary> /// <param name="deviceInfo">The device info to create the tab for</param> /// <returns>The tab page instance</returns> public TabPage Create(ObjectInfo deviceInfo) { var page = new TabPage(); page.Text = Constants.AlarmsTabText; page.Content = new Panel(deviceInfo); return page; }
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; }
protected internal void AddTab (TabPage page) { if (Loaded) { page.OnPreLoad (EventArgs.Empty); page.OnLoad (EventArgs.Empty); page.OnLoadComplete (EventArgs.Empty); } page.SetParent (this); inner.AddTab (page); }
internal void InsertTab (int index, TabPage page) { if (Loaded) { page.OnPreLoad (EventArgs.Empty); page.OnLoad (EventArgs.Empty); page.OnLoadComplete (EventArgs.Empty); } page.SetParent (this); handler.InsertTab (index, page); }
TabPage ScaledSize() { var layout = new DynamicLayout(); AddHeaders(layout); layout.AddRow(new Label { Text = "Scaled Size" }, Scaled(GetBitmap()), Scaled(GetIcon())); var page = new TabPage { Text = "Scaled Size" }; page.Content = new Scrollable { Border = BorderType.None, Content = layout }; return page; }
Control AddTab() { var control = new Button { Text = "Add Tab" }; control.Click += (s, e) => { var tab = new TabPage { Text = "Tab " + (tabControl.Pages.Count + 1), Content = tabControl.Pages.Count % 2 == 0 ? TabOne() : TabTwo() }; tabControl.Pages.Add(tab); }; return control; }
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 void InsertTab(int index, EF.TabPage page) { var pageHandler = (EWFC.TabPageHandler)page.Handler; controlPlus = (EF.TabControlPlus)page.Parent; if (index == -1 || index == Control.TabPages.Count) { Control.TabPages.Add(pageHandler.Control); } else { Control.TabPages.Insert(index, pageHandler.Control); } if (Widget.Loaded && Control.TabPages.Count == 1) { Callback.OnSelectedIndexChanged(Widget, EventArgs.Empty); } }
TabPage FixedSize() { var layout = new DynamicLayout(); AddHeaders(layout); layout.AddRow(new Label { Text = "Auto Sized" }, AutoSized(GetBitmap()), AutoSized(GetIcon())); layout.AddRow(new Label { Text = "Small Size" }, SmallSize(GetBitmap()), SmallSize(GetIcon())); layout.AddRow(new Label { Text = "Large Size" }, LargeSize(GetBitmap()), LargeSize(GetIcon())); var page = new TabPage { Text = "Fixed Size" }; page.Content = new Scrollable { Border = BorderType.None, ExpandContentWidth = false, ExpandContentHeight = false, Content = layout }; return page; }
public void RemoveTab(int index, EF.TabPage page) { disableSelectedIndexChanged = true; try { var tab = Control.TabPages[index]; var isSelected = Control.SelectedIndex == index; Control.TabPages.Remove(tab); if (isSelected) { Control.SelectedIndex = Math.Min(index, Control.TabPages.Count - 1); } if (Widget.Loaded) { Callback.OnSelectedIndexChanged(Widget, EventArgs.Empty); } } finally { disableSelectedIndexChanged = false; } }
private TabPage CreateFromFileTab() { var fileTab = new TabPage { Text = FromFileTabName }; var fileLayout = new DynamicLayout(fileTab); var browseLabel = new Label { Text = "Select Clippings File: ", Size = new Size(150, 20) }; _fileSelectTextBox = new TextBox { Size = new Size(480, 20) }; var browseButton = new Button { Text = "Browse" }; browseButton.Click += browseButton_Click; fileLayout.BeginVertical(); fileLayout.BeginHorizontal(); fileLayout.AddRow(browseLabel, _fileSelectTextBox, browseButton); fileLayout.EndHorizontal(); fileLayout.EndVertical(); return fileTab; }
void LogEvents (TabPage control) { control.Click += delegate { Log.Write (control, "Click, Item: {0}", control.Text); }; }
protected internal void RemoveTab(TabPage page) { page.SetParent (null); inner.RemoveTab (page); }
public void CreateTabPage(string name, object userControl) { //create new tabpage var newTabpage = new TabPage { ID = name, Text = name, Content = userControl as Panel }; if (Platform.IsWinForms || Platform.IsGtk) { var tab = _tabControl as TabControlPlus; if (tab != null) { tab.Pages.Add(newTabpage); tab.SelectedPage = newTabpage; } } else { var tab = _tabControl as TabControl; if (tab != null) { tab.Pages.Add(newTabpage); tab.SelectedPage = newTabpage; } } }
internal void RemoveTab (int index, TabPage page) { page.SetParent (null); handler.RemoveTab (index, page); }
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; }
private void Remove(TabPage page) { if (page != null) { var index = pages.IndexOf(page); if (index >= 0) RemoveTab(index, page); } }
public TabRemovingEventArgs(TabPage page) { this.Page = page; }
internal void InsertTab(int index, TabPage page) { var load = SetParent(page); Handler.InsertTab(index, page); if (load) page.OnLoadComplete(EventArgs.Empty); }
internal void RemoveTab(int index, TabPage page) { Handler.RemoveTab(index, page); RemoveParent(page, true); }
private TabPage CreateFromDeviceTab() { var deviceTab = new TabPage { Text = FromDeviceTabName }; var deviceLayout = new DynamicLayout(deviceTab); var selectDeviceLabel = new Label { Text = "Select Device: ", Size = new Size(150, 20) }; _deviceSelectBox = new ComboBox { Size = new Size(480, 20) }; var refreshButton = new Button { Text = "Refresh" }; refreshButton.Click += refreshButton_Click; deviceLayout.BeginVertical(); deviceLayout.BeginHorizontal(); deviceLayout.AddRow(selectDeviceLabel, _deviceSelectBox, refreshButton); deviceLayout.EndHorizontal(); deviceLayout.EndVertical(); return deviceTab; }
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; }
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() } ) } }; }
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; }