Updates v1.7 docs (#1919)

* updated readmes

* Updated doc visual style & regenerated

* updated relnotes
This commit is contained in:
Tig Kindel
2022-07-28 09:31:26 -04:00
committed by GitHub
parent a713ae5f73
commit 7e2e7b9d2d
19 changed files with 225 additions and 112 deletions

View File

@@ -0,0 +1,8 @@
# Cross-Platform Driver Model
**Terminal.Gui** has support for [ncurses](https://github.com/gui-cs/Terminal.Gui/blob/master/Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs), [`System.Console`](https://github.com/gui-cs/Terminal.Gui/blob/master/Terminal.Gui/ConsoleDrivers/NetDriver.cs), and a full [Win32 Console](https://github.com/gui-cs/Terminal.Gui/blob/master/Terminal.Gui/ConsoleDrivers/WindowsDriver.cs) front-end.
`ncurses` is used on Mac/Linux/Unix with color support based on what your library is compiled with; the Windows driver supports full color and mouse, and an easy-to-debug `System.Console` can be used on Windows and Unix, but lacks mouse support.
You can force the use of `System.Console` on Unix as well; see `Core.cs`.

View File

@@ -4,5 +4,6 @@
* [List of Views](views.md)
* [Keyboard Event Processing](keyboard.md)
* [Event Processing and the Application Main Loop](mainloop.md)
* [Cross-platform Driver Model](drivers.md)
* [TableView Deep Dive](tableview.md)
* [TreeView Deep Dive](treeview.md)

View File

@@ -1,6 +1,18 @@
Keyboard Event Processing
=========================
**Terminal.Gui** respects common Linux, Mac, and Windows keyboard idioms. For example, clipboard operations use the familiar `Control/Command-C, X, V` model. `CTRL-Q` is used for exiting views (and apps).
The input handling of **Terminal.Gui** is similar in some ways to Emacs and the Midnight Commander, so you can expect some of the special key combinations to be active.
The key `ESC` can act as an Alt modifier (or Meta in Emacs parlance), to allow input on terminals that do not have an alt key. So to produce the sequence `Alt-F`, you can press either `Alt-F`, or `ESC` followed by the key `F`.
To enter the key `ESC`, you can either press `ESC` and wait 100 milliseconds, or you can press `ESC` twice.
`ESC-0`, and `ESC-1` through `ESC-9` have a special meaning, they map to `F10`, and `F1` to `F9` respectively.
Apps can change key bindings using the `AddKeyBinding` API.
Keyboard events are sent by the [Main Loop](mainloop.md) to the
Application class for processing. The keyboard events are sent
exclusively to the current `Toplevel`, this being either the default

View File

@@ -1,5 +1,6 @@
Event Processing and the Application Main Loop
==============================================
# Event Processing and the Application Main Loop
_See also [Cross-platform Driver Model](drivers.md)_
The method `Application.Run` that we covered before will wait for
events from either the keyboard or mouse and route those events to the
@@ -41,7 +42,6 @@ The keyboard inputs is dispatched by the application class to the
current TopLevel window this is covered in more detail in the
[Keyboard Event Processing](keyboard.md) document.
Async Execution
---------------

View File

@@ -102,8 +102,7 @@ class Demo {
}
```
Views
=====
## Views
All visible elements on a Terminal.Gui application are implemented as
[Views](~/api/Terminal.Gui/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.
@@ -138,8 +137,7 @@ void SetupMyView (View myView)
The container of a given view is called the `SuperView` and it is a property of every
View.
Layout
------
## Layout
`Terminal.Gui` supports two different layout systems, absolute and computed \
(controlled by the [`LayoutStyle`](~/api/Terminal.Gui/Terminal.Gui.LayoutStyle.yml)
@@ -220,7 +218,7 @@ view.Height = Dim.Percent(20) - 1;
anotherView.Height = Dim.Height (view)+1
```
# TopLevels, Windows and Dialogs.
## TopLevels, Windows and Dialogs.
Among the many kinds of views, you typically will create a [Toplevel](~/api/Terminal.Gui/Terminal.Gui.Toplevel.yml) view (or any of its subclasses,
like [Window](~/api/Terminal.Gui/Terminal.Gui.Window.yml) or [Dialog](~/api/Terminal.Gui/Terminal.Gui.Dialog.yml) which is special kind of views
@@ -229,7 +227,7 @@ only when the user chooses to complete their work there.
The following sections cover the differences.
## TopLevel Views
### TopLevel Views
[Toplevel](~/api/Terminal.Gui/Terminal.Gui.Toplevel.yml) views have no visible user interface elements and occupy an arbitrary portion of the screen.
@@ -281,15 +279,13 @@ class Demo {
}
```
Window Views
------------
### Window Views
[Window](~/api/Terminal.Gui/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.
Dialogs
-------
### Dialogs
[Dialog](~/api/Terminal.Gui/Terminal.Gui.Dialog.yml) are [Window](~/api/Terminal.Gui/Terminal.Gui.Window.yml) objects that happen to be centered in the middle of the screen.
@@ -318,8 +314,7 @@ Which will show something like this:
+------------------------------------------------------+
```
Running Modally
---------------
### 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.
@@ -350,8 +345,7 @@ There is no return value from running modally, so your code will need to have a
of indicating the reason that the execution of the modal dialog was completed, in the
case above, the `okpressed` value is set to true if the user pressed or selected the Ok button.
Input Handling
==============
## Input Handling
Every view has a focused view, and if that view has nested views, one of those is
the focused view. This is called the focus chain, and at any given time, only one
@@ -385,8 +379,7 @@ to background views when a modal view is running.
More details are available on the [`Keyboard Event Processing`](keyboard.md) document.
Colors and Color Schemes
========================
## Colors and Color Schemes
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.
@@ -423,7 +416,10 @@ var label = new Label (...);
label.TextColor = myColor
```
MainLoop, Threads and Input Handling
====================================
## MainLoop, Threads and Input Handling
Detailed description of the mainloop is described on the [Event Processing and the Application Main Loop](~/articles/mainloop.md) document.
## Cross-Platform Drivers
See [Cross-platform Driver Model](drivers.md).

View File

@@ -13,6 +13,7 @@ A toolkit for building rich console apps for .NET, .NET Core, and Mono that work
* [Terminal.Gui API Overview](~/articles/overview.md)
* [Keyboard Event Processing](~/articles/keyboard.md)
* [Event Processing and the Application Main Loop](~/articles/mainloop.md)
* [Cross-platform Driver Model](~/articles/drivers.md)
* [TableView Deep Dive](~/articles/tableview.md)
* [TreeView Deep Dive](~/articles/treeview.md)

View File

@@ -29,7 +29,7 @@ code,kbd,pre,samp{
button,
a {
color: var(--highlight-dark);
color: var(--highlight-light);
cursor: pointer;
}