TabMouseEventArgs.cs 1.1 KB

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