Ejemplo n.º 1
0
        /// ------------------------------------------------------------------------------------
        /// <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);
        }
Ejemplo n.º 2
0
        ///// ------------------------------------------------------------------------------------
        //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);
        }
Ejemplo n.º 3
0
        /// ------------------------------------------------------------------------------------
        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();
        }
Ejemplo n.º 4
0
        /// ------------------------------------------------------------------------------------
        /// <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);
        }
Ejemplo n.º 5
0
 /// ------------------------------------------------------------------------------------
 internal void ViewWasDocked(ViewTab tab)
 {
     AdjustTabContainerWidth(false);
 }