ViewDiagnostics.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. 
  2. using Terminal.Gui.Analyzers.Internal.Attributes;
  3. namespace Terminal.Gui;
  4. /// <summary>Enables diagnostic functions for <see cref="View"/>.</summary>
  5. [Flags]
  6. [GenerateEnumExtensionMethods(FastHasFlags = true)]
  7. public enum ViewDiagnosticFlags : uint
  8. {
  9. /// <summary>All diagnostics off</summary>
  10. Off = 0b_0000_0000,
  11. /// <summary>
  12. /// When enabled, <see cref="View.OnDrawAdornments"/> will draw a ruler in the Thickness.
  13. /// </summary>
  14. Ruler = 0b_0000_0001,
  15. /// <summary>
  16. /// When enabled, <see cref="View.OnDrawAdornments"/> will draw the first letter of the Adornment name ('M', 'B', or 'P')
  17. /// in the Thickness.
  18. /// </summary>
  19. Padding = 0b_0000_0010,
  20. /// <summary>
  21. /// When enabled, <see cref="Adornment.OnMouseEnter(Gui.MouseEvent)"/> and <see cref="Adornment.OnMouseLeave(Gui.MouseEvent)"/>
  22. /// will invert the foreground and background colors.
  23. /// </summary>
  24. MouseEnter = 0b_0000_00100
  25. }
  26. public partial class View
  27. {
  28. /// <summary>Flags to enable/disable <see cref="View"/> diagnostics.</summary>
  29. public static ViewDiagnosticFlags Diagnostics { get; set; }
  30. }