Exemple #1
0
 public virtual void OnTabStripItemClosing(TabStripItemClosingEventArgs e)
 {
     if (TabStripItemClosing != null)
     {
         TabStripItemClosing(e);
     }
 }
Exemple #2
0
 public virtual void OnTabStripItemClosing(TabStripItemClosingEventArgs e)
 {
     if (TabStripItemClosing != null)
     {
         TabStripItemClosing(e);
     }
 }
Exemple #3
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);

            if (e.Button != MouseButtons.Left)
            {
                return;
            }



            if (_MenuGlyph.GlyphRect.Contains(e.Location))
            {
                loadMenuItems();
                if (_ContextDocsList.Visible == false)
                {
                    _ContextDocsList.Show(this, new Point(e.X, _MenuGlyph.GlyphRect.Bottom));
                }
            }

            if (_CloseButton.CrossRect.Contains(e.Location) && this.SelectedItem.CanClose)
            {
                TabStripItemClosingEventArgs evt = new TabStripItemClosingEventArgs(_SelectedItem);

                OnTabStripItemClosing(evt);

                if (!evt.Cancel)
                {
                    this.Controls.Remove(_SelectedItem);

                    this.OnTabStripItemClosing(EventArgs.Empty);
                }
            }

            this.Invalidate();

            TabStripItem selected = null;

            for (int i = 0; i < this.Controls.Count; i++)
            {
                TabStripItem current = (TabStripItem)this.Controls[i];

                if (current.StripRect.Contains(e.Location))
                {
                    current.DrawState |= DrawItemState.Selected;

                    if (current.StripRect.Right > _StripButtonRect.Right)
                    {
                        break;
                    }
                    else
                    {
                        selected = current;
                        break;
                    }
                }
            }

            if (selected == null)
            {
                return;
            }

            this.SelectedItem = selected;

            this.Invalidate();
        }
Exemple #4
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);

            if (e.Button != MouseButtons.Left)
                return;



            if (_MenuGlyph.GlyphRect.Contains(e.Location))
            {
                loadMenuItems();
                if (_ContextDocsList.Visible == false)
                    _ContextDocsList.Show(this, new Point(e.X, _MenuGlyph.GlyphRect.Bottom));
            }

            if (_CloseButton.CrossRect.Contains(e.Location) && this.SelectedItem.CanClose )
            {
                TabStripItemClosingEventArgs evt = new TabStripItemClosingEventArgs(_SelectedItem);

                OnTabStripItemClosing(evt);

                if (!evt.Cancel)
                {
                    this.Controls.Remove(_SelectedItem);

                    this.OnTabStripItemClosing(EventArgs.Empty);
                }
            }

            this.Invalidate();

            TabStripItem selected = null;

            for (int i = 0; i < this.Controls.Count; i++)
            {
                TabStripItem current = (TabStripItem)this.Controls[i];

                if (current.StripRect.Contains(e.Location))
                {
                    current.DrawState |= DrawItemState.Selected;

                    if (current.StripRect.Right > _StripButtonRect.Right)
                    {
                        break;
                    }
                    else
                    {
                        selected = current;
                        break;
                    }
                }
            }

            if (selected == null)
                return;

            this.SelectedItem = selected;

            this.Invalidate();
        }