TabMouseEventArgs.cs 1.1 KB

123456789101112131415161718192021222324
  1. namespace Terminal.Gui;
  2. /// <summary>Describes a mouse event over a specific <see cref="Tab"/> in a <see cref="TabView"/>.</summary>
  3. public class TabMouseEventArgs : EventArgs
  4. {
  5. /// <summary>Creates a new instance of the <see cref="TabMouseEventArgs"/> class.</summary>
  6. /// <param name="tab"><see cref="Tab"/> that the mouse was over when the event occurred.</param>
  7. /// <param name="mouseEvent">The mouse activity being reported</param>
  8. public TabMouseEventArgs (Tab tab, MouseEvent mouseEvent)
  9. {
  10. Tab = tab;
  11. MouseEvent = mouseEvent;
  12. }
  13. /// <summary>
  14. /// Gets the actual mouse event. Use <see cref="MouseEvent.Handled"/> to cancel this event and perform custom
  15. /// behavior (e.g. show a context menu).
  16. /// </summary>
  17. public MouseEvent MouseEvent { get; }
  18. /// <summary>Gets the <see cref="Tab"/> (if any) that the mouse was over when the <see cref="MouseEvent"/> occurred.</summary>
  19. /// <remarks>This will be null if the click is after last tab or before first.</remarks>
  20. public Tab Tab { get; }
  21. }