public void AddTab(SleekTab tab) { ToolStripButton button = (ToolStripButton)tstTabs.Items.Add(tab.Label); button.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText; button.Image = null; button.AutoToolTip = false; button.Tag = tab.Name; button.Click += new EventHandler(TabButtonClick); tab.Button = button; tabs.Add(tab.Name, tab); }
public frmDetachedTab(SleekInstance instance, SleekTab tab) { InitializeComponent(); this.instance = instance; this.tab = tab; this.Controls.Add(tab.Control); tab.Control.BringToFront(); AddTabEvents(); this.Text = tab.Label + " (tab) - SLeek"; ApplyConfig(this.instance.Config.CurrentConfig); this.instance.Config.ConfigApplied += new EventHandler<ConfigAppliedEventArgs>(Config_ConfigApplied); }
public SleekTab Split() { if (!allowMerge) return null; if (!merged) return null; SleekTab returnTab = mergedTab; mergedTab = null; returnTab.mergedTab = null; SplitContainer container = (SplitContainer)control; control = container.Panel1.Controls[0]; returnTab.Control = container.Panel2.Controls[0]; merged = returnTab.merged = false; this.Label = originalLabel; OnTabSplit(EventArgs.Empty); return returnTab; }
public void MergeWith(SleekTab tab) { if (!allowMerge) return; if (merged) return; SplitContainer container = new SplitContainer(); container.Dock = DockStyle.Fill; container.BorderStyle = BorderStyle.Fixed3D; container.SplitterDistance = container.Width / 2; container.Panel1.Controls.Add(control); container.Panel2.Controls.Add(tab.Control); control.Visible = true; tab.Control.Visible = true; control = container; tab.Control = container; mergedTab = tab; tab.mergedTab = this; originalLabel = label; tab.originalLabel = tab.label; this.Label = label + "+" + tab.Label; merged = tab.merged = true; OnTabMerged(EventArgs.Empty); }
public void RegisterTab(SleekTab tab) { tab.DefaultControlButton = btnLogin; }
public SleekTab AddTab(string name, string label, Control control) { ToolStripButton button = (ToolStripButton)tstTabs.Items.Add(label); button.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText; button.Image = null; button.AutoToolTip = false; button.Tag = name.ToLower(); button.Click += new EventHandler(TabButtonClick); SleekTab tab = new SleekTab(button, control, name.ToLower(), label); tab.TabAttached += new EventHandler(tab_TabAttached); tab.TabDetached += new EventHandler(tab_TabDetached); tab.TabSelected += new EventHandler(tab_TabSelected); tab.TabClosed += new EventHandler(tab_TabClosed); tabs.Add(name.ToLower(), tab); return tab; }
private void tab_TabSelected(object sender, EventArgs e) { SleekTab tab = (SleekTab)sender; if (selectedTab != null && selectedTab != tab) { selectedTab.Deselect(); } selectedTab = tab; tbtnCloseTab.Enabled = tab.AllowClose; owner.AcceptButton = tab.DefaultControlButton; }
public void SplitTab(SleekTab tab) { SleekTab otherTab = tab.Split(); if (otherTab == null) return; toolStripContainer1.ContentPanel.Controls.Add(tab.Control); toolStripContainer1.ContentPanel.Controls.Add(otherTab.Control); tabs.Remove(otherTab.Name); AddTab(otherTab); }
public void RemoveTabEntry(SleekTab tab) { tab.Button.Dispose(); tabs.Remove(tab.Name); }