From eaa4dfd4038dbc61793d76b7a6d58e342b8b6ad3 Mon Sep 17 00:00:00 2001 From: tznind Date: Fri, 27 Jan 2023 19:38:48 +0000 Subject: [PATCH] xmldoc and warnings --- Terminal.Gui/Views/TileView.cs | 82 +++++++++++++++++++++++++--------- 1 file changed, 62 insertions(+), 20 deletions(-) diff --git a/Terminal.Gui/Views/TileView.cs b/Terminal.Gui/Views/TileView.cs index c4a82e806..67ee2f704 100644 --- a/Terminal.Gui/Views/TileView.cs +++ b/Terminal.Gui/Views/TileView.cs @@ -23,12 +23,36 @@ namespace Terminal.Gui { /// public BorderStyle IntegratedBorder { get; set; } + /// + /// A single presented in a . To create + /// new instances use + /// or . + /// public class Tile { + /// + /// The that is showing in this . + /// You should add new child views to this member if you want multiple + /// within the . + /// public View View { get; internal set; } + + /// + /// Gets or Sets the minimum size you to allow when splitter resizing along + /// parent direction. + /// public int MinSize { get; set; } + + /// + /// The text that should be displayed above the . This will + /// either appear as content above or superimposed over the + /// the parent (if it has one). + /// public string Title { get; set; } - public Tile () + /// + /// Creates a new instance of the class. + /// + internal Tile () { View = new View () { Width = Dim.Fill (), Height = Dim.Fill () }; Title = string.Empty; @@ -54,12 +78,18 @@ namespace Terminal.Gui { private Orientation orientation = Orientation.Vertical; /// - /// Creates a new instance of the TileView class. + /// Creates a new instance of the class with + /// 2 tiles (i.e. left and right). /// public TileView () : this (2) { } + /// + /// Creates a new instance of the class with + /// number of tiles. + /// + /// public TileView (int tiles) { CanFocus = true; @@ -67,7 +97,7 @@ namespace Terminal.Gui { } /// - /// Invoked when the is changed + /// Invoked when any of the is changed. /// public event SplitterEventHandler SplitterMoved; @@ -211,7 +241,7 @@ namespace Terminal.Gui { LayoutSubviews (); } } - + /// public override void LayoutSubviews () { var contentArea = Bounds; @@ -344,18 +374,17 @@ namespace Terminal.Gui { } } } - + /// - /// Converts from a regular - /// container to a new nested . If - /// is already a then returns false. + /// Converts of element + /// from a regular to a new nested with + /// number of panels. Returns false if the element already contains a nested view. /// - /// After successful splitting, the returned container's - /// will contain the original content and (if any) while - /// will be empty and available for adding to. - /// for adding to. - /// The new now showing in - /// or the existing one if it was already been converted before. + /// After successful splitting, the + /// will contain the previous (replaced) at element 0. + /// The element of that is to be subdivided. + /// The number of panels that the should be split into + /// The new nested . /// if a was converted to a new nested /// . if it was already a nested /// @@ -364,6 +393,8 @@ namespace Terminal.Gui { // when splitting a view into 2 sub views we will need to migrate // the title too var tile = tiles [idx]; + + // TODO: migrate the title too right? var title = tile.Title; View toMove = tile.View; @@ -432,6 +463,16 @@ namespace Terminal.Gui { return parentTileView == null; } + /// + /// Returns the immediate parent of this. Note that in case + /// of deep nesting this might not be the root . Returns null + /// if this instance is not a nested child (created with + /// ) + /// + /// + /// Use to determine if the returned value is the root. + /// + /// public TileView GetParentTileView () { return this.parentTileView; @@ -757,7 +798,7 @@ namespace Terminal.Gui { /// /// - /// Moves to + /// Moves to /// preserving format /// (absolute / relative) that had. /// @@ -839,8 +880,9 @@ namespace Terminal.Gui { /// /// Creates a new instance of the class. /// - /// - /// + /// in which splitter is being moved. + /// Index of the splitter being moved in . + /// The new of the splitter line. public SplitterEventArgs (TileView tileView, int idx, Pos splitterDistance) { SplitterDistance = splitterDistance; @@ -849,7 +891,7 @@ namespace Terminal.Gui { } /// - /// New position of the + /// New position of the splitter line (see ). /// public Pos SplitterDistance { get; } @@ -859,8 +901,8 @@ namespace Terminal.Gui { public TileView TileView { get; } /// - /// The splitter that is being moved (use when - /// has more than 2 panels). + /// Gets the index of the splitter that is being moved. This can be + /// used to index /// public int Idx { get; } }