コード例 #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// This method will determine where to place the indicator and how wide it should be.
        /// In making that determination, consideration is made for what is being dragged and
        /// whether or not the active tab in the target tab group is empty. When tabs are
        /// being dragged, then the indicator will always show up at the end of all existing
        /// tabs in the target tab group. If a pattern is being dragged and the active tab
        /// in the target tab group is empty, the indicator will be placed over that tab.
        /// Otherwise, the indicator will be shown at the end of all existing tabs in the
        /// target tab group.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private Point GetIndicatorLocation(bool draggingTab)
        {
            Point pt;

            if (m_tabGroup.Tabs == null || m_tabGroup.Tabs.Count == 0)
            {
                pt = m_tabGroup.TabsContainer.PointToScreen(m_tabGroup.TabsContainer.Location);
            }
            else
            {
                SearchResultTab tab = (!draggingTab && m_tabGroup.CurrentTab.IsEmpty ?
                                       m_tabGroup.CurrentTab : m_tabGroup.Tabs[m_tabGroup.Tabs.Count - 1]);

                if (!draggingTab && tab.IsEmpty && tab.Selected)
                {
                    pt   = tab.PointToScreen(new Point(0, 0));
                    Size = new Size(tab.Width, m_height);
                }
                else
                {
                    pt   = tab.PointToScreen(new Point(tab.Width, 0));
                    Size = new Size(kDefaultIndicatorWidth, m_height);
                }
            }

            return(m_tabGroup.PointToClient(pt));
        }
コード例 #2
0
        /// ------------------------------------------------------------------------------------
        public bool GetIsTabsRightEdgeVisible(SearchResultTab tab)
        {
            var pt = tab.PointToScreen(new Point(tab.Width, 0));

            pt = TabsContainer.PointToClient(pt);
            return(pt.X <= m_buttonPanel.Left);
        }