private void AddTabToUi(ToolboxTab tab) { SuspendLayout(); pnlMain.SuspendLayout(); tab.Dock = DockStyle.Top; tab.ButtonClick += new ToolboxButtonEventHandler(OnButtonClick); tab.ButtonDoubleClick += new ToolboxButtonEventHandler(OnButtonDoubleClick); tab.SelectedButtonChanged += new ToolboxButtonEventHandler(OnSelectedButtonChanged); tab.CollapsedChanged += new EventHandler(OnCollapsedChanged); pnlMain.Controls.Add(tab); if (tab.Collapsed) { tab.OpenTab(); } else { selectedTab = tab; } pnlMain.ResumeLayout(); ResumeLayout(); }
private void OnCollapsedChanged(object sender, EventArgs e) { ToolboxTab tab = sender as ToolboxTab; if ((tab != null) && !tab.Collapsed) { selectedTab = tab; } pnlMain.Focus(); }
public ToolboxTab CreateTab(string id, string text) { if (tabs.ContainsKey(id)) throw new ArgumentException("Tab " + id + " already exists", "id"); ToolboxTab tab = new ToolboxTab(); tab.Name = "tab_" + id; tab.Text = text; tabs.Add(id, tab); AddTabToUi(tab); return tab; }
public void AddTab(string id, ToolboxTab tab) { if (tab == null) { throw new ArgumentNullException("tab"); } if (tabs.ContainsKey(id)) { throw new ArgumentException("Tab " + id + " already exists", "id"); } tab.Name = "tab_" + id; tabs.Add(id, tab); AddTabToUi(tab); }
public ToolboxTab CreateTab(string id, string text) { if (tabs.ContainsKey(id)) { throw new ArgumentException("Tab " + id + " already exists", "id"); } ToolboxTab tab = new ToolboxTab(); tab.Name = "tab_" + id; tab.Text = text; tabs.Add(id, tab); AddTabToUi(tab); return(tab); }
public void AddTab(string id, ToolboxTab tab) { if (tab == null) throw new ArgumentNullException("tab"); if (tabs.ContainsKey(id)) throw new ArgumentException("Tab " + id + " already exists", "id"); tab.Name = "tab_" + id; tabs.Add(id, tab); AddTabToUi(tab); }
private void OnCollapsedChanged(object sender, EventArgs e) { ToolboxTab tab = sender as ToolboxTab; if ((tab != null) && !tab.Collapsed) selectedTab = tab; pnlMain.Focus(); }
private void AddTabToUi(ToolboxTab tab) { SuspendLayout(); pnlMain.SuspendLayout(); tab.Dock = DockStyle.Top; tab.ButtonClick += new ToolboxButtonEventHandler(OnButtonClick); tab.ButtonDoubleClick += new ToolboxButtonEventHandler(OnButtonDoubleClick); tab.SelectedButtonChanged += new ToolboxButtonEventHandler(OnSelectedButtonChanged); tab.CollapsedChanged += new EventHandler(OnCollapsedChanged); pnlMain.Controls.Add(tab); if (tab.Collapsed) tab.OpenTab(); else selectedTab = tab; pnlMain.ResumeLayout(); ResumeLayout(); }