|
@@ -27,13 +27,13 @@ namespace Terminal.Gui {
|
|
|
/// </summary>
|
|
|
public class Responder {
|
|
|
/// <summary>
|
|
|
- /// Gets or sets a value indicating whether this <see cref="T:Terminal.Gui.Responder"/> can focus.
|
|
|
+ /// Gets or sets a value indicating whether this <see cref="Responder"/> can focus.
|
|
|
/// </summary>
|
|
|
/// <value><c>true</c> if can focus; otherwise, <c>false</c>.</value>
|
|
|
public virtual bool CanFocus { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Gets or sets a value indicating whether this <see cref="T:Terminal.Gui.Responder"/> has focus.
|
|
|
+ /// Gets or sets a value indicating whether this <see cref="Responder"/> has focus.
|
|
|
/// </summary>
|
|
|
/// <value><c>true</c> if has focus; otherwise, <c>false</c>.</value>
|
|
|
public virtual bool HasFocus { get; internal set; }
|
|
@@ -226,10 +226,10 @@ namespace Terminal.Gui {
|
|
|
/// <para>
|
|
|
/// 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 <see cref="T:Terminal.Gui.Pos"/>
|
|
|
+ /// The X and Y properties are of type <see cref="Pos"/>
|
|
|
/// and you can use either absolute positions, percentages or anchor
|
|
|
/// points. The Width and Height properties are of type
|
|
|
- /// <see cref="T:Terminal.Gui.Dim"/> and can use absolute position,
|
|
|
+ /// <see cref="Dim"/> 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; } = "";
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Gets or sets a value indicating whether this <see cref="T:Terminal.Gui.View"/> want mouse position reports.
|
|
|
+ /// Gets or sets a value indicating whether this <see cref="View"/> want mouse position reports.
|
|
|
/// </summary>
|
|
|
/// <value><c>true</c> if want mouse position reports; otherwise, <c>false</c>.</value>
|
|
|
public virtual bool WantMousePositionReports { get; set; } = false;
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Gets or sets a value indicating whether this <see cref="T:Terminal.Gui.View"/> want continuous button pressed event.
|
|
|
+ /// Gets or sets a value indicating whether this <see cref="View"/> want continuous button pressed event.
|
|
|
/// </summary>
|
|
|
public virtual bool WantContinuousButtonPressed { get; set; } = false;
|
|
|
/// <summary>
|
|
@@ -481,7 +481,7 @@ namespace Terminal.Gui {
|
|
|
public View SuperView => container;
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Initializes a new instance of the <see cref="T:Terminal.Gui.View"/> class with the absolute
|
|
|
+ /// Initializes a new instance of the <see cref="View"/> 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.
|
|
|
/// </summary>
|
|
@@ -494,7 +494,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Initializes a new instance of the <see cref="T:Terminal.Gui.View"/> class and sets the
|
|
|
+ /// Initializes a new instance of the <see cref="View"/> 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.
|
|
|
/// </summary>
|
|
@@ -1484,20 +1484,20 @@ namespace Terminal.Gui {
|
|
|
/// </remarks>
|
|
|
public class Toplevel : View {
|
|
|
/// <summary>
|
|
|
- /// Gets or sets whether the <see cref="T:Terminal.Gui.MainLoop"/> for this <see cref="T:Terminal.Gui.Toplevel"/> is running or not. Setting
|
|
|
+ /// Gets or sets whether the Mainloop for this <see cref="Toplevel"/> is running or not. Setting
|
|
|
/// this property to false will cause the MainLoop to exit.
|
|
|
/// </summary>
|
|
|
public bool Running { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Fired once the Toplevel's <see cref="T:Terminal.Gui.MainLoop"/> has started it's first iteration.
|
|
|
- /// Subscribe to this event to perform tasks when the <see cref="T:Terminal.Gui.Toplevel"/> has been laid out and focus has been set.
|
|
|
- /// changes. A Ready event handler is a good place to finalize initialization after calling `<see cref="T:Terminal.Gui.Application.Run"/>(topLevel)`.
|
|
|
+ /// Fired once the Toplevel's MainLoop has started it's first iteration.
|
|
|
+ /// Subscribe to this event to perform tasks when the <see cref="Toplevel"/> has been laid out and focus has been set.
|
|
|
+ /// changes. A Ready event handler is a good place to finalize initialization after calling `<see cref="Application.Run()"/>(topLevel)`.
|
|
|
/// </summary>
|
|
|
public event EventHandler Ready;
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Called from Application.RunLoop after the <see cref="T:Terminal.Gui.Toplevel"/> has entered it's first iteration of the loop.
|
|
|
+ /// Called from Application.RunLoop after the <see cref="Toplevel"/> has entered it's first iteration of the loop.
|
|
|
/// </summary>
|
|
|
internal virtual void OnReady ()
|
|
|
{
|
|
@@ -1505,7 +1505,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Initializes a new instance of the <see cref="T:Terminal.Gui.Toplevel"/> class with the specified absolute layout.
|
|
|
+ /// Initializes a new instance of the <see cref="Toplevel"/> class with the specified absolute layout.
|
|
|
/// </summary>
|
|
|
/// <param name="frame">Frame.</param>
|
|
|
public Toplevel (Rect frame) : base (frame)
|
|
@@ -1514,7 +1514,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Initializes a new instance of the <see cref="T:Terminal.Gui.Toplevel"/> class with Computed layout, defaulting to <see langword="async"/> full screen.
|
|
|
+ /// Initializes a new instance of the <see cref="Toplevel"/> class with Computed layout, defaulting to <see langword="async"/> full screen.
|
|
|
/// </summary>
|
|
|
public Toplevel () : base ()
|
|
|
{
|
|
@@ -1538,7 +1538,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Gets or sets a value indicating whether this <see cref="T:Terminal.Gui.Toplevel"/> can focus.
|
|
|
+ /// Gets or sets a value indicating whether this <see cref="Toplevel"/> can focus.
|
|
|
/// </summary>
|
|
|
/// <value><c>true</c> if can focus; otherwise, <c>false</c>.</value>
|
|
|
public override bool CanFocus {
|
|
@@ -1734,7 +1734,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// A toplevel view that draws a frame around its region and has a "ContentView" subview where the contents are added.
|
|
|
+ /// A <see cref="Toplevel"/> <see cref="View"/> that draws a frame around its region and has a "ContentView" subview where the contents are added.
|
|
|
/// </summary>
|
|
|
public class Window : Toplevel, IEnumerable {
|
|
|
View contentView;
|
|
@@ -1772,7 +1772,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Initializes a new instance of the <see cref="T:Terminal.Gui.Gui.Window"/> class with an optional title and a set frame.
|
|
|
+ /// Initializes a new instance of the <see cref="Gui.Window"/> class with an optional title and a set frame.
|
|
|
/// </summary>
|
|
|
/// <param name="frame">Frame.</param>
|
|
|
/// <param name="title">Title.</param>
|
|
@@ -1781,7 +1781,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Initializes a new instance of the <see cref="T:Terminal.Gui.Window"/> class with an optional title.
|
|
|
+ /// Initializes a new instance of the <see cref="Window"/> class with an optional title.
|
|
|
/// </summary>
|
|
|
/// <param name="title">Title.</param>
|
|
|
public Window (ustring title = null) : this (title, padding: 0)
|
|
@@ -1790,7 +1790,7 @@ namespace Terminal.Gui {
|
|
|
|
|
|
int padding;
|
|
|
/// <summary>
|
|
|
- /// Initializes a new instance of the <see cref="T:Terminal.Gui.Window"/> with
|
|
|
+ /// Initializes a new instance of the <see cref="Window"/> with
|
|
|
/// the specified frame for its location, with the specified border
|
|
|
/// an optional title.
|
|
|
/// </summary>
|
|
@@ -1808,7 +1808,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Initializes a new instance of the <see cref="T:Terminal.Gui.Window"/> with
|
|
|
+ /// Initializes a new instance of the <see cref="Window"/> with
|
|
|
/// the specified frame for its location, with the specified border
|
|
|
/// an optional title.
|
|
|
/// </summary>
|
|
@@ -1829,7 +1829,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Enumerates the various views in the ContentView.
|
|
|
+ /// Enumerates the various <see cref="View"/>s in the embedded <see cref="ContentView"/>.
|
|
|
/// </summary>
|
|
|
/// <returns>The enumerator.</returns>
|
|
|
public new IEnumerator GetEnumerator ()
|
|
@@ -1843,7 +1843,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Add the specified view to the ContentView.
|
|
|
+ /// Add the specified view to the <see cref="ContentView"/>.
|
|
|
/// </summary>
|
|
|
/// <param name="view">View to add to the window.</param>
|
|
|
public override void Add (View view)
|
|
@@ -1976,7 +1976,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// The application driver for gui.cs
|
|
|
+ /// The application driver for Terminal.Gui.
|
|
|
/// </summary>
|
|
|
/// <remarks>
|
|
|
/// <para>
|
|
@@ -1994,30 +1994,30 @@ namespace Terminal.Gui {
|
|
|
/// </remarks>
|
|
|
public static class Application {
|
|
|
/// <summary>
|
|
|
- /// The current Console Driver in use.
|
|
|
+ /// The current <see cref="ConsoleDriver"/> in use.
|
|
|
/// </summary>
|
|
|
public static ConsoleDriver Driver;
|
|
|
|
|
|
/// <summary>
|
|
|
- /// The Toplevel object used for the application on startup.
|
|
|
+ /// The <see cref="Toplevel"/> object used for the application on startup (<seealso cref="Application.Top"/>)
|
|
|
/// </summary>
|
|
|
/// <value>The top.</value>
|
|
|
public static Toplevel Top { get; private set; }
|
|
|
|
|
|
/// <summary>
|
|
|
- /// The current toplevel object. This is updated when Application.Run enters and leaves and points to the current toplevel.
|
|
|
+ /// The current <see cref="Toplevel"/> object. This is updated when <see cref="Application.Run()"/> enters and leaves to point to the current <see cref="Toplevel"/> .
|
|
|
/// </summary>
|
|
|
/// <value>The current.</value>
|
|
|
public static Toplevel Current { get; private set; }
|
|
|
|
|
|
/// <summary>
|
|
|
- /// TThe current view object being redrawn.
|
|
|
+ /// TThe current <see cref="View"/> object being redrawn.
|
|
|
/// </summary>
|
|
|
/// /// <value>The current.</value>
|
|
|
public static View CurrentView { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
- /// The mainloop driver for the applicaiton
|
|
|
+ /// The <see cref="MainLoop"/> driver for the applicaiton
|
|
|
/// </summary>
|
|
|
/// <value>The main loop.</value>
|
|
|
public static Mono.Terminal.MainLoop MainLoop { get; private set; }
|
|
@@ -2025,8 +2025,7 @@ namespace Terminal.Gui {
|
|
|
static Stack<Toplevel> toplevels = new Stack<Toplevel> ();
|
|
|
|
|
|
/// <summary>
|
|
|
- /// This event is raised on each iteration of the
|
|
|
- /// main loop.
|
|
|
+ /// This event is raised on each iteration of the <see cref="MainLoop"/>
|
|
|
/// </summary>
|
|
|
/// <remarks>
|
|
|
/// See also <see cref="Timeout"/>
|
|
@@ -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;
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Initializes the Application
|
|
|
+ /// Initializes a new instance of <see cref="Terminal.Gui"/> Application.
|
|
|
/// </summary>
|
|
|
+ /// <remarks>
|
|
|
+ /// <para>
|
|
|
+ /// Call this method once per instance (or after <see cref="Shutdown"/> has been called).
|
|
|
+ /// </para>
|
|
|
+ /// <para>
|
|
|
+ /// Loads the right <see cref="ConsoleDriver"/> for the platform.
|
|
|
+ /// </para>
|
|
|
+ /// <para>
|
|
|
+ /// Creates a <see cref="Toplevel"/> and assigns it to <see cref="Top"/> and <see cref="CurrentView"/>
|
|
|
+ /// </para>
|
|
|
+ /// </remarks>
|
|
|
public static void Init () => Init (() => Toplevel.Create ());
|
|
|
|
|
|
internal static bool _initialized = false;
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Initializes the Application
|
|
|
+ /// Initializes the Terminal.Gui application
|
|
|
/// </summary>
|
|
|
static void Init (Func<Toplevel> topLevelFactory)
|
|
|
{
|
|
@@ -2120,7 +2130,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Captures the execution state for the provided TopLevel view.
|
|
|
+ /// Captures the execution state for the provided <see cref="Toplevel"/> view.
|
|
|
/// </summary>
|
|
|
public class RunState : IDisposable {
|
|
|
internal RunState (Toplevel view)
|
|
@@ -2130,13 +2140,13 @@ namespace Terminal.Gui {
|
|
|
internal Toplevel Toplevel;
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Releases alTop = l resource used by the <see cref="T:Terminal.Gui.Application.RunState"/> object.
|
|
|
+ /// Releases alTop = l resource used by the <see cref="Application.RunState"/> object.
|
|
|
/// </summary>
|
|
|
- /// <remarks>Call <see cref="Dispose()"/> when you are finished using the <see cref="T:Terminal.Gui.Application.RunState"/>. The
|
|
|
- /// <see cref="Dispose()"/> method leaves the <see cref="T:Terminal.Gui.Application.RunState"/> in an unusable state. After
|
|
|
+ /// <remarks>Call <see cref="Dispose()"/> when you are finished using the <see cref="Application.RunState"/>. The
|
|
|
+ /// <see cref="Dispose()"/> method leaves the <see cref="Application.RunState"/> in an unusable state. After
|
|
|
/// calling <see cref="Dispose()"/>, you must release all references to the
|
|
|
- /// <see cref="T:Terminal.Gui.Application.RunState"/> so the garbage collector can reclaim the memory that the
|
|
|
- /// <see cref="T:Terminal.Gui.Application.RunState"/> was occupying.</remarks>
|
|
|
+ /// <see cref="Application.RunState"/> so the garbage collector can reclaim the memory that the
|
|
|
+ /// <see cref="Application.RunState"/> was occupying.</remarks>
|
|
|
public void Dispose ()
|
|
|
{
|
|
|
Dispose (true);
|
|
@@ -2342,15 +2352,15 @@ namespace Terminal.Gui {
|
|
|
public static event EventHandler<ResizedEventArgs> Loaded;
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Building block API: Prepares the provided toplevel for execution.
|
|
|
+ /// Building block API: Prepares the provided <see cref="Toplevel"/> for execution.
|
|
|
/// </summary>
|
|
|
- /// <returns>The runstate handle that needs to be passed to the End() method upon completion.</returns>
|
|
|
+ /// <returns>The runstate handle that needs to be passed to the <see cref="End(RunState)"/> method upon completion.</returns>
|
|
|
/// <param name="toplevel">Toplevel to prepare execution for.</param>
|
|
|
/// <remarks>
|
|
|
/// 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 <see cref="RunLoop"/> method, and then the <see cref="End(RunState)"/> method upon termination which will
|
|
|
/// undo these changes.
|
|
|
/// </remarks>
|
|
@@ -2385,7 +2395,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Building block API: completes the execution of a Toplevel that was started with Begin.
|
|
|
+ /// Building block API: completes the execution of a <see cref="Toplevel"/> that was started with <see cref="Begin(Toplevel)"/> .
|
|
|
/// </summary>
|
|
|
/// <param name="runState">The runstate returned by the <see cref="Begin(Toplevel)"/> method.</param>
|
|
|
public static void End (RunState runState)
|
|
@@ -2397,7 +2407,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Finalize the driver.
|
|
|
+ /// Shutdown an application initalized with <see cref="Init()"/>
|
|
|
/// </summary>
|
|
|
public static void Shutdown ()
|
|
|
{
|
|
@@ -2500,7 +2510,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Runs the application with the built-in toplevel view
|
|
|
+ /// Runs the application by calling <see cref="Run(Toplevel)"/> with the value of <see cref="Top"/>
|
|
|
/// </summary>
|
|
|
public static void Run ()
|
|
|
{
|
|
@@ -2508,7 +2518,7 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Runs the application with a new instance of the specified toplevel view
|
|
|
+ /// Runs the application by calling <see cref="Run(Toplevel)"/> with a new instance of the specified <see cref="Toplevel"/>-derived class
|
|
|
/// </summary>
|
|
|
public static void Run<T> () where T : Toplevel, new()
|
|
|
{
|
|
@@ -2517,27 +2527,26 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Runs the main loop on the given container.
|
|
|
+ /// Runs the main loop on the given <see cref="Toplevel"/> container.
|
|
|
/// </summary>
|
|
|
/// <remarks>
|
|
|
/// <para>
|
|
|
/// 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 <see cref="View"/>s such as <see cref="Dialog"/> boxes.
|
|
|
/// </para>
|
|
|
/// <para>
|
|
|
- /// To make a toplevel stop execution, set the "Running"
|
|
|
- /// property to false.
|
|
|
+ /// To make a <see cref="Run(Toplevel)"/> stop execution, call <see cref="Application.RequestStop"/>.
|
|
|
/// </para>
|
|
|
/// <para>
|
|
|
- /// 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 <see cref="Run(Toplevel)"/> is equivalent to calling <see cref="Begin(Toplevel)"/>, followed by <see cref="RunLoop(RunState, bool)"/>,
|
|
|
+ /// and then calling <see cref="End(RunState)"/>.
|
|
|
/// </para>
|
|
|
/// <para>
|
|
|
- /// 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 <see cref="Begin(Toplevel)"/> to set things up manually and then
|
|
|
+ /// repeatedly call <see cref="RunLoop(RunState, bool)"/> with the wait parameter set to false. By doing this
|
|
|
+ /// the <see cref="RunLoop(RunState, bool)"/> method will only process any pending events, timers, idle handlers and
|
|
|
/// then return control immediately.
|
|
|
/// </para>
|
|
|
/// </remarks>
|
|
@@ -2549,15 +2558,23 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Stops running the most recent toplevel
|
|
|
+ /// Stops running the most recent <see cref="Toplevel"/>.
|
|
|
/// </summary>
|
|
|
+ /// <remarks>
|
|
|
+ /// <para>
|
|
|
+ /// This will cause <see cref="Application.Run()"/> to return.
|
|
|
+ /// </para>
|
|
|
+ /// <para>
|
|
|
+ /// Calling <see cref="Application.RequestStop"/> is equivalent to setting the <see cref="Toplevel.Running"/> property on the curently running <see cref="Toplevel"/> to false.
|
|
|
+ /// </para>
|
|
|
+ /// </remarks>
|
|
|
public static void RequestStop ()
|
|
|
{
|
|
|
Current.Running = false;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Event arguments for the <see cref="T:Terminal.Gui.Application.Resized"/> event.
|
|
|
+ /// Event arguments for the <see cref="Application.Resized"/> event.
|
|
|
/// </summary>
|
|
|
public class ResizedEventArgs : EventArgs {
|
|
|
/// <summary>
|