TabMouseEventArgs.cs 1.1 KB

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