ViewArrangement.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. namespace Terminal.Gui;
  2. /// <summary>
  3. /// Describes what user actions are enabled for arranging a <see cref="View"/> within it's <see cref="View.SuperView"/>.
  4. /// See <see cref="View.Arrangement"/>.
  5. /// </summary>
  6. /// <remarks>
  7. /// <para>
  8. /// Sizing or moving a view is only possible if the <see cref="View"/> is part of a <see cref="View.SuperView"/> and
  9. /// the relevant position and dimensions of the <see cref="View"/> are independent of other SubViews
  10. /// </para>
  11. /// </remarks>
  12. [Flags]
  13. public enum ViewArrangement
  14. {
  15. /// <summary>
  16. /// The view can neither be moved nor resized.
  17. /// </summary>
  18. Fixed = 0,
  19. /// <summary>
  20. /// The view can be moved.
  21. /// </summary>
  22. Movable = 1,
  23. /// <summary>
  24. /// The left edge of the view can be resized.
  25. /// </summary>
  26. LeftResizable = 2,
  27. /// <summary>
  28. /// The right edge of the view can be resized.
  29. /// </summary>
  30. RightResizable = 4,
  31. /// <summary>
  32. /// The top edge of the view can be resized.
  33. /// </summary>
  34. /// <remarks>
  35. /// This flag is mutually exclusive with <see cref="Movable"/>. If both are set, <see cref="Movable"/> takes
  36. /// precedence.
  37. /// </remarks>
  38. TopResizable = 8,
  39. /// <summary>
  40. /// The bottom edge of the view can be resized.
  41. /// </summary>
  42. BottomResizable = 16,
  43. /// <summary>
  44. /// The view can be resized in any direction.
  45. /// </summary>
  46. /// <remarks>
  47. /// If <see cref="Movable"/> is also set, the top will not be resizable.
  48. /// </remarks>
  49. Resizable = LeftResizable | RightResizable | TopResizable | BottomResizable
  50. }
  51. public partial class View
  52. {
  53. /// <summary>
  54. /// Gets or sets the user actions that are enabled for the view within it's <see cref="SuperView"/>.
  55. /// </summary>
  56. /// <remarks>
  57. /// <para>
  58. /// Sizing or moving a view is only possible if the <see cref="View"/> is part of a <see cref="SuperView"/> and
  59. /// the relevant position and dimensions of the <see cref="View"/> are independent of other SubViews
  60. /// </para>
  61. /// </remarks>
  62. public ViewArrangement Arrangement { get; set; }
  63. }