View.Diagnostics.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #nullable enable
  2. namespace Terminal.Gui;
  3. /// <summary>Enables diagnostic functions for <see cref="View"/>.</summary>
  4. [Flags]
  5. public enum ViewDiagnosticFlags : uint
  6. {
  7. /// <summary>All diagnostics off</summary>
  8. Off = 0b_0000_0000,
  9. /// <summary>
  10. /// When enabled, <see cref="Adornment"/> will draw a ruler in the Thickness. See <see cref="Adornment.Diagnostics"/>.
  11. /// </summary>
  12. Ruler = 0b_0000_0001,
  13. /// <summary>
  14. /// When enabled, <see cref="Adornment"/> will draw the first letter of the Adornment name ('M', 'B', or 'P')
  15. /// in the Thickness. See <see cref="Adornment.Diagnostics"/>.
  16. /// </summary>
  17. Thickness = 0b_0000_0010,
  18. /// <summary>
  19. /// When enabled the View's colors will be darker when the mouse is hovering over the View (See <see cref="View.MouseEnter"/> and <see cref="View.MouseLeave"/>.
  20. /// </summary>
  21. Hover = 0b_0000_00100,
  22. /// <summary>
  23. /// When enabled a draw indicator will be shown; the indicator will change each time the View's Draw method is called with NeedsDraw set to true.
  24. /// </summary>
  25. DrawIndicator = 0b_0000_01000,
  26. }
  27. public partial class View
  28. {
  29. /// <summary>Gets or sets whether diagnostic information will be drawn. This is a bit-field of <see cref="ViewDiagnosticFlags"/>.e <see cref="View"/> diagnostics.</summary>
  30. /// <remarks>
  31. /// <para>
  32. /// <see cref="Adornment.Diagnostics"/> gets set to this property by default, enabling <see cref="ViewDiagnosticFlags.Ruler"/> and <see cref="ViewDiagnosticFlags.Thickness"/>.
  33. /// </para>
  34. /// <para>
  35. /// <see cref="ViewDiagnosticFlags.Hover"/> is enabled for all Views independently of Adornments.
  36. /// </para>
  37. /// </remarks>
  38. public static ViewDiagnosticFlags Diagnostics { get; set; }
  39. }