SelectorStyles.cs 1.5 KB

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