Alignment.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. using System.Text.Json.Serialization;
  2. namespace Terminal.Gui;
  3. /// <summary>
  4. /// Determines the position of items when arranged in a container.
  5. /// </summary>
  6. [JsonConverter (typeof (JsonStringEnumConverter<Alignment>))]
  7. public enum Alignment
  8. {
  9. /// <summary>
  10. /// The items will be aligned to the start (left or top) of the container.
  11. /// </summary>
  12. /// <remarks>
  13. /// <para>
  14. /// If the container is smaller than the total size of the items, the end items will be clipped (their locations
  15. /// will be greater than the container size).
  16. /// </para>
  17. /// <para>
  18. /// The <see cref="AlignmentModes"/> enumeration provides additional options for aligning items in a container.
  19. /// </para>
  20. /// </remarks>
  21. /// <example>
  22. /// <c>
  23. /// |111 2222 33333 |
  24. /// </c>
  25. /// </example>
  26. Start = 0,
  27. /// <summary>
  28. /// The items will be aligned to the end (right or bottom) of the container.
  29. /// </summary>
  30. /// <remarks>
  31. /// <para>
  32. /// If the container is smaller than the total size of the items, the start items will be clipped (their locations
  33. /// will be negative).
  34. /// </para>
  35. /// <para>
  36. /// The <see cref="AlignmentModes"/> enumeration provides additional options for aligning items in a container.
  37. /// </para>
  38. /// </remarks>
  39. /// <example>
  40. /// <c>
  41. /// | 111 2222 33333|
  42. /// </c>
  43. /// </example>
  44. End,
  45. /// <summary>
  46. /// Center in the available space.
  47. /// </summary>
  48. /// <remarks>
  49. /// <para>
  50. /// If centering is not possible, the group will be left-aligned.
  51. /// </para>
  52. /// <para>
  53. /// Extra space will be distributed between the items, biased towards the left.
  54. /// </para>
  55. /// </remarks>
  56. /// <example>
  57. /// <c>
  58. /// | 111 2222 33333 |
  59. /// </c>
  60. /// </example>
  61. Center,
  62. /// <summary>
  63. /// The items will fill the available space.
  64. /// </summary>
  65. /// <remarks>
  66. /// <para>
  67. /// Extra space will be distributed between the items, biased towards the end.
  68. /// </para>
  69. /// </remarks>
  70. /// <example>
  71. /// <c>
  72. /// |111 2222 33333|
  73. /// </c>
  74. /// </example>
  75. Fill,
  76. }