IArlecchinoView interface
Namespace: Arlecchino.Navigation · Assembly: Arlecchino
A screen, built from the container and living as long as its route is shown. Implement IDisposable to be told when it goes away.
public interface IArlecchinoView
Properties
| Member | Summary |
|---|---|
Focus | What holds the focus inside this screen, normally the FocusRing the view built. It puts the keys of the focused widget at the top of the hints box, and keeps them in step as Tab moves. |
IsTyping | Whether something on this screen is being typed into. The keys a text field edits by are left to the screen while it is, rather than moving the application about behind the caret. |
UsesLayout | Whether the IArlecchinoLayout is drawn around this screen, where the application has one. Answer false for a screen that wants the whole terminal. |
Methods
| Member | Summary |
|---|---|
Commands() | Keys this screen reacts to, declared as data. They are checked before IArlecchinoView.Handle, listed in the command palette, and checked for conflicts with application commands. |
Draw() | Draws the screen. Called once per frame against the shared surface. |
Handle(KeyPress) | Handles a key the router did not claim: typing, arrows, list filters. Keys that belong to a command should be declared in IArlecchinoView.Commands instead. |
HandleMouse(MouseEvent) | Handles a mouse event in frame coordinates. Only views that care about the mouse implement this. |
HandlePaste(string) | Handles text pasted into the terminal. It arrives as one block however long it is, so a screen that takes typed input should take this too rather than leaving pastes on the floor. |
Hints() | What the hints box shows. Leave it empty and the box is built from IArlecchinoView.Commands, so a rebound key relabels itself. |
Properties in detail
Focus
public IArlecchinoFocusable? Focus { get; }
What holds the focus inside this screen, normally the FocusRing the view built. It puts the keys of the focused widget at the top of the hints box, and keeps them in step as Tab moves.
Type IArlecchinoFocusable
IsTyping
public bool IsTyping { get; }
Whether something on this screen is being typed into. The keys a text field edits by are left to the screen while it is, rather than moving the application about behind the caret.
Type bool
UsesLayout
public bool UsesLayout { get; }
Whether the IArlecchinoLayout is drawn around this screen, where the application has one. Answer false for a screen that wants the whole terminal.
Type bool
Methods in detail
Commands()
public IReadOnlyList<ViewCommand> Commands();
Keys this screen reacts to, declared as data. They are checked before IArlecchinoView.Handle, listed in the command palette, and checked for conflicts with application commands.
Returns IReadOnlyList<T><ViewCommand> — The commands of this screen.
Draw()
public void Draw();
Draws the screen. Called once per frame against the shared surface.
Handle(KeyPress)
public ViewRoute Handle(KeyPress key);
Handles a key the router did not claim: typing, arrows, list filters. Keys that belong to a command should be declared in IArlecchinoView.Commands instead.
Parameters
| Name | Type | Description |
|---|---|---|
key | KeyPress | The key that was pressed. |
Returns ViewRoute — A route to navigate to, or ViewRoute.None to stay.
HandleMouse(MouseEvent)
public ViewRoute HandleMouse(MouseEvent mouse);
Handles a mouse event in frame coordinates. Only views that care about the mouse implement this.
Parameters
| Name | Type | Description |
|---|---|---|
mouse | MouseEvent | The event, with coordinates as frame cells. |
Returns ViewRoute — A route to navigate to, or ViewRoute.None to stay.
HandlePaste(string)
public ViewRoute HandlePaste(string text);
Handles text pasted into the terminal. It arrives as one block however long it is, so a screen that takes typed input should take this too rather than leaving pastes on the floor.
Parameters
| Name | Type | Description |
|---|---|---|
text | string | What was pasted, with the terminal's markers already stripped. |
Returns ViewRoute — A route to navigate to, or ViewRoute.None to stay.
Hints()
public virtual ValueTuple<string, string>[] Hints();
What the hints box shows. Leave it empty and the box is built from IArlecchinoView.Commands, so a rebound key relabels itself.
Returns ValueTuple<T1, T2><string, string>[] — Pairs of key and description.