|
@@ -41,10 +41,10 @@ the various views 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 the
|
|
|
-[`Init`](/api/Terminal.Gui/Terminal.Gui.Application.html#Terminal_Gui_Application_Init) method in the Application class - this sets up the environment, initializes the color
|
|
|
+[`Init`](~/api/Terminal.Gui/Terminal.Gui.Application.yml#Terminal_Gui_Application_Init_Terminal_Gui_ConsoleDriver_Terminal_Gui_IMainLoopDriver_) 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.
|
|
|
|
|
|
-The [`Application`](/api/Terminal.Gui/Terminal.Gui.Application.html) class, additionally creates an instance of the [`Toplevel`](/api/Terminal.Gui/Terminal.Gui.Toplevel.html) class that is ready to be consumed,
|
|
|
+The [`Application`](~/api/Terminal.Gui/Terminal.Gui.Application.yml) class, additionally creates an instance of the [`Toplevel`](~/api/Terminal.Gui/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:
|
|
|
|
|
|
```csharp
|
|
@@ -103,13 +103,13 @@ Views
|
|
|
=====
|
|
|
|
|
|
All visible elements on a Terminal.Gui application are implemented as
|
|
|
-[Views](/api/Terminal.Gui/Terminal.Gui.View.html). Views are self-contained
|
|
|
+[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.
|
|
|
|
|
|
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/Terminal.Gui.View.html#Terminal_Gui_View_Add_Terminal_Gui_View_) method, for example, to add a couple of buttons to a UI, you can do this:
|
|
|
+[`Add`](~/api/Terminal.Gui/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:
|
|
|
|
|
|
```csharp
|
|
|
void SetupMyView (View myView)
|
|
@@ -137,18 +137,18 @@ View.
|
|
|
|
|
|
There are many views that you can use to spice up your application:
|
|
|
|
|
|
-[Buttons](/api/Terminal.Gui/Terminal.Gui.Button.html), [Labels](/api/Terminal.Gui/Terminal.Gui.Label.html), [Text entry](/api/Terminal.Gui/Terminal.Gui.TextField.html), [Text view](/api/Terminal.Gui/Terminal.Gui.TextView.html), [Radio buttons](/api/Terminal.Gui/Terminal.Gui.RadioGroup.html), [Checkboxes](/api/Terminal.Gui/Terminal.Gui.CheckBox.html), [Dialog boxes](/api/Terminal.Gui/Terminal.Gui.Dialog.html), [Message boxes](/api/Terminal.Gui/Terminal.Gui.MessageBox.html), [Windows](/api/Terminal.Gui/Terminal.Gui.Window.html), [Menus](/api/Terminal.Gui/Terminal.Gui.MenuBar.html), [ListViews](/api/Terminal.Gui/Terminal.Gui.ListView.html), [Frames](/api/Terminal.Gui/Terminal.Gui.FrameView.html), [ProgressBars](/api/Terminal.Gui/Terminal.Gui.ProgressBar.html), [Scroll views](/api/Terminal.Gui/Terminal.Gui.ScrollView.html) and [Scrollbars](/api/Terminal.Gui/Terminal.Gui.ScrollBarView.html).
|
|
|
+[Buttons](~/api/Terminal.Gui/Terminal.Gui.Button.yml), [Labels](~/api/Terminal.Gui/Terminal.Gui.Label.yml), [Text entry](~/api/Terminal.Gui/Terminal.Gui.TextField.yml), [Text view](~/api/Terminal.Gui/Terminal.Gui.TextView.yml), [Radio buttons](~/api/Terminal.Gui/Terminal.Gui.RadioGroup.yml), [Checkboxes](~/api/Terminal.Gui/Terminal.Gui.CheckBox.yml), [Dialog boxes](~/api/Terminal.Gui/Terminal.Gui.Dialog.yml), [Message boxes](~/api/Terminal.Gui/Terminal.Gui.MessageBox.yml), [Windows](~/api/Terminal.Gui/Terminal.Gui.Window.yml), [Menus](~/api/Terminal.Gui/Terminal.Gui.MenuBar.yml), [ListViews](~/api/Terminal.Gui/Terminal.Gui.ListView.yml), [Frames](~/api/Terminal.Gui/Terminal.Gui.FrameView.yml), [ProgressBars](~/api/Terminal.Gui/Terminal.Gui.ProgressBar.yml), [Scroll views](~/api/Terminal.Gui/Terminal.Gui.ScrollView.yml) and [Scrollbars](~/api/Terminal.Gui/Terminal.Gui.ScrollBarView.yml).
|
|
|
|
|
|
Layout
|
|
|
------
|
|
|
|
|
|
`Terminal.Gui` supports two different layout systems, absolute and computed \
|
|
|
-(controlled by the [`LayoutStyle`](/api/Terminal.Gui/Terminal.Gui.LayoutStyle.html)
|
|
|
+(controlled by the [`LayoutStyle`](~/api/Terminal.Gui/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/Terminal.Gui.Rect.html). When you do this, to change the
|
|
|
+by invoking your View constructor with an argument of type [`Rect`](~/api/Terminal.Gui/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
|
|
@@ -172,7 +172,7 @@ var label = new Label ("Hello") {
|
|
|
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/Terminal.Gui.Pos.html) and the `Width` and `Height` properties are of type [`Dim`](/api/Terminal.Gui/Terminal.Gui.Dim.html) both which can be created implicitly from integer values.
|
|
|
+The computed layout system does not take integers, instead the `X` and `Y` properties are of type [`Pos`](~/api/Terminal.Gui/Terminal.Gui.Pos.yml) and the `Width` and `Height` properties are of type [`Dim`](~/api/Terminal.Gui/Terminal.Gui.Dim.yml) both which can be created implicitly from integer values.
|
|
|
|
|
|
### The `Pos` Type
|
|
|
|
|
@@ -223,8 +223,8 @@ anotherView.Height = Dim.Height (view)+1
|
|
|
|
|
|
# TopLevels, Windows and Dialogs.
|
|
|
|
|
|
-Among the many kinds of views, you typically will create a [Toplevel](/api/Terminal.Gui/Terminal.Gui.Toplevel.html) view (or any of its subclasses,
|
|
|
-like [Window](/api/Terminal.Gui/Terminal.Gui.Window.html) or [Dialog](/api/Terminal.Gui/Terminal.Gui.Dialog.html) which is special kind of views
|
|
|
+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
|
|
|
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.
|
|
|
|
|
@@ -232,7 +232,7 @@ The following sections cover the differences.
|
|
|
|
|
|
## TopLevel Views
|
|
|
|
|
|
-[Toplevel](/api/Terminal.Gui/Terminal.Gui.Toplevel.html) views have no visible user interface elements and occupy an arbitrary portion of the screen.
|
|
|
+[Toplevel](~/api/Terminal.Gui/Terminal.Gui.Toplevel.yml) views have no visible user interface elements and occupy an arbitrary portion of the screen.
|
|
|
|
|
|
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:
|
|
@@ -284,21 +284,21 @@ class Demo {
|
|
|
Window Views
|
|
|
------------
|
|
|
|
|
|
-[Window](/api/Terminal.Gui/Terminal.Gui.Window.html) 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)
|
|
|
+[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
|
|
|
-------
|
|
|
|
|
|
-[Dialog](/api/Terminal.Gui/Terminal.Gui.Dialog.html) are [Window](/api/Terminal.Gui/Terminal.Gui.Window.html) objects that happen to be centered in the middle of the screen.
|
|
|
+[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.
|
|
|
|
|
|
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 are a subclass of `Window` and additionally expose the
|
|
|
-[`AddButton`](https://migueldeicaza.github.io/gui.cs/api/Terminal.Gui/Terminal.Gui.Dialog.html#Terminal_Gui_Dialog_AddButton_Terminal_Gui_Button_) API which manages the layout
|
|
|
+[`AddButton`](https://migueldeicaza.github.io/gui.cs/api/Terminal.Gui/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.
|
|
|
|
|
|
Example:
|
|
@@ -391,7 +391,7 @@ 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.
|
|
|
|
|
|
-The various styles are captured in the [`Colors`](/api/Terminal.Gui/Terminal.Gui.Colors.html) class which defined color schemes for
|
|
|
+The various styles are captured in the [`Colors`](~/api/Terminal.Gui/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:
|
|
|
|
|
|
* `Colors.Toplevel`
|
|
@@ -407,7 +407,7 @@ var w = new Window ("Hello");
|
|
|
w.ColorScheme = Colors.Error
|
|
|
```
|
|
|
|
|
|
-The [`ColorScheme`](/api/Terminal.Gui/Terminal.Gui.ColorScheme.html) represents
|
|
|
+The [`ColorScheme`](~/api/Terminal.Gui/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.
|
|
|
|
|
@@ -426,4 +426,4 @@ label.TextColor = myColor
|
|
|
MainLoop, Threads and Input Handling
|
|
|
====================================
|
|
|
|
|
|
-Detailed description of the mainloop is described on the [Event Processing and the Application Main Loop](/articles/mainloop.html) document.
|
|
|
+Detailed description of the mainloop is described on the [Event Processing and the Application Main Loop](~/articles/mainloop.md) document.
|