Exemplo n.º 1
0
        protected virtual void OnTabMouseDown(TabMouseEventArgs e)
        {
            if (TabMouseDown != null)
            {
                TabMouseDown(this, e);
            }

            if (IncludesCloseButton(e.TabPage))
            {
                Rectangle closerect = GetTabCloseRect(e.TabPage, e.TabBounds);
                if (closerect.Contains(e.Location))
                {
                    clickClose = e.TabPage;
                    Invalidate(closerect);
                    Update();
                    return;
                }
            }
            if (e.Button == MouseButtons.Left)
            {
                if (!e.TabPage.Disabled)
                {
                    SelectedTab = e.TabPage;
                }
            }

            Rectangle bounds = GetTabContentRect(e.TabPage, e.TabBounds);

            e.TabPage.CallTabMouseDown(new TabMouseEventArgs(e.Button, e.Clicks, e.X, e.Y, e.Delta, e.TabPage, Bounds));
        }
Exemplo n.º 2
0
        protected virtual void OnTabMouseUp(TabMouseEventArgs e)
        {
            if (TabMouseUp != null)
            {
                TabMouseUp(this, e);
            }

            if (e.TabPage == clickClose)
            {
                Rectangle closerect = GetTabCloseRect(e.TabPage, e.TabBounds);
                if (closerect.Contains(e.Location))
                {
                    TabClosingEventArgs tcea = new TabClosingEventArgs(e.TabPage);
                    OnTabClosing(tcea);
                    if (!tcea.Cancel)
                    {
                        OnTabClosed(tcea);
                    }
                    return;
                }
            }

            Rectangle bounds = GetTabContentRect(e.TabPage, e.TabBounds);

            e.TabPage.CallTabMouseUp(new TabMouseEventArgs(e.Button, e.Clicks, e.X, e.Y, e.Delta, e.TabPage, Bounds));
        }
Exemplo n.º 3
0
 protected virtual void OnTabMouseDoubleClick(TabMouseEventArgs e)
 {
     if (TabMouseDoubleClick != null)
     {
         TabMouseDoubleClick(this, e);
     }
 }
Exemplo n.º 4
0
 protected virtual void OnTabMouseUp(TabMouseEventArgs e)
 {
     if (TabMouseUp != null)
     {
         TabMouseUp(this, e);
     }
 }
Exemplo n.º 5
0
 protected virtual void OnTabMouseDown(TabMouseEventArgs e)
 {
     if (TabMouseDown != null)
     {
         TabMouseDown(this, e);
     }
 }
Exemplo n.º 6
0
 protected virtual void OnTabMouseMove(TabMouseEventArgs e)
 {
     if (TabMouseMove != null)
     {
         TabMouseMove(this, e);
     }
 }
Exemplo n.º 7
0
        protected virtual void OnTabMouseDoubleClick(TabMouseEventArgs e)
        {
            if (TabMouseDoubleClick != null)
            {
                TabMouseDoubleClick(this, e);
            }

            Rectangle bounds = GetTabContentRect(e.TabPage, e.TabBounds);

            e.TabPage.CallTabMouseDoubleClick(new TabMouseEventArgs(e.Button, e.Clicks, e.X, e.Y, e.Delta, e.TabPage, Bounds));
        }
Exemplo n.º 8
0
        protected virtual void OnTabMouseMove(TabMouseEventArgs e)
        {
            if (TabMouseMove != null)
            {
                TabMouseMove(this, e);
            }

            Rectangle closerect = GetTabCloseRect(e.TabPage, e.TabBounds);

            if (e.TabPage != hoverTab)
            {
                if (hoverTab != null)
                {
                    this.OnTabMouseLeave(new TabEventArgs(hoverTab));
                }
                this.OnTabMouseEnter(new TabEventArgs(e.TabPage));
                if (closerect.Contains(e.Location))
                {
                    hoverClose = true;
                }
            }
            else if (closerect.Contains(e.Location))
            {
                if (!hoverClose)
                {
                    hoverClose = true;
                    Invalidate(closerect);
                    Update();
                }
            }
            else if (hoverClose)
            {
                hoverClose = false;
                Invalidate(closerect);
                Update();
            }

            Rectangle bounds = GetTabContentRect(e.TabPage, e.TabBounds);

            e.TabPage.CallTabMouseMove(new TabMouseEventArgs(e.Button, e.Clicks, e.X, e.Y, e.Delta, e.TabPage, Bounds));
        }
Exemplo n.º 9
0
 internal void CallTabMouseDoubleClick(TabMouseEventArgs e)
 {
     OnTabMouseDoubleClick(e);
 }
Exemplo n.º 10
0
 internal void CallTabMouseUp(TabMouseEventArgs e)
 {
     OnTabMouseUp(e);
 }
Exemplo n.º 11
0
 internal void CallTabMouseDown(TabMouseEventArgs e)
 {
     OnTabMouseDown(e);
 }
Exemplo n.º 12
0
 internal void CallTabMouseMove(TabMouseEventArgs e)
 {
     OnTabMouseMove(e);
 }