SelectorStyles.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #nullable enable
  2. namespace Terminal.Gui.Views;
  3. /// <summary>
  4. /// Styles for <see cref="FlagSelector{TFlagsEnum}"/> and <see cref="OptionSelector{TEnum}"/>.
  5. /// </summary>
  6. [Flags]
  7. public enum SelectorStyles
  8. {
  9. /// <summary>
  10. /// No styles.
  11. /// </summary>
  12. None = 0b_0000_0000,
  13. /// <summary>
  14. /// Show the `None` checkbox. This will add a checkbox with the title "None" that when checked will cause the value to
  15. /// be set to 0.
  16. /// The `None` checkbox will be added even if the flags do not contain a value of 0.
  17. /// Valid only for <see cref="FlagSelector"/> and <see cref="FlagSelector{TFlagsEnum}"/>
  18. /// </summary>
  19. ShowNoneFlag = 0b_0000_0001,
  20. // TODO: Implement this.
  21. /// <summary>
  22. /// Show the `All` checkbox. This will add a checkbox with the title "All" that when checked will
  23. /// cause all flags to be set. Unchecking the "All" checkbox will set the value to 0.
  24. /// Valid only for <see cref="FlagSelector"/> and <see cref="FlagSelector{TFlagsEnum}"/>
  25. /// </summary>
  26. ShowAllFlag = 0b_0000_0010,
  27. // TODO: Make the TextField a TextValidateField so it can be editable and validate the value.
  28. /// <summary>
  29. /// Show the value field. This will add a read-only <see cref="TextField"/> to the <see cref="FlagSelector"/> to allow
  30. /// the user to see the value.
  31. /// </summary>
  32. ShowValue = 0b_0000_0100,
  33. /// <summary>
  34. /// All styles.
  35. /// </summary>
  36. All = ShowNoneFlag | ShowAllFlag | ShowValue
  37. }