Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 public void RegisterTab(SleekTab tab)
 {
     tab.DefaultControlButton = btnLogin;
 }
Esempio n. 6
0
        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;
        }
Esempio n. 7
0
        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;
        }
Esempio n. 8
0
        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);
        }
Esempio n. 9
0
 public void RemoveTabEntry(SleekTab tab)
 {
     tab.Button.Dispose();
     tabs.Remove(tab.Name);
 }