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();
        }
示例#3
0
        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);
        }
示例#6
0
 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);
 }
示例#7
0
 private void OnCollapsedChanged(object sender, EventArgs e)
 {
     ToolboxTab tab = sender as ToolboxTab;
     if ((tab != null) && !tab.Collapsed) selectedTab = tab;
     pnlMain.Focus();
 }
示例#8
0
        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();
        }