/// <summary> /// Notifies the <see cref="Toolbox"/> object that the state of the <see cref="Tab"/> is changed and invalidation is required. /// </summary> protected internal void NotifyInvalidate() { Toolbox toolbox = this.Toolbox; if (toolbox != null && this.Opened && this.Visible) { toolbox.Invalidate(this.VisibleRectangle); } }
/// <summary> /// Invoked when the mouse button is depressed on the <see cref="Tab"/>. /// </summary> /// <remarks> /// If the mouse button is <see cref="MouseButtons.Left"/> and the mouse location is withing <see cref="Tab"/> caption, the <see cref="Tab"/> state is toggled. /// <para/>If the mouse button is <see cref="MouseButtons.Right"/> the <see cref="IP.Components.Toolbox.TabMenu"/> is shown if available. /// </remarks> protected virtual void OnMouseUp(MouseEventArgs e) { Toolbox toolbox = this.Toolbox; if (e.Button == MouseButtons.Left) { if (this.GetCaptionRectangle(true).Contains(e.Location)) { this.Opened = !this.Opened; toolbox.Invalidate(); } } else if (e.Button == MouseButtons.Right) { if (toolbox.TabMenu != null) { toolbox.TabMenu.Tag = this; toolbox.TabMenu.Show(toolbox, e.Location); } } }