IMouseHeldDown.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #nullable enable
  2. using System.ComponentModel;
  3. namespace Terminal.Gui.ViewBase;
  4. /// <summary>
  5. /// <para>
  6. /// Handler for raising periodic events while the mouse is held down.
  7. /// Typically, mouse button only needs to be pressed down in a view
  8. /// to begin this event after which it can be moved elsewhere.
  9. /// </para>
  10. /// <para>
  11. /// Common use cases for this includes holding a button down to increase
  12. /// a counter (e.g. in <see cref="NumericUpDown"/>).
  13. /// </para>
  14. /// </summary>
  15. public interface IMouseHeldDown : IDisposable
  16. {
  17. /// <summary>
  18. /// Periodically raised when the mouse is pressed down inside the view <see cref="View"/>.
  19. /// </summary>
  20. public event EventHandler<CancelEventArgs> MouseIsHeldDownTick;
  21. /// <summary>
  22. /// Call to indicate that the mouse has been pressed down and any relevant actions should
  23. /// be undertaken (start timers, <see cref="IMouseGrabHandler.GrabMouse"/> etc).
  24. /// </summary>
  25. void Start ();
  26. /// <summary>
  27. /// Call to indicate that the mouse has been released and any relevant actions should
  28. /// be undertaken (stop timers, <see cref="IMouseGrabHandler.UngrabMouse"/> etc).
  29. /// </summary>
  30. void Stop ();
  31. }