Browse Source

Updated overview docs

Tig Kindel 1 year ago
parent
commit
f46acdf67d
5 changed files with 229 additions and 266 deletions
  1. 28 0
      docfx/docs/color.md
  2. 22 18
      docfx/docs/config.md
  3. 85 247
      docfx/docs/index.md
  4. 1 1
      docfx/docs/keyboard.md
  5. 93 0
      docfx/docs/layout.md

+ 28 - 0
docfx/docs/color.md

@@ -0,0 +1,28 @@
+# Color
+
+## Tenets for Terminal.Gui Color Unless you know better ones...)
+
+Tenets higher in the list have precedence over tenets lower in the list.
+
+* **Gracefully Degrade** - 
+* ..
+
+## Color APIs
+
+...
+
+The [ColorScheme](~/api/Terminal.Gui.ColorScheme.yml) represents
+four values, the color used for Normal text, the color used for normal text when
+a view is focused an the colors for the hot-keys both in focused and unfocused modes.
+
+By using `ColorSchemes` you ensure that your application will work correctbly both
+in color and black and white terminals.
+
+Some views support setting individual color attributes, you create an
+attribute for a particular pair of Foreground/Background like this:
+
+```
+var myColor = Application.Driver.MakeAttribute (Color.Blue, Color.Red);
+var label = new Label (...);
+label.TextColor = myColor
+```

+ 22 - 18
docfx/docs/config.md

@@ -1,30 +1,30 @@
 # Configuration Management
 
-Terminal.Gui provides configuration and theme management for Terminal.Gui applications via the [`ConfigurationManager`](~/api/Terminal.Gui.
+Terminal.Gui provides persistent configuration settings via the [`ConfigurationManager`](~/api/Terminal.Gui.ConfigurationManager.yml) class.
 
-1) **Settings**. Settings are applied to the [`Application`](~/api/Terminal.Gui.Application.yml) class. Settings are accessed via the `Settings` property of the [`ConfigurationManager`](~/api/Terminal.Gui.ConfigurationManager.yml) class.
-2) **Themes**. Themes are a named collection of settings impacting how applications look. The default theme is named "Default". The built-in configuration stored within the Terminal.Gui library defines two additional themes: "Dark", and "Light". Additional themes can be defined in the configuration files.
-3) **AppSettings**. AppSettings allow applicaitons to use the  [`ConfigurationManager`](~/api/Terminal.Gui.ConfigurationManager.yml) to store and retrieve application-specific settings.
+1) **Settings**. Settings are applied to the [`Application`](~/api/Terminal.Gui.Application.yml) class. Settings are accessed via the `Settings` property of [`ConfigurationManager`](~/api/Terminal.Gui.ConfigurationManager.yml).
+2) **Themes**. Themes are a named collection of settings impacting how applications look. The default theme is named "Default". Two other built-in themes are provided: "Dark", and "Light". Additional themes can be defined in the configuration files.
+3) **AppSettings**. Applications can use the [`ConfigurationManager`](~/api/Terminal.Gui.ConfigurationManager.yml) to store and retrieve application-specific settings.
 
-The The [`ConfigurationManager`](~/api/Terminal.Gui.ConfigurationManager.yml) will look for configuration files in the `.tui` folder in the user's home directory (e.g. `C:/Users/username/.tui` or `/usr/username/.tui`), the folder where the Terminal.Gui application was launched from (e.g. `./.tui`), or as a resource within the Terminal.Gui application's main assembly.
+The [`ConfigurationManager`](~/api/Terminal.Gui.ConfigurationManager.yml) will look for configuration files in the `.tui` folder in the user's home directory (e.g. `C:/Users/username/.tui` or `/usr/username/.tui`), the folder where the Terminal.Gui application was launched from (e.g. `./.tui`), or as a resource within the Terminal.Gui application's main assembly.
 
-Settings that will apply to all applications (global settings) reside in files named config.json. Settings that will apply to a specific Terminal.Gui application reside in files named appname.config.json, where appname is the assembly name of the application (e.g. `UICatalog.config.json`).
+Settings that will apply to all applications (global settings) reside in files named `config.json`. Settings that will apply to a specific Terminal.Gui application reside in files named `appname.config.json`, where *appname* is the assembly name of the application (e.g. `UICatalog.config.json`).
 
 Settings are applied using the following precedence (higher precedence settings overwrite lower precedence settings):
 
