View.Arrangement.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. namespace Terminal.Gui.ViewBase;
  2. public partial class View
  3. {
  4. /// <summary>
  5. /// Gets or sets the user actions that are enabled for the arranging this view within it's <see cref="SuperView"/>.
  6. /// </summary>
  7. /// <remarks>
  8. /// <para>
  9. /// See the View Arrangement Deep Dive for more information: <see href="https://gui-cs.github.io/Terminal.Gui/docs/arrangement.html"/>
  10. /// </para>
  11. /// </remarks>
  12. /// <example>
  13. /// <para>
  14. /// This example demonstrates how to create a resizable splitter between two views using <see cref="ViewArrangement.LeftResizable"/>:
  15. /// </para>
  16. /// <code>
  17. /// // Create left pane that fills remaining space
  18. /// View leftPane = new ()
  19. /// {
  20. /// X = 0,
  21. /// Y = 0,
  22. /// Width = Dim.Fill (Dim.Func (_ => rightPane.Frame.Width)),
  23. /// Height = Dim.Fill (),
  24. /// CanFocus = true
  25. /// };
  26. ///
  27. /// // Create right pane with resizable left border (acts as splitter)
  28. /// View rightPane = new ()
  29. /// {
  30. /// X = Pos.Right (leftPane) - 1,
  31. /// Y = 0,
  32. /// Width = Dim.Fill (),
  33. /// Height = Dim.Fill (),
  34. /// Arrangement = ViewArrangement.LeftResizable,
  35. /// BorderStyle = LineStyle.Single,
  36. /// SuperViewRendersLineCanvas = true,
  37. /// CanFocus = true
  38. /// };
  39. /// rightPane.Border!.Thickness = new (1, 0, 0, 0); // Only left border
  40. ///
  41. /// container.Add (leftPane, rightPane);
  42. /// </code>
  43. /// <para>
  44. /// The right pane's left border acts as a draggable splitter. The left pane's width automatically adjusts
  45. /// to fill the remaining space using <c>Dim.Fill</c> with a function that subtracts the right pane's width.
  46. /// </para>
  47. /// </example>
  48. public ViewArrangement Arrangement { get; set; }
  49. }