/// ------------------------------------------------------------------------------------ /// <summary> /// Returns the first visible tab to the right of the specified tab. /// </summary> /// ------------------------------------------------------------------------------------ public ViewTab FindFirstVisibleTabToRight(ViewTab tab) { int i = m_pnlTabs.Controls.IndexOf(tab); if (i == -1) { return(null); } // Tabs are in the control collection in reverse order from how they appear // (i.e. Control[0] is the furthest right tab. while (--i >= 0 && !m_pnlTabs.Controls[i].Visible) { } return(i < 0 ? null : m_pnlTabs.Controls[i] as ViewTab); }
///// ------------------------------------------------------------------------------------ //public ViewTab AddTab(string text, Image img, Type viewType, string helptopicid, // Func<string> getHelpToolTipAction) /// ------------------------------------------------------------------------------------ public void AddTab(ViewTab tab) { if (m_pnlTabs.Left > 0) { m_pnlTabs.Left = 0; } //var tab = new ViewTab(this, img, viewType); //tab.Text = Utils.RemoveAcceleratorPrefix(text); //tab.GetHelpToolTipAction = getHelpToolTipAction; //tab.HelpTopicId = helptopicid; //tab.Dock = DockStyle.Left; tab.Click += tab_Click; SetTabsWidth(tab); m_pnlTabs.Controls.Add(tab); tab.BringToFront(); Tabs.Add(tab); AdjustTabContainerWidth(true); }
/// ------------------------------------------------------------------------------------ public void SelectTab(ViewTab newSelectedTab) { newSelectedTab.Selected = true; m_currTab = newSelectedTab; FindInfo.Grid = null; if (!m_currTab.IsViewDocked) { return; } SuspendLayout(); foreach (var tab in Tabs.Where(t => t != newSelectedTab && t.Selected)) { tab.Selected = false; } EnsureTabVisible(newSelectedTab); ResumeLayout(); RefreshCaption(); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Gets a value indicating whether or not the first visible tab to the right of the /// specified tab is selected. /// </summary> /// ------------------------------------------------------------------------------------ public bool IsRightAdjacentTabSelected(ViewTab tab) { var adjacentTab = FindFirstVisibleTabToRight(tab); return(adjacentTab != null && adjacentTab.Selected); }
/// ------------------------------------------------------------------------------------ internal void ViewWasDocked(ViewTab tab) { AdjustTabContainerWidth(false); }