ModalFrame class
Namespace: Arlecchino.Modals · Assembly: Arlecchino
Everything a dialog needs from the application: where to draw, the words to draw in, the keys to obey, and how to close. A dialog is a value, so it is given these when asked to act.
public sealed class ModalFrame
Properties
| Member | Summary |
|---|---|
Depth | How many dialogs are already open under this one. Each is offset a row down and three columns along, so a dialog opened from a dialog reads as being on top of it rather than instead of it. |
Height | How many rows tall. |
Keymap | Keys to obey. |
Keys | Turns a key press into the character it stands for. |
Screen | The whole screen, for a dialog that would rather place itself. |
Strings | The words the application says things in. |
Width | How many cells wide the frame is. |
Methods
| Member | Summary |
|---|---|
Box(string, IReadOnlyList<Piece[]>, string) | Draws a titled box holding the lines given, with the hints under a rule. Every dialog the framework brings is drawn through this. |
Centered(int, int) | A box of the size asked for, in the middle of the screen and never off the edge of it. |
Close() | Closes the dialog on top, which while it is being handled is this one. |
Copy(string) | Puts text on the clipboard, for the dialogs that offer copying. |
Divider(SurfaceRegion, int) | The rule that separates the body of a dialog from its hints. |
Properties in detail
Depth
public int Depth { get; }
How many dialogs are already open under this one. Each is offset a row down and three columns along, so a dialog opened from a dialog reads as being on top of it rather than instead of it.
Type int
Height
public int Height { get; }
How many rows tall.
Type int
Keymap
public ArlecchinoKeymap Keymap { get; }
Keys to obey.
Type ArlecchinoKeymap
Keys
public KeyText Keys { get; }
Turns a key press into the character it stands for.
Type KeyText
Screen
public SurfaceRegion Screen { get; }
The whole screen, for a dialog that would rather place itself.
Type SurfaceRegion
Strings
public ArlecchinoStrings Strings { get; }
The words the application says things in.
Type ArlecchinoStrings
Width
public int Width { get; }
How many cells wide the frame is.
Type int
Methods in detail
Box(string, IReadOnlyList<Piece[]>, string)
public ValueTuple<SurfaceRegion, SurfaceRegion> Box(
string title,
IReadOnlyList<Piece[]> body,
string footer);
Draws a titled box holding the lines given, with the hints under a rule. Every dialog the framework brings is drawn through this.
Parameters
| Name | Type | Description |
|---|---|---|
title | string | What the dialog is called. |
body | IReadOnlyList<T><Piece[]> | The lines, each a run of pieces. |
footer | string | What the keys do, along the bottom. |
Returns ValueTuple<T1, T2><SurfaceRegion, SurfaceRegion> — The whole box, and the region inside it the lines were written in.
Centered(int, int)
public SurfaceRegion Centered(int contentWidth, int contentHeight);
A box of the size asked for, in the middle of the screen and never off the edge of it.
Parameters
| Name | Type | Description |
|---|---|---|
contentWidth | int | How wide what goes in it is. |
contentHeight | int | How tall. |
Returns SurfaceRegion — Where the box goes.
Close()
public void Close();
Closes the dialog on top, which while it is being handled is this one.
Copy(string)
public void Copy(string text);
Puts text on the clipboard, for the dialogs that offer copying.
Parameters
| Name | Type | Description |
|---|---|---|
text | string | What to copy. |
Divider(SurfaceRegion, int)
public static void Divider(SurfaceRegion box, int insideRow);
The rule that separates the body of a dialog from its hints.
Parameters
| Name | Type | Description |
|---|---|---|
box | SurfaceRegion | The whole box, border included. |
insideRow | int | Which row inside the box it goes under. |