IMouseHeldDown.cs 1.2 KB

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