-1. App specific settings found in the users's home directory (`~/.tui/appname.config.json`). -- Highest precedence.
+1. App-specific settings in the users's home directory (`~/.tui/appname.config.json`). -- Highest precedence.
 
-2. App specific settings found in the directory the app was launched from (`./.tui/appname.config.json`).
+2. App-specific settings in the directory the app was launched from (`./.tui/appname.config.json`).
 
 3. App settings in app resources (`Resources/config.json`).
 
-4. Global settings found in the the user's home directory (`~/.tui/config.json`).
+4. Global settings in the the user's home directory (`~/.tui/config.json`).
 
-5. Global settings found in the directory the app was launched from (`./.tui/config.json`).
+5. Global settings in the directory the app was launched from (`./.tui/config.json`).
 
-6. Default settings defined in the Terminal.Gui assembly -- Lowest precedence.
+6. Default settings in the Terminal.Gui assembly -- Lowest precedence.
 
-The `UI Catalog` application provides an example of how to use the [`ConfigurationManager`](~/api/Terminal.Gui.ConfigurationManager.yml) class to load and save configuration files. The `Configuration Editor` scenario provides an editor that allows users to edit the configuration files. UI Catalog also uses a file system watcher to detect changes to the configuration files to tell [`ConfigurationManager`](~/api/Terminal.Gui.ConfigurationManager.yml) to reaload them; allowing users to change settings without having to restart the application.
+The `UI Catalog` application provides an example of how to use the [`ConfigurationManager`](~/api/Terminal.Gui.ConfigurationManager.yml) class to load and save configuration files. The `Configuration Editor` scenario provides an editor that allows users to edit the configuration files. UI Catalog also uses a file system watcher to detect changes to the configuration files to tell [`ConfigurationManager`](~/api/Terminal.Gui.ConfigurationManager.yml) to reload them; allowing users to change settings without having to restart the application.
 
 # What Can Be Configured
 
@@ -41,11 +41,11 @@ The `UI Catalog` application provides an example of how to use the [`Configurati
 
 ## Glyphs
 
-Defines the standard set of glyphs used for standard views (e.g. the default indicator for [Button](~/api/Terminal.Gui.Button.yml)) and line drawing (e.g. [LineCanvas](~/api/Terminal.Gui.LineCanvas.yml)).
+The standard set of glyphs used for standard views (e.g. the default indicator for [Button](~/api/Terminal.Gui.Button.yml)) and line drawing (e.g. [LineCanvas](~/api/Terminal.Gui.LineCanvas.yml)) can be configured.
 
 The value can be either a decimal number or a string. The string may be:
 
-- A unicode char (e.g. "☑")
+- A Unicode char (e.g. "☑")
 - A hex value in U+ format (e.g. "U+2611")
 - A hex value in UTF-16 format (e.g. "\\u2611")
 
@@ -60,11 +60,9 @@ The value can be either a decimal number or a string. The string may be:
 
 ## Themes
 
-A Theme is a named collection of settings that impact the visual style of Terminal.Gui applications. The default theme is named "Default". The built-in configuration stored within the Terminal.Gui library defines two more themes: "Dark", and "Light". Additional themes can be defined in the configuration files. 
+A Theme is a named collection of settings that impact the visual style of Terminal.Gui applications. The default theme is named "Default". The built-in configuration within the Terminal.Gui library defines two more themes: "Dark", and "Light". Additional themes can be defined in the configuration files. The JSON property `Theme` defines the name of the theme that will be used. If the theme is not found, the default theme will be used.
 
-The Json property `Theme` defines the name of the theme that will be used. If the theme is not found, the default theme will be used.
-
-Themes support defining ColorSchemes as well as various default settings for Views. Both the default color schemes and user defined color schemes can be configured. See [ColorSchemes](~/api/Terminal.Gui.Colors.yml) for more information.
+Themes support defining ColorSchemes as well as various default settings for Views. Both the default color schemes and user-defined color schemes can be configured. See [ColorSchemes](~/api/Terminal.Gui.Colors.yml) for more information.
 
 # Example Configuration File
 
@@ -123,6 +121,12 @@ Themes support defining ColorSchemes as well as various default settings for Vie
 }
 ```
 
+# Key Bindings
+
+Key bindings are defined in the `KeyBindings` property of the configuration file. The value is an array of objects, each object defining a key binding. The key binding object has the following properties:
+
+- `Key`: The key to bind to. The format is a string describing the key (e.g. "q", "Q,  "Ctrl-Q"). Function keys are specified as "F1", "F2", etc. 
+
 # Configuration File Schema
 
 Settings are defined in JSON format, according to the schema found here: 

+ 85 - 247
docfx/docs/index.md

@@ -1,6 +1,17 @@
 # Terminal.Gui v2 Overview
 
- A toolkit for building rich console apps for .NET, .NET Core, and Mono that works on Windows, the Mac, and Linux/Unix.
+ A toolkit for building rich Terminal User Interface (TUI) apps with .NET that run on Windows, the Mac, and Linux/Unix.
+
+## Features
+
+* **[Cross Platform](drivers.md)** - Windows, Mac, and Linux. Terminal drivers for Curses, Windows, and the .NET Console mean apps will work well on both color and monochrome terminals. Apps also work over SSH.
+* **[Templates](getting-started.md)** - The `dotnet new` command can be used to create a new Terminal.Gui app.
+* **[Keyboard](keyboard.md) and [Mouse](mouse.md) Input** - The library handles all the details of input processing and provides a simple event-based API for applications to consume.
+* **[Extensible Widgets](https://gui-cs.github.io/Terminal.GuiV2Docs/api/Terminal.Gui.View.html)** - All visible UI elements are subclasses of the `View` class, and these in turn can contain an arbitrary number of sub-views. Dozens of [Built-in Views](views.md) are provided.
+* **[Flexible Layout](layout.md)** - *Computed Layout* makes it easy to lay out controls relative to each other and enables dynamic terminal UIs. *Absolute Layout* allows for precise control over the position and size of controls.
+* **[Clipboard support](https://gui-cs.github.io/Terminal.GuiV2Docs/api/Terminal.Gui.Clipboard.html)** - Cut, Copy, and Paste is provided through the [`Clipboard`] class.
+* **Advanced App Features** - The [Mainloop](https://gui-cs.github.io/Terminal.GuiV2Docs/api/Terminal.Gui.MainLoop.html) supports processing events, idle handlers, and timers. Most classes are safe for threading.
+* **[Reactive Extensions](https://github.com/dotnet/reactive)** - Use reactive extensions and benefit from increased code readability, and the ability to apply the MVVM pattern and [ReactiveUI](https://www.reactiveui.net/) data bindings. See the [source code](https://github.com/gui-cs/Terminal.GuiV2Docs/tree/master/ReactiveExample) of a sample app.
 
 ## Conceptual Documentation
 
@@ -12,131 +23,82 @@
 * [TableView Deep Dive](tableview.md)
 * [TreeView Deep Dive](treeview.md)
 
-## Features
-
-* **Cross Platform** - Windows, Mac, and Linux. Terminal drivers for Curses, [Windows Console](https://github.com/gui-cs/Terminal.GuiV2Docs/issues/27), and the .NET Console mean apps will work well on both color and monochrome terminals. 
-* **Keyboard and Mouse Input** - Both keyboard and mouse input are supported, including support for drag & drop.
-* **[Flexible Layout](https://gui-cs.github.io/Terminal.GuiV2Docs/docs/overview.html#layout)** - Supports both *Absolute layout* and an innovative *Computed Layout* system. *Computed Layout* makes it easy to lay out controls relative to each other and enables dynamic terminal UIs.
-* **Clipboard support** - Cut, Copy, and Paste of text provided through the [`Clipboard`](https://gui-cs.github.io/Terminal.GuiV2Docs/api/Terminal.Gui.Clipboard.html) class.
-* **[Arbitrary Views](https://gui-cs.github.io/Terminal.GuiV2Docs/api/Terminal.Gui.View.html)** - All visible UI elements are subclasses of the `View` class, and these in turn can contain an arbitrary number of sub-views.
-* **Advanced App Features** - The [Mainloop](https://gui-cs.github.io/Terminal.GuiV2Docs/api/Terminal.Gui.MainLoop.html) supports processing events, idle handlers, timers, and monitoring file
-descriptors. Most classes are safe for threading.
-* **Reactive Extensions** - Use [reactive extensions](https://github.com/dotnet/reactive) and benefit from increased code readability, and the ability to apply the MVVM pattern and [ReactiveUI](https://www.reactiveui.net/) data bindings. See the [source code](https://github.com/gui-cs/Terminal.GuiV2Docs/tree/master/ReactiveExample) of a sample app in order to learn how to achieve this.
-
-
-
-`Terminal.Gui` is a library intended to create console-based
-applications using C#. The framework has been designed to make it
-easy to write applications that will work on monochrome terminals, as
-well as modern color terminals with mouse support.
-
-This library works across Windows, Linux and MacOS.
-
-This library provides a text-based toolkit as works in a way similar
-to graphic toolkits. There are many controls that can be used to
-create your applications and it is event based, meaning that you
-create the user interface, hook up various events and then let the
-a processing loop run your application, and your code is invoked via
-one or more callbacks.
-
 The simplest application looks like this:
 
 ```csharp
 using Terminal.Gui;
-
-class Demo {
-    static int Main ()
-    {
-        Application.Init ();
-
-        var n = MessageBox.Query (50, 7, 
-            "Question", "Do you like console apps?", "Yes", "No");
-            
-		Application.Shutdown ();
-        return n;
-    }
-}
+Application.Init ();
+var n = MessageBox.Query (50, 5, "Question", "Do you like TUI apps?", "Yes", "No");
+Application.Shutdown ();
+return n;
 ```
 
 This example shows a prompt and returns an integer value depending on
-which value was selected by the user (Yes, No, or if they use chose
-not to make a decision and instead pressed the ESC key).
+which value was selected by the user.
 
 More interesting user interfaces can be created by composing some of
-the various views that are included. In the following sections, you
+the various `View` classes that are included. In the following sections, you
 will see how applications are put together.
 
-In the example above, you can see that we have initialized the runtime by calling  
-[Applicaton.Init](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_Init_Terminal_Gui_ConsoleDriver_) method in the Application class - this sets up the environment, initializes the color
-schemes available for your application and clears the screen to start your application.
+In the example above, you can see that we have initialized the runtime by calling [Applicaton.Init](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_Init_Terminal_Gui_ConsoleDriver_) - this sets up the environment, initializes the color schemes, and clears the screen to start the application.
 
-The [Application](~/api/Terminal.Gui.Application.yml) class, additionally creates an instance of the [Toplevel](~/api/Terminal.Gui.Toplevel.yml) class that is ready to be consumed, 
-this instance is available in the `Application.Top` property, and can be used like this:
+The [Application](~/api/Terminal.Gui.Application.yml) class additionally creates an instance of the [Toplevel](~/api/Terminal.Gui.Toplevel.yml) View available in the `Application.Top` property, and can be used like this:
 
 ```csharp
 using Terminal.Gui;
+Application.Init ();
 
-class Demo {
-    static int Main ()
-    {
-        Application.Init ();
-
-        var label = new Label ("Hello World") {
-            X = Pos.Center (),
-            Y = Pos.Center (),
-            Height = 1,
-        };
-        Application.Top.Add (label);
-        Application.Run ();
-        Application.Shutdown ();
-    }
-}
+var label = new Label ("Hello World") {
+    X = Pos.Center (),
+    Y = Pos.Center (),
+    Height = 1,
+};
+
+Application.Top.Add (label);
+Application.Run ();
+Application.Shutdown ();
 ```
 
 Typically, you will want your application to have more than a label, you might
-want a menu, and a region for your application to live in, the following code
-does this:
+want a menu and a button for example. the following code does this:
 
 ```csharp
 using Terminal.Gui;
 
-class Demo {
-    static int Main ()
-    {
-        Application.Init ();
-        var menu = new MenuBar (new MenuBarItem [] {
-            new MenuBarItem ("_File", new MenuItem [] {
-                new MenuItem ("_Quit", "", () => { 
-                    Application.RequestStop (); 
-                })
-            }),
-        });
-        
-        var win = new Window ("Hello") {
-            X = 0,
-            Y = 1,
-            Width = Dim.Fill (),
-            Height = Dim.Fill () - 1
-        };
-
-        // Add both menu and win in a single call
-        Application.Top.Add (menu, win);
-        Application.Run ();
-        Application.Shutdown ();
-    }
-}
+Application.Init ();
+var menu = new MenuBar (new MenuBarItem [] {
+    new MenuBarItem ("_File", new MenuItem [] {
+        new MenuItem ("_Quit", "", () => { 
+            Application.RequestStop (); 
+        })
+    }),
+});
+
+var button = new Button ("_Hello") {
+    X = 0,
+    Y = Pos.Bottom (menu),
+    Width = Dim.Fill (),
+    Height = Dim.Fill () - 1
+};
+button.Clicked += () => {
+    MessageBox.Query (50, 5, "Hi", "Hello World! This is a message box", "Ok");
+};
+
+// Add both menu and win in a single call
+Application.Top.Add (menu, button);
+Application.Run ();
+Application.Shutdown ();
 ```
 
 ## Views
 
-All visible elements on a Terminal.Gui application are implemented as
+All visible elements in a Terminal.Gui application are implemented as
 [Views](~/api/Terminal.Gui.View.yml). Views are self-contained objects that take care of displaying themselves, can receive keyboard and mouse input and participate in the focus mechanism.
 
 See the full list of [Views provided by the Terminal.Gui library here](views.md).
 
-Every view can contain an arbitrary number of children views. These are called
-the Subviews. You can add a view to an existing view, by calling the 
-[Add](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_Add_Terminal_Gui_View_) method, for example, to add a couple of buttons to a UI, you can do this:
+Every view can contain an arbitrary number of children views, called `SubViews`.Call the
+[View.Add](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_Add_Terminal_Gui_View_) method to add a couple of buttons to a UI:
 
 ```csharp
 void SetupMyView (View myView)
@@ -164,158 +126,28 @@ View.
 
 ## Layout
 
-Terminal.Gui supports two different layout systems, absolute and computed \
-(controlled by the [LayoutStyle](~/api/Terminal.Gui.LayoutStyle.yml)
-property on the view.
-
-The absolute system is used when you want the view to be positioned exactly in
-one location and want to manually control where the view is. This is done
-by invoking your View constructor with an argument of type [Rect](~/api/Terminal.Gui.Rect.yml). When you do this, to change the position of the View, you can change the `Frame` property on the View.
-
-The computed layout system offers a few additional capabilities, like automatic
-centering, expanding of dimensions and a handful of other features. To use
-this you construct your object without an initial `Frame`, but set the 
- `X`, `Y`, `Width` and `Height` properties after the object has been created.
-
-Examples:
-
-```csharp
-
-// Dynamically computed
-var label = new Label ("Hello") {
-    X = 1,
-    Y = Pos.Center (),
-    Width = Dim.Fill (),
-    Height = 1
-};
-
-// Absolute position using the provided rectangle
-var label2 = new Label (new Rect (1, 2, 20, 1), "World")
-```
-
-The computed layout system does not take integers, instead the `X` and `Y` properties are of type [Pos](~/api/Terminal.Gui.Pos.yml) and the `Width` and `Height` properties are of type [Dim](~/api/Terminal.Gui.Dim.yml) both which can be created implicitly from integer values.
-
-### The `Pos` Type
-
-The `Pos` type on `X` and `Y` offers a few options:
-* Absolute position, by passing an integer
-* Percentage of the parent's view size - `Pos.Percent(n)`
-* Anchored from the end of the dimension - `AnchorEnd(int margin=0)`
-* Centered, using `Center()`
-* Reference the Left (X), Top (Y), Bottom, Right positions of another view
-
-The `Pos` values can be added or subtracted, like this:
-
-```csharp
-// Set the X coordinate to 10 characters left from the center
-view.X = Pos.Center () - 10;
-
-view.Y = Pos.Percent (20);
-
-anotherView.X = AnchorEnd (10);
-anotherView.Width = 9;
-
-myView.X = Pos.X (view);
-myView.Y = Pos.Bottom (anotherView);
-```
-
-### The `Dim` Type
-
-The `Dim` type is used for the `Width` and `Height` properties on the View and offers
-the following options:
-
-* Absolute size, by passing an integer
-* Percentage of the parent's view size - `Dim.Percent(n)`
-* Fill to the end - `Dim.Fill ()`
-* Reference the Width or Height of another view
-
-Like, `Pos`, objects of type `Dim` can be added an subtracted, like this:
-
-
-```csharp
-// Set the Width to be 10 characters less than filling 
-// the remaining portion of the screen
-view.Width = Dim.Fill () - 10;
-
-view.Height = Dim.Percent(20) - 1;
-
-anotherView.Height = Dim.Height (view)+1
-```
+Terminal.Gui v2 supports the following View layout systems (controlled by the [View.LayoutStyle](~/api/Terminal.Gui.LayoutStyle.yml)):
 
-## TopLevels, Windows and Dialogs.
+* **Absolute** - Used to have the View positioned exactly in a location, with a fixed size. Absolute layout is accomplished by constructing a View with an argument of type [Rect](~/api/Terminal.Gui.Rect.yml) or directly changing the `Frame` property on the View.
+* **Computed** - The Computed Layout system provides automatic aligning of Views with other Views, automatic centering, and automatic sizing. To use Computed layout set the 
+ `X`, `Y`, `Width` and `Height` properties after the object has been created. Views laid out using the Computed Layout system can be resized with the mouse or keyboard, enabling tiled window managers and dynamic terminal UIs.
+* **Overlapped** - New in V2 (But not yet) - Overlapped layout enables views to be positioned on top of each other. Overlapped Views are movable and sizable with both the keyboard and the mouse.
 
-Among the many kinds of views, you typically will create a [Toplevel](~/api/Terminal.Gui.Toplevel.yml) view (or any of its subclasses), like [Window](~/api/Terminal.Gui.Window.yml) or [Dialog](~/api/Terminal.Gui.Dialog.yml) which is special kind of views that can be executed modally - that is, the view can take over all input and returns
-only when the user chooses to complete their work there. 
+See the full [Layout documentation here](layout.md).
 
-The following sections cover the differences.
+## Modal Views
 
-### TopLevel Views
+Views can either be Modal or Non-modal. Modal views take over all user input until the user closes the View. Examples of Modal Views are Toplevel, Dialog, and Wizard. Non-modal views can be used to create a new experience in your application, one where you would have a new top-level menu for example. Setting the `Modal` property on a View to `true` makes it modal.
 
-[Toplevel](~/api/Terminal.Gui.Toplevel.yml) views have no visible user interface elements and occupy an arbitrary portion of the screen.
+### Windows
 
-You would use a toplevel Modal view for example to launch an entire new experience in your application, one where you would have a new top-level menu for example. You 
-typically would add a Menu and a Window to your Toplevel, it would look like this:
-
-```csharp
-using Terminal.Gui;
-
-class Demo {
-    static void Edit (string filename)
-    {
-        var top = new Toplevel () { 
-            X = 0, 
-            Y = 0, 
-            Width = Dim.Fill (), 
-            Height = Dim.Fill () 
-        };
-        var menu = new MenuBar (new MenuBarItem [] {
-            new MenuBarItem ("_File", new MenuItem [] {
-                new MenuItem ("_Close", "", () => { 
-                    Application.RequestStop ();
-                })
-            }),
-        });
-        
-        // nest a window for the editor
-        var win = new Window (filename) {
-            X = 0,
-            Y = 1,
-            Width = Dim.Fill (),
-            Height = Dim.Fill () - 1
-        };
-
-        var editor = new TextView () {
-            X = 0, 
-            Y = 0,
-            Width = Dim.Fill (),
-            Height = Dim.Fill ()
-        };
-        editor.Text = System.IO.File.ReadAllText (filename);
-        win.Add (editor);
-
-        // Add both menu and win in a single call
-        top.Add (win, menu);
-        Application.Run (top);
-        Application.Shutdown ();
-    }
-}
-```
-
-### Window Views
-
-[Window](~/api/Terminal.Gui.Window.yml) views extend the Toplevel view by providing a frame and a title around the toplevel - and can be moved on the screen with the mouse (caveat: code is currently disabled)
-
-From a user interface perspective, you might have more than one Window on the screen at a given time.
+[Window](~/api/Terminal.Gui.Window.yml) is a view used in Overlapped layouts, providing a frame and a title - and can be moved and sized with the keyboard or mouse.
 
 ### Dialogs
 
-[Dialog](~/api/Terminal.Gui.Dialog.yml) are [Window](~/api/Terminal.Gui.Window.yml) objects that happen to be centered in the middle of the screen.
-
-Dialogs are instances of a Window that are centered in the screen, and are intended
-to be used modally - that is, they run, and they are expected to return a result 
-before resuming execution of your application.
+[Dialogs](~/api/Terminal.Gui.Dialog.yml) are Modal [Windows](~/api/Terminal.Gui.Window.yml) that are centered in the middle of the screen and are intended to be used modally - that is, they run, and they are expected to return a result before resuming execution of the application.
 
-Dialogs are a subclass of `Window` and additionally expose the 
+Dialogs expose the 
 [`AddButton`](https://migueldeicaza.github.io/gui.cs/api/Terminal.Gui.Dialog.yml#Terminal_Gui_Dialog_AddButton_Terminal_Gui_Button_) API which manages the layout
 of any button passed to it, ensuring that the buttons are at the bottom of the dialog.
 
@@ -336,10 +168,13 @@ Which will show something like this:
 +------------------------------------------------------+
 ```
 
+### Wizards
+
+[Wizards](~/api/Terminal.Gui.Wizard.yml) are Dialogs that let users step through a series of steps to complete a task. 
+
 ### Running Modally
 
-To run your Dialog, Window or Toplevel modally, you will invoke the `Application.Run`
-method on the toplevel. It is up to your code and event handlers to invoke the `Application.RequestStop()` method to terminate the modal execution.
+To run any View (but especially Dialogs, Windows, or Toplevels) modally, invoke the `Application.Run` method on a Toplevel. Use the `Application.RequestStop()` method to terminate the modal execution.
 
 ```csharp
 bool okpressed = false;
@@ -363,17 +198,17 @@ if (okpressed)
     Console.WriteLine ("The user entered: " + entry.Text);
 ```
 
-There is no return value from running modally, so your code will need to have a mechanism
-of indicating the reason that the execution of the modal dialog was completed, in the 
+There is no return value from running modally, so the modal view must have a mechanism
+of indicating the reason the modal was closed. In the 
 case above, the `okpressed` value is set to true if the user pressed or selected the Ok button.
 
 ## Input Handling
 
-Every view has a focused view, and if that view has nested views, one of those is 
+Every view has a focused view, and if that view has nested SubViews, one of those is 
 the focused view. This is called the focus chain, and at any given time, only one
-View has the focus. 
+View has the [Focus](). 
 
-The library binds the key Tab to focus the next logical view, and the Shift-Tab combination to focus the previous logical view. 
+The library provides a default focus mechanism that can be used to navigate the focus chain. The default focus mechanism is based on the Tab key, and the Shift-Tab key combination
 
 Keyboard processing details are available on the [Keyboard Event Processing](keyboard.md) document.
 
@@ -382,8 +217,7 @@ Keyboard processing details are available on the [Keyboard Event Processing](key
 All views have been configured with a color scheme that will work both in color
 terminals as well as the more limited black and white terminals. 
 
-The various styles are captured in the [Colors](~/api/Terminal.Gui.Colors.yml) class which defined color schemes for
-the toplevel, the normal views, the menu bar, popup dialog boxes and error dialog boxes, that you can use like this:
+The various styles are captured in the [Colors](~/api/Terminal.Gui.Colors.yml) class which defines color schemes for Toplevel, the normal views (Base), the menu bar, dialog boxes, and error UI::
 
 * `Colors.Toplevel`
 * `Colors.Base`
@@ -398,6 +232,8 @@ var w = new Window ("Hello");
 w.ColorScheme = Colors.Error
 ```
 
+ColorSchemes can be configured with the [Configuration and Theme Manager](config.md). 
+
 The [ColorScheme](~/api/Terminal.Gui.ColorScheme.yml) represents
 four values, the color used for Normal text, the color used for normal text when
 a view is focused an the colors for the hot-keys both in focused and unfocused modes.
@@ -414,9 +250,11 @@ var label = new Label (...);
 label.TextColor = myColor
 ```
 
+Learn more about colors in the [Color](color.md) overview.
+
 ## MainLoop, Threads and Input Handling
 
-Detailed description of the mainloop is described on the [Event Processing and the Application Main Loop](~/docs/mainloop.md) document.
+The Main Loop, threading, and timers are described on the [Event Processing and the Application Main Loop](~/docs/mainloop.md) document.
 
 ## Cross-Platform Drivers
 

+ 1 - 1
docfx/docs/keyboard.md

@@ -1,4 +1,4 @@
-# Keyboard Event Processing
+# Keyboard Events
 
 ## Tenets for Terminal.Gui Key Bindings (Unless you know better ones...)
 

+ 93 - 0
docfx/docs/layout.md

@@ -0,0 +1,93 @@
+# Layout
+
+## Tenets for Terminal.Gui View Layout (Unless you know better ones...)
+
+Tenets higher in the list have precedence over tenets lower in the list.
+
+* **Users Have Control** - *Terminal.Gui* provides default key bindings consistent with these tenets, but those defaults are configurable by the user. For example, `ConfigurationManager` allows users to redefine key bindings for the system, a user, or an application.
+
+* **More Editor than Command Line** - Once a *Terminal.Gui* app starts, the user is no longer using the command line. Users expect keyboard idioms in TUI apps to be consistent with GUI apps (such as VS Code, Vim, and Emacs). For example, in almost all GUI apps, `Ctrl-V` is `Paste`. But the Linux shells often use `Shift-Insert`. *Terminal.Gui* binds `Ctrl-V` by default.
+
+* **Be Consistent With the User's Platform** - Users get to choose the platform they run *Terminal.Gui* apps on and those apps should respond to keyboard input in a way that is consistent with the platform. For example, on Windows to erase a word to the left, users press `Ctrl-Backspace`. But on Linux, `Ctrl-W` is used.
+
+* **The Source of Truth is Wikipedia** - We use this [Wikipedia article](https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts) as our guide for default key bindings.
+
+
+
+Terminal.Gui supports two different layout systems, absolute and computed \
+(controlled by the [LayoutStyle](~/api/Terminal.Gui.LayoutStyle.yml)
+property on the view.
+
+The absolute system is used when you want the view to be positioned exactly in
+one location and want to manually control where the view is. This is done
+by invoking your View constructor with an argument of type [Rect](~/api/Terminal.Gui.Rect.yml). When you do this, to change the position of the View, you can change the `Frame` property on the View.
+
+The computed layout system offers a few additional capabilities, like automatic
+centering, expanding of dimensions and a handful of other features. To use
+this you construct your object without an initial `Frame`, but set the 
+ `X`, `Y`, `Width` and `Height` properties after the object has been created.
+
+Examples:
+
+```csharp
+
+// Dynamically computed
+var label = new Label ("Hello") {
+    X = 1,
+    Y = Pos.Center (),
+    Width = Dim.Fill (),
+    Height = 1
+};
+
+// Absolute position using the provided rectangle
+var label2 = new Label (new Rect (1, 2, 20, 1), "World")
+```
+
+The computed layout system does not take integers, instead the `X` and `Y` properties are of type [Pos](~/api/Terminal.Gui.Pos.yml) and the `Width` and `Height` properties are of type [Dim](~/api/Terminal.Gui.Dim.yml) both which can be created implicitly from integer values.
+
+### The `Pos` Type
+
+The `Pos` type on `X` and `Y` offers a few options:
+* Absolute position, by passing an integer
+* Percentage of the parent's view size - `Pos.Percent(n)`
+* Anchored from the end of the dimension - `AnchorEnd(int margin=0)`
+* Centered, using `Center()`
+* Reference the Left (X), Top (Y), Bottom, Right positions of another view
+
+The `Pos` values can be added or subtracted, like this:
+
+```csharp
+// Set the X coordinate to 10 characters left from the center
+view.X = Pos.Center () - 10;
+
+view.Y = Pos.Percent (20);
+
+anotherView.X = AnchorEnd (10);
+anotherView.Width = 9;
+
+myView.X = Pos.X (view);
+myView.Y = Pos.Bottom (anotherView);
+```
+
+### The `Dim` Type
+
+The `Dim` type is used for the `Width` and `Height` properties on the View and offers
+the following options:
+
+* Absolute size, by passing an integer
+* Percentage of the parent's view size - `Dim.Percent(n)`
+* Fill to the end - `Dim.Fill ()`
+* Reference the Width or Height of another view
+
+Like, `Pos`, objects of type `Dim` can be added an subtracted, like this:
+
+
+```csharp
+// Set the Width to be 10 characters less than filling 
+// the remaining portion of the screen
+view.Width = Dim.Fill () - 10;
+
+view.Height = Dim.Percent(20) - 1;
+
+anotherView.Height = Dim.Height (view)+1
+```