mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Fix typos
This commit is contained in:
@@ -33,12 +33,14 @@ The `UI Catalog` application provides an example of how to use the [`Configurati
|
||||
(Note, this list may not be complete; search the source code for `SerializableConfigurationProperty` to find all settings that can be configured.)
|
||||
|
||||
* [Application.QuitKey](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_QuitKey)
|
||||
* [Application.AlternateForwardKey](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_AlternateForwardKey)
|
||||
* [Application.AlternateBackwardKey](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_AlternateBackwardKey)
|
||||
* [Application.UseSystemConsole](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_UseSystemConsole)
|
||||
* [Application.NextTabKey](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_NextTabKey)
|
||||
* [Application.PrevTabKey](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_PrevTabKey)
|
||||
* [Application.NextTabGroupKey](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_NextTabGroupKey)
|
||||
* [Application.PrevTabGroupKey](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_PrevTabGroupKey)
|
||||
* [Application.ForceDriver](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_ForceDriver)
|
||||
* [Application.Force16Colors](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_Force16Colors)
|
||||
* [Application.IsMouseDisabled](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_IsMouseDisabled)
|
||||
* [Application.EnableConsoleScrolling](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_EnableConsoleScrolling)
|
||||
|
||||
|
||||
## Glyphs
|
||||
|
||||
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.
|
||||
|
||||
@@ -6,21 +6,28 @@
|
||||
|
||||
* **[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.
|
||||
* **[Extensible UI](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.
|
||||
* **[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.
|
||||
* **[Powerful Layout Engine](layout.md)** - The layout engine makes it easy to lay out controls relative to each other and enables dynamic terminal UIs.
|
||||
* **[Machine, User, and App-Level Configuration](configuration.md)** - Persistent configuration settings, including overriding default look & feel with Themes, keyboard bindings, and more via the [`ConfigurationManager`](~/api/Terminal.Gui.ConfigurationManager.yml) class.
|
||||
* **[Clipboard support](https://gui-cs.github.io/Terminal.GuiV2Docs/api/Terminal.Gui.Clipboard.html)** - Cut, Copy, and Paste is provided through the [`Clipboard`] class.
|
||||
* **Multi-tasking** - 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.
|
||||
|
||||
See [What's New in V2 For more](newinv2.md).
|
||||
|
||||
## Conceptual Documentation
|
||||
|
||||
* [Guide to Migrating from Terminal.Gui v1](migratingfromv1.md)
|
||||
* [List of Views](views.md)
|
||||
* [Layout Engine](layout.md)
|
||||
* [Navigation](navigation.md)
|
||||
* [Keyboard API](keyboard.md)
|
||||
* [Mouse API](mouse.md)
|
||||
* [Configuration and Theme Manager](config.md)
|
||||
* [Multi-tasking and the Application Main Loop](mainloop.md)
|
||||
* [Cross-platform Driver Model](drivers.md)
|
||||
* [Configuration and Theme Manager](config.md)
|
||||
* [Dim.Auto Deep Dive](dimauto.md)
|
||||
* [TableView Deep Dive](tableview.md)
|
||||
* [TreeView Deep Dive](treeview.md)
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ 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.
|
||||
* **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.
|
||||
* **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.
|
||||
|
||||
@@ -27,31 +27,33 @@ See [Key](~/api/Terminal.Gui.Key.yml) for more details.
|
||||
|
||||
### **[Key Bindings](~/api/Terminal.Gui.KeyBindings.yml)**
|
||||
|
||||
The default key for activating a button is `Space`. You can change this using
|
||||
`Keybindings.Clear` and `Keybinding.Add` methods:
|
||||
The default key for activating a button is `Space`. You can change this using
|
||||
`KeyBindings.ReplaceKey()`:
|
||||
|
||||
```csharp
|
||||
var btn = new Button ("Press Me");
|
||||
btn.Keybinding.Remove (Command.Accept);
|
||||
btn.KeyBinding.Add (Key.B, Command.Accept);
|
||||
var btn = new Button () { Title = "Press me" };
|
||||
btn.KeyBindings.ReplaceKey (btn.KeyBindings.GetKeyFromCommands (Command.Accept));
|
||||
```
|
||||
|
||||
The [Command](~/api/Terminal.Gui.Command.yml) enum lists generic operations that are implemented by views. For example `Command.Accept` in a `Button` results in the `Clicked` event
|
||||
firing while in `TableView` it is bound to `CellActivated`. Not all commands
|
||||
are implemented by all views (e.g. you cannot scroll in a `Button`). Use the `GetSupportedCommands()` method to determine which commands are implemented by a `View`.
|
||||
|
||||
Key Bindings can be added at the `Application` or `View` level. For Application-scoped Key Bindings see [ApplicationNavigation](~/api/Terminal.Gui.ApplicationNavigation.yml). For View-scoped Key Bindings see [Key Bindings](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_KeyBinings).
|
||||
|
||||
### **[HotKey](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_HotKey)**
|
||||
|
||||
A **HotKey** is a keypress that selects a visible UI item. For selecting items across `View`s (e.g. a `Button` in a `Dialog`) the keypress must have the `Alt` modifier. For selecting items within a `View` that are not `View`s themselves, the keypress can be key without the `Alt` modifier. For example, in a `Dialog`, a `Button` with the text of "_Text" can be selected with `Alt-T`. Or, in a `Menu` with "_File _Edit", `Alt-F` will select (show) the "_File" menu. If the "_File" menu has a sub-menu of "_New" `Alt-N` or `N` will ONLY select the "_New" sub-menu if the "_File" menu is already opened.
|
||||
A **HotKey** is a key press that selects a visible UI item. For selecting items across `View`s (e.g. a `Button` in a `Dialog`) the key press must have the `Alt` modifier. For selecting items within a `View` that are not `View`s themselves, the key press can be key without the `Alt` modifier. For example, in a `Dialog`, a `Button` with the text of "_Text" can be selected with `Alt+T`. Or, in a `Menu` with "_File _Edit", `Alt+F` will select (show) the "_File" menu. If the "_File" menu has a sub-menu of "_New" `Alt+N` or `N` will ONLY select the "_New" sub-menu if the "_File" menu is already opened.
|
||||
|
||||
By default, the `Text` of a `View` is used to determine the `HotKey` by looking for the first occurrence of the [HotKeySpecifier](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_HotKeySpecifier) (which is underscore (`_`) by default). The character following the underscore is the `HotKey`. If the `HotKeySpecifier` is not found in `Text`, the first character of `Text` is used as the `HotKey`. The `Text` of a `View` can be changed at runtime, and the `HotKey` will be updated accordingly. [HotKey](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_HotKey) is `virtual` enabling this behavior to be customized.
|
||||
|
||||
### **[Shortcut](~/api/Terminal.Gui.Shortcut.yml) - An opinionated (visually & API) View for displaying a command, helptext, key.
|
||||
**
|
||||
### **[Shortcut](~/api/Terminal.Gui.Shortcut.yml)**
|
||||
|
||||
A **Shortcut** is a keypress that invokes a [Command](~/api/Terminal.Gui.Command.yml) or `View`-defined action even if the `View` that defines them is not focused or visible (but the `View` must be enabled). Shortcuts can be any keypress; `Key.A`, `Key.A | Key.Ctrl`, `Key.A | Key.Ctrl | Key.Alt`, `Key.Del`, and `Key.F1`, are all valid.
|
||||
A **Shortcut** is an opinionated (visually & API) View for displaying a command, help text, key key press that invokes a [Command](~/api/Terminal.Gui.Command.yml).
|
||||
|
||||
`Shortcuts` are used to define application-wide actions (e.g. `Quit`), or actions that are not visible (e.g. `Copy`).
|
||||
The Command can be invoked even if the `View` that defines them is not focused or visible (but the `View` must be enabled). Shortcuts can be any key press; `Key.A`, `Key.A.WithCtrl`, `Key.A.WithCtrl.WithAlt`, `Key.Del`, and `Key.F1`, are all valid.
|
||||
|
||||
`Shortcuts` are used to define application-wide actions or actions that are not visible (e.g. `Copy`).
|
||||
|
||||
[MenuBar](~/api/Terminal.Gui.MenuBar.yml), [ContextMenu](~/api/Terminal.Gui.ContextMenu.yml), and [StatusBar](~/api/Terminal.Gui.StatusBar.yml) support `Shortcut`s.
|
||||
|
||||
@@ -65,14 +67,14 @@ to the [Application](~/api/Terminal.Gui.Application.yml) class by the [Main Loop
|
||||
|
||||
If the view is enabled, the [NewKeyDownEvent](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_NewKeyDownEvent_Terminal_Gui_Key_) method will do the following:
|
||||
|
||||
1) If the view has a subview that has focus, 'ProcessKeyDown' on the focused view will be called. If the focused view handles the keypress, processing stops.
|
||||
2) If there is no focused sub-view, or the focused sub-view does not handle the keypress, [OnKeyDown](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_OnKeyDown_Terminal_Gui_Key_) will be called. If the view handles the keypress, processing stops.
|
||||
3) If the view does not handle the keypress, [OnInvokingKeyBindings](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_OnInvokingKeyBindings_Terminal_Gui_Key_) will be called. This method calls[InvokeKeyBindings](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_InvokeKeyBindings_Terminal_Gui_Key_) to invoke any keys bound to commands. If the key is bound and any of it's command handlers return true, processing stops.
|
||||
4) If the key is not bound, or the bound command handlers do not return true, [OnProcessKeyDow](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_OnProcessKeyDown_Terminal_Gui_Key_) is called. If the view handles the keypress, processing stops.
|
||||
1) If the view has a subview that has focus, 'ProcessKeyDown' on the focused view will be called. If the focused view handles the key press, processing stops.
|
||||
2) If there is no focused sub-view, or the focused sub-view does not handle the key press, [OnKeyDown](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_OnKeyDown_Terminal_Gui_Key_) will be called. If the view handles the key press, processing stops.
|
||||
3) If the view does not handle the key press, [OnInvokingKeyBindings](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_OnInvokingKeyBindings_Terminal_Gui_Key_) will be called. This method calls[InvokeKeyBindings](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_InvokeKeyBindings_Terminal_Gui_Key_) to invoke any keys bound to commands. If the key is bound and any of it's command handlers return true, processing stops.
|
||||
4) If the key is not bound, or the bound command handlers do not return true, [OnProcessKeyDow](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_OnProcessKeyDown_Terminal_Gui_Key_) is called. If the view handles the key press, processing stops.
|
||||
|
||||
## **[Global Key Handling](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_OnKeyDown_Terminal_Gui_Key_)**
|
||||
## **[Application Key Handling](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_OnKeyDown_Terminal_Gui_Key_)**
|
||||
|
||||
To define global key handling logic for an entire application in cases where the methods listed above are not suitable, use the `Application.OnKeyDown` event.
|
||||
To define application key handling logic for an entire application in cases where the methods listed above are not suitable, use the `Application.OnKeyDown` event.
|
||||
|
||||
## **[Key Down/Up Events](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_KeyDown)**
|
||||
|
||||
@@ -109,6 +111,7 @@ To define global key handling logic for an entire application in cases where the
|
||||
## Application
|
||||
|
||||
* Implements support for `KeyBindingScope.Application`.
|
||||
* Exposes [Application.KeyBindings](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_KeyBindings_).
|
||||
* Exposes cancelable `KeyDown/Up` events (via `Handled = true`). The `OnKey/Down/Up/` methods are public and can be used to simulate keyboard input.
|
||||
|
||||
## View
|
||||
|
||||
@@ -5,7 +5,7 @@ Terminal.Gui provides a rich system for how `View` objects are laid out relative
|
||||
## Coordinates
|
||||
|
||||
* **Screen-Relative** - Describes the dimensions and characteristics of the underlying terminal. Currently Terminal.Gui only supports applications that run "full-screen", meaning they fill the entire terminal when running. As the user resizes their terminal, the `Screen` changes size and the applicaiton will be resized to fit. *Screen-Relative* means an origin (`0, 0`) at the top-left corner of the terminal. `ConsoleDriver`s operate exclusively on *Screen-Relative* coordinates.
|
||||
* **Application.Relative** - The dimensions and characteristics of the application. Because only full-screen apps are currently supported, `Application` is effectively the same as `Screen` from a layout perspective. *Application-Relative* currently means an origin (`0, 0`) at the top-left corner of the terminal. `Applicaiton.Top` is a `View` with a top-left corner fixed at the *Application.Relative* coordinate of (`0, 0`) and is the size of `Screen`.
|
||||
* **Application-Relative** - The dimensions and characteristics of the application. Because only full-screen apps are currently supported, `Application` is effectively the same as `Screen` from a layout perspective. *Application-Relative* currently means an origin (`0, 0`) at the top-left corner of the terminal. `Applicaiton.Top` is a `View` with a top-left corner fixed at the *Application.Relative* coordinate of (`0, 0`) and is the size of `Screen`.
|
||||
* **Frame-Relative** - The `Frame` property of a `View` is a rectangle that describes the current location and size of the view relative to the `Superview`'s content area. *Frame-Relative* means a coordinate is relative to the top-left corner of the View in question. `View.FrameToScreen ()` and `View.ScreenToFrame ()` are helper methods for translating a *Frame-Relative* coordinate to a *Screen-Relative* coordinate and vice-versa.
|
||||
* **Content-Relative** - A rectangle, with an origin of (`0, 0`) and size (defined by `View.GetContentSize()`) where the View's content exists. *Content-Relative* means a coordinate is relative to the top-left corner of the content, which is always (`0,0`). `View.ContentToScreen ()` and `View.ScreenToContent ()` are helper methods for translating a *Content-Relative* coordinate to a *Screen-Relative* coordinate and vice-versa.
|
||||
* **Viewport-Relative** - A *Content-Relative* rectangle representing the subset of the View's content that is visible to the user. If `View.GetContentSize()` is larger than the Viewport, scrolling is enabled. *Viewport-Relative* means a coordinate that is bound by (`0,0`) and the size of the inner-rectangle of the View's `Padding`. The View drawing primitives (e.g. `View.Move`) take *Viewport-Relative* coordinates; `Move (0, 0)` means the `Cell` in the top-left corner of the inner rectangle of `Padding`. `View.ViewportToScreen ()` and `View.ScreenToViewport ()` are helper methods for translating a *Viewport-Relative* coordinate to a *Screen-Relative* coordinate and vice-versa. To convert a *Viewport-Relative* coordinate to a *Content-Relative* coordinate, simply subtract `Viewport.X` and/or `Viewport.Y` from the *Content-Relative* coordinate. To convert a *Viewport-Relative* coordinate to a *Frame-Relative* coordinate, subtract the point returned by `View.GetViewportOffsetFromFrame`.
|
||||
|
||||
@@ -4,24 +4,28 @@
|
||||
href: getting-started.md
|
||||
- name: What's new in v2
|
||||
href: newinv2.md
|
||||
- name: v1 To v2 Migration Guide
|
||||
- name: v1 To v2 Migration
|
||||
href: migratingfromv1.md
|
||||
- name: List of Views
|
||||
href: views.md
|
||||
- name: Layout Engine
|
||||
href: layout.md
|
||||
- name: Navigation
|
||||
href: navigation.md
|
||||
- name: Keyboard
|
||||
href: keyboard.md
|
||||
- name: Mouse
|
||||
href: mouse.md
|
||||
- name: Configuration
|
||||
href: config.md
|
||||
- name: Drawing (Text, Lines, and Color)
|
||||
- name: Drawing
|
||||
href: drawing.md
|
||||
- name: Cross-platform Driver Model
|
||||
- name: Drivers
|
||||
href: drivers.md
|
||||
- name: Keyboard Event Processing
|
||||
href: keyboard.md
|
||||
- name: Mouse Event Processing
|
||||
href: mouse.md
|
||||
- name: The View Layout Engine
|
||||
href: layout.md
|
||||
- name: Mutli-Tasking and Application Main Loop
|
||||
- name: Multi-Tasking
|
||||
href: mainloop.md
|
||||
- name: Dim.Auto Deep Dive
|
||||
href: dimauto.md
|
||||
- name: TableView Deep Dive
|
||||
href: tableview.md
|
||||
- name: TreeView Deep Dive
|
||||
|
||||
Reference in New Issue
Block a user