MouseState.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Text.Json.Serialization;
  2. namespace Terminal.Gui.ViewBase;
  3. /// <summary>
  4. /// Used to describe the state of the mouse in relation to a <see cref="View"/> (<see cref="View.MouseState"/>) and to
  5. /// specify visual effects,
  6. /// such as highlighting a button when the mouse is over it or changing the appearance of a view when the mouse is
  7. /// pressed (<see cref="View.HighlightStates"/>).
  8. /// </summary>
  9. /// <seealso cref="View.MouseState"/>
  10. /// <seealso cref="View.HighlightStates"/>
  11. [JsonConverter (typeof (JsonStringEnumConverter<MouseState>))]
  12. [Flags]
  13. public enum MouseState
  14. {
  15. /// <summary>
  16. /// No mouse interaction with the view is occurring.
  17. /// </summary>
  18. None = 0,
  19. /// <summary>
  20. /// The mouse is in the <see cref="View.Viewport"/> (but not pressed). Set between the <see cref="View.MouseEnter"/>
  21. /// and <see cref="View.MouseLeave"/> events.
  22. /// </summary>
  23. In = 1,
  24. /// <summary>
  25. /// The mouse is in the <see cref="View.Viewport"/> and is pressed.
  26. /// </summary>
  27. Pressed = 2,
  28. /// <summary>
  29. /// The mouse is outside the <see cref="View.Viewport"/> and is pressed. If
  30. /// <see cref="View.WantContinuousButtonPressed"/> is true,
  31. /// this flag is ignored so that the view remains in the pressed state until the mouse is released.
  32. /// </summary>
  33. PressedOutside = 4
  34. }