Exemplo n.º 1
0
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);

            Mouse_Holding = new Point(0, 0);
            //MessageBox.Show("Clicked at : " + location.ToString());
            VisualTab_HitTest HitAt = HitTest(e.Location);

            switch (HitAt.Location)
            {
            case VisualTab_HitLocation.Close:
                if (Can_Close)
                {
                    CloseTab(SelectedTab);
                }
                break;

            case VisualTab_HitLocation.Tab:

                _SelectedTab = HitAt.Tab;
                RefreshTab();
                break;

            case VisualTab_HitLocation.Scroll_left:
                int Loc = ScrollLocation;

                Loc -= TabSize.Width + 20;
                if (Loc < 0)
                {
                    Loc = 0;
                }
                ScrollLocation = Loc;
                break;

            case VisualTab_HitLocation.Scroll_right:
                if (ScrollLocation + TabBarBounds.Width + TabSize.Width + 20 > TabBarWorkspaceWidth)
                {
                    ScrollLocation = TabBarWorkspaceWidth - TabBarBounds.Width;
                }
                else
                {
                    ScrollLocation += TabSize.Width + 20;
                }
                break;
            }
            this.Repaint();
        }
Exemplo n.º 2
0
        private VisualTab_HitTest HitTest(Point p)
        {
            VisualTab_HitTest test = new VisualTab_HitTest();

            for (int i = 0; i < this.Tabs.Count; i++)
            {
                Rectangle tab_re = this.GetTabRectangle(i);

                if (tab_re.Contains(p))
                {
                    test.Tab      = i;
                    test.Location = VisualTab_HitLocation.Tab;
                    break;
                }
            }
            if (Tab_Renderer.ArrowLeft.Contains(p))
            {
                test.Location = VisualTab_HitLocation.Scroll_left;
            }
            if (Tab_Renderer.ArrowRight.Contains(p))
            {
                test.Location = VisualTab_HitLocation.Scroll_right;
            }
            if (Draw_Close)
            {
                if (Tab_Renderer.HitsCloseButton(p, TabBarBounds))
                {
                    test.Location = VisualTab_HitLocation.Close;
                }
            }
            if (WillDraw_Dropdown)
            {
            }

            return(test);
        }
Exemplo n.º 3
0
        private VisualTab_HitTest HitTest(Point p)
        {
            VisualTab_HitTest test = new VisualTab_HitTest();

            for (int i = 0; i < this.Tabs.Count; i++)
            {
                Rectangle tab_re = this.GetTabRectangle(i);

                if (tab_re.Contains(p))
                {
                    test.Tab = i;
                    test.Location = VisualTab_HitLocation.Tab;
                    break;
                }
            }
            if (Tab_Renderer.ArrowLeft.Contains(p))
                test.Location = VisualTab_HitLocation.Scroll_left;
            if (Tab_Renderer.ArrowRight.Contains(p))
                test.Location = VisualTab_HitLocation.Scroll_right;
            if (Draw_Close)
            {
                if (Tab_Renderer.HitsCloseButton(p, TabBarBounds))
                    test.Location = VisualTab_HitLocation.Close;
            }
            if (WillDraw_Dropdown)
            {

            }

            return test;
        }