TabMouseEventArgs.cs 1.1 KB

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