Alignment.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. /// <remarks>
  12. /// <para>
  13. /// If the container is smaller than the total size of the items, the end items will be clipped (their
  14. /// 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. /// </summary>
  27. Start = 0,
  28. /// <summary>
  29. /// The items will be aligned to the end (right or bottom) of the container.
  30. /// <remarks>
  31. /// <para>
  32. /// If the container is smaller than the total size of the items, the start items will be clipped (their
  33. /// locations
  34. /// will be negative).
  35. /// </para>
  36. /// <para>
  37. /// The <see cref="AlignmentModes"/> enumeration provides additional options for aligning items in a container.
  38. /// </para>
  39. /// </remarks>
  40. /// <example>
  41. /// <c>
  42. /// | 111 2222 33333|
  43. /// </c>
  44. /// </example>
  45. /// </summary>
  46. End,
  47. /// <summary>
  48. /// Center in the available space.
  49. /// <remarks>
  50. /// <para>
  51. /// If centering is not possible, the group will be left-aligned.
  52. /// </para>
  53. /// <para>
  54. /// Extra space will be distributed between the items, biased towards the left.
  55. /// </para>
  56. /// </remarks>
  57. /// <example>
  58. /// <c>
  59. /// | 111 2222 33333 |
  60. /// </c>
  61. /// </example>
  62. /// </summary>
  63. Center,
  64. /// <summary>
  65. /// The items will fill the available space.
  66. /// <remarks>
  67. /// <para>
  68. /// Extra space will be distributed between the items, biased towards the end.
  69. /// </para>
  70. /// </remarks>
  71. /// <example>
  72. /// <c>
  73. /// |111 2222 33333|
  74. /// </c>
  75. /// </example>
  76. /// </summary>
  77. Fill
  78. }