diff --git a/Terminal.Gui/Core.cs b/Terminal.Gui/Core.cs index 2bf0d78f7..fa0b41354 100644 --- a/Terminal.Gui/Core.cs +++ b/Terminal.Gui/Core.cs @@ -27,13 +27,13 @@ namespace Terminal.Gui { /// public class Responder { /// - /// Gets or sets a value indicating whether this can focus. + /// Gets or sets a value indicating whether this can focus. /// /// true if can focus; otherwise, false. public virtual bool CanFocus { get; set; } /// - /// Gets or sets a value indicating whether this has focus. + /// Gets or sets a value indicating whether this has focus. /// /// true if has focus; otherwise, false. public virtual bool HasFocus { get; internal set; } @@ -226,10 +226,10 @@ namespace Terminal.Gui { /// /// When you do not specify a Rect frame you can use the more flexible /// Dim and Pos objects that can dynamically update the position of a view. - /// The X and Y properties are of type + /// The X and Y properties are of type /// and you can use either absolute positions, percentages or anchor /// points. The Width and Height properties are of type - /// and can use absolute position, + /// and can use absolute position, /// percentages and anchors. These are useful as they will take /// care of repositioning your views if your view's frames are resized /// or if the terminal size changes. @@ -351,13 +351,13 @@ namespace Terminal.Gui { public ustring Id { get; set; } = ""; /// - /// Gets or sets a value indicating whether this want mouse position reports. + /// Gets or sets a value indicating whether this want mouse position reports. /// /// true if want mouse position reports; otherwise, false. public virtual bool WantMousePositionReports { get; set; } = false; /// - /// Gets or sets a value indicating whether this want continuous button pressed event. + /// Gets or sets a value indicating whether this want continuous button pressed event. /// public virtual bool WantContinuousButtonPressed { get; set; } = false; /// @@ -481,7 +481,7 @@ namespace Terminal.Gui { public View SuperView => container; /// - /// Initializes a new instance of the class with the absolute + /// Initializes a new instance of the class with the absolute /// dimensions specified in the frame. If you want to have Views that can be positioned with /// Pos and Dim properties on X, Y, Width and Height, use the empty constructor. /// @@ -494,7 +494,7 @@ namespace Terminal.Gui { } /// - /// Initializes a new instance of the class and sets the + /// Initializes a new instance of the class and sets the /// view up for Computed layout, which will use the values in X, Y, Width and Height to /// compute the View's Frame. /// @@ -1484,20 +1484,20 @@ namespace Terminal.Gui { /// public class Toplevel : View { /// - /// Gets or sets whether the for this is running or not. Setting + /// Gets or sets whether the Mainloop for this is running or not. Setting /// this property to false will cause the MainLoop to exit. /// public bool Running { get; set; } /// - /// Fired once the Toplevel's has started it's first iteration. - /// Subscribe to this event to perform tasks when the has been laid out and focus has been set. - /// changes. A Ready event handler is a good place to finalize initialization after calling `(topLevel)`. + /// Fired once the Toplevel's MainLoop has started it's first iteration. + /// Subscribe to this event to perform tasks when the has been laid out and focus has been set. + /// changes. A Ready event handler is a good place to finalize initialization after calling `(topLevel)`. /// public event EventHandler Ready; /// - /// Called from Application.RunLoop after the has entered it's first iteration of the loop. + /// Called from Application.RunLoop after the has entered it's first iteration of the loop. /// internal virtual void OnReady () { @@ -1505,7 +1505,7 @@ namespace Terminal.Gui { } /// - /// Initializes a new instance of the class with the specified absolute layout. + /// Initializes a new instance of the class with the specified absolute layout. /// /// Frame. public Toplevel (Rect frame) : base (frame) @@ -1514,7 +1514,7 @@ namespace Terminal.Gui { } /// - /// Initializes a new instance of the class with Computed layout, defaulting to full screen. + /// Initializes a new instance of the class with Computed layout, defaulting to full screen. /// public Toplevel () : base () { @@ -1538,7 +1538,7 @@ namespace Terminal.Gui { } /// - /// Gets or sets a value indicating whether this can focus. + /// Gets or sets a value indicating whether this can focus. /// /// true if can focus; otherwise, false. public override bool CanFocus { @@ -1734,7 +1734,7 @@ namespace Terminal.Gui { } /// - /// A toplevel view that draws a frame around its region and has a "ContentView" subview where the contents are added. + /// A that draws a frame around its region and has a "ContentView" subview where the contents are added. /// public class Window : Toplevel, IEnumerable { View contentView; @@ -1772,7 +1772,7 @@ namespace Terminal.Gui { } /// - /// Initializes a new instance of the class with an optional title and a set frame. + /// Initializes a new instance of the class with an optional title and a set frame. /// /// Frame. /// Title. @@ -1781,7 +1781,7 @@ namespace Terminal.Gui { } /// - /// Initializes a new instance of the class with an optional title. + /// Initializes a new instance of the class with an optional title. /// /// Title. public Window (ustring title = null) : this (title, padding: 0) @@ -1790,7 +1790,7 @@ namespace Terminal.Gui { int padding; /// - /// Initializes a new instance of the with + /// Initializes a new instance of the with /// the specified frame for its location, with the specified border /// an optional title. /// @@ -1808,7 +1808,7 @@ namespace Terminal.Gui { } /// - /// Initializes a new instance of the with + /// Initializes a new instance of the with /// the specified frame for its location, with the specified border /// an optional title. /// @@ -1829,7 +1829,7 @@ namespace Terminal.Gui { } /// - /// Enumerates the various views in the ContentView. + /// Enumerates the various s in the embedded . /// /// The enumerator. public new IEnumerator GetEnumerator () @@ -1843,7 +1843,7 @@ namespace Terminal.Gui { } /// - /// Add the specified view to the ContentView. + /// Add the specified view to the . /// /// View to add to the window. public override void Add (View view) @@ -1976,7 +1976,7 @@ namespace Terminal.Gui { } /// - /// The application driver for gui.cs + /// The application driver for Terminal.Gui. /// /// /// @@ -1994,30 +1994,30 @@ namespace Terminal.Gui { /// public static class Application { /// - /// The current Console Driver in use. + /// The current in use. /// public static ConsoleDriver Driver; /// - /// The Toplevel object used for the application on startup. + /// The object used for the application on startup () /// /// The top. public static Toplevel Top { get; private set; } /// - /// The current toplevel object. This is updated when Application.Run enters and leaves and points to the current toplevel. + /// The current object. This is updated when enters and leaves to point to the current . /// /// The current. public static Toplevel Current { get; private set; } /// - /// TThe current view object being redrawn. + /// TThe current object being redrawn. /// /// /// The current. public static View CurrentView { get; set; } /// - /// The mainloop driver for the applicaiton + /// The driver for the applicaiton /// /// The main loop. public static Mono.Terminal.MainLoop MainLoop { get; private set; } @@ -2025,8 +2025,7 @@ namespace Terminal.Gui { static Stack toplevels = new Stack (); /// - /// This event is raised on each iteration of the - /// main loop. + /// This event is raised on each iteration of the /// /// /// See also @@ -2044,7 +2043,7 @@ namespace Terminal.Gui { } // - // provides the sync context set while executing code in gui.cs, to let + // provides the sync context set while executing code in Terminal.Gui, to let // users use async/await on their code // class MainLoopSyncContext : SynchronizationContext { @@ -2083,14 +2082,25 @@ namespace Terminal.Gui { public static bool UseSystemConsole; /// - /// Initializes the Application + /// Initializes a new instance of Application. /// + /// + /// + /// Call this method once per instance (or after has been called). + /// + /// + /// Loads the right for the platform. + /// + /// + /// Creates a and assigns it to and + /// + /// public static void Init () => Init (() => Toplevel.Create ()); internal static bool _initialized = false; /// - /// Initializes the Application + /// Initializes the Terminal.Gui application /// static void Init (Func topLevelFactory) { @@ -2120,7 +2130,7 @@ namespace Terminal.Gui { } /// - /// Captures the execution state for the provided TopLevel view. + /// Captures the execution state for the provided view. /// public class RunState : IDisposable { internal RunState (Toplevel view) @@ -2130,13 +2140,13 @@ namespace Terminal.Gui { internal Toplevel Toplevel; /// - /// Releases alTop = l resource used by the object. + /// Releases alTop = l resource used by the object. /// - /// Call when you are finished using the . The - /// method leaves the in an unusable state. After + /// Call when you are finished using the . The + /// method leaves the in an unusable state. After /// calling , you must release all references to the - /// so the garbage collector can reclaim the memory that the - /// was occupying. + /// so the garbage collector can reclaim the memory that the + /// was occupying. public void Dispose () { Dispose (true); @@ -2342,15 +2352,15 @@ namespace Terminal.Gui { public static event EventHandler Loaded; /// - /// Building block API: Prepares the provided toplevel for execution. + /// Building block API: Prepares the provided for execution. /// - /// The runstate handle that needs to be passed to the End() method upon completion. + /// The runstate handle that needs to be passed to the method upon completion. /// Toplevel to prepare execution for. /// /// This method prepares the provided toplevel for running with the focus, /// it adds this to the list of toplevels, sets up the mainloop to process the /// event, lays out the subviews, focuses the first element, and draws the - /// toplevel in the screen. This is usually followed by executing + /// toplevel in the screen. This is usually followed by executing /// the method, and then the method upon termination which will /// undo these changes. /// @@ -2385,7 +2395,7 @@ namespace Terminal.Gui { } /// - /// Building block API: completes the execution of a Toplevel that was started with Begin. + /// Building block API: completes the execution of a that was started with . /// /// The runstate returned by the method. public static void End (RunState runState) @@ -2397,7 +2407,7 @@ namespace Terminal.Gui { } /// - /// Finalize the driver. + /// Shutdown an application initalized with /// public static void Shutdown () { @@ -2500,7 +2510,7 @@ namespace Terminal.Gui { } /// - /// Runs the application with the built-in toplevel view + /// Runs the application by calling with the value of /// public static void Run () { @@ -2508,7 +2518,7 @@ namespace Terminal.Gui { } /// - /// Runs the application with a new instance of the specified toplevel view + /// Runs the application by calling with a new instance of the specified -derived class /// public static void Run () where T : Toplevel, new() { @@ -2517,27 +2527,26 @@ namespace Terminal.Gui { } /// - /// Runs the main loop on the given container. + /// Runs the main loop on the given container. /// /// /// /// This method is used to start processing events /// for the main application, but it is also used to - /// run modal dialog boxes. + /// run other modal s such as boxes. /// /// - /// To make a toplevel stop execution, set the "Running" - /// property to false. + /// To make a stop execution, call . /// /// - /// This is equivalent to calling Begin on the toplevel view, followed by RunLoop with the - /// returned value, and then calling end on the return value. + /// Calling is equivalent to calling , followed by , + /// and then calling . /// /// - /// Alternatively, if your program needs to control the main loop and needs to - /// process events manually, you can invoke Begin to set things up manually and then - /// repeatedly call RunLoop with the wait parameter set to false. By doing this - /// the RunLoop method will only process any pending events, timers, idle handlers and + /// Alternatively, to have a program control the main loop and + /// process events manually, call to set things up manually and then + /// repeatedly call with the wait parameter set to false. By doing this + /// the method will only process any pending events, timers, idle handlers and /// then return control immediately. /// /// @@ -2549,15 +2558,23 @@ namespace Terminal.Gui { } /// - /// Stops running the most recent toplevel + /// Stops running the most recent . /// + /// + /// + /// This will cause to return. + /// + /// + /// Calling is equivalent to setting the property on the curently running to false. + /// + /// public static void RequestStop () { Current.Running = false; } /// - /// Event arguments for the event. + /// Event arguments for the event. /// public class ResizedEventArgs : EventArgs { /// diff --git a/Terminal.Gui/Dialogs/Dialog.cs b/Terminal.Gui/Dialogs/Dialog.cs index 2aef337d5..82d696d73 100644 --- a/Terminal.Gui/Dialogs/Dialog.cs +++ b/Terminal.Gui/Dialogs/Dialog.cs @@ -11,21 +11,20 @@ using NStack; namespace Terminal.Gui { /// - /// The dialog box is a window that by default is centered and contains one - /// or more buttons. It defaults to the Colors.Dialog color scheme and has a - /// 1 cell padding around the edges. + /// The is a that by default is centered and contains one + /// or more . It defaults to the color scheme and has a 1 cell padding around the edges. /// /// - /// To run the dialog modally, create the Dialog, and pass this to Application.Run which - /// will execute the dialog until it terminates via the [ESC] key, or when one of the views - /// or buttons added to the dialog set the Running property on the Dialog to false. + /// To run the modally, create the , and pass it to . + /// This will execute the dialog until it terminates via the [ESC] or [CTRL-Q] key, or when one of the views + /// or buttons added to the dialog calls . /// public class Dialog : Window { List