Modal class
Namespace: Arlecchino.Modals · Assembly: Arlecchino
A dialog waiting for an answer, assigned to ArlecchinoState.Modal. It draws itself and reads its own keys, so a kind an application writes is another subclass and nothing more.
public abstract class Modal
Derived types NumericModal, TextAreaModal, TextModal, CommandModal, OptionListModal, ColorModal, SegmentedModal, ToggleModal, MessageModal, NotificationModal
Constructors
| Member | Summary |
|---|---|
Modal() |
Properties
| Member | Summary |
|---|---|
Box | Where the box was drawn last frame. Set as the dialog draws itself, and used to tell a click on it from a click outside. |
Title | Title written into the top edge of the box. |
Typing | The line this dialog is being typed into now, or nothing while it is not being typed into at all. Naming it is all a dialog has to do to be pasted into. |
Methods
| Member | Summary |
|---|---|
Draw(ModalFrame) | Draws it. |
Handle(ModalFrame, KeyPress) | Reads one key, which reaches no one else while this dialog is on top. |
HandleMouse(ModalFrame, MouseEvent) | Reads one mouse event. Dialogs that cannot be clicked leave it alone. |
HandlePaste(ModalFrame, string) | Takes a block of pasted text, which lands in Modal.Typing as one edit. A dialog of several rows overrides this; one of a single row has nothing to add. |
Constructors in detail
Modal()
Constructors of types with required members are not supported in this version of your compiler.
public Modal();
Properties in detail
Box
public SurfaceRegion Box { get; set; }
Where the box was drawn last frame. Set as the dialog draws itself, and used to tell a click on it from a click outside.
Type SurfaceRegion
Title
public string Title { get; init; }
Title written into the top edge of the box.
Type string
Typing
public virtual ITextEntry? Typing { get; }
The line this dialog is being typed into now, or nothing while it is not being typed into at all. Naming it is all a dialog has to do to be pasted into.
Type ITextEntry
Methods in detail
Draw(ModalFrame)
public abstract void Draw(ModalFrame frame);
Draws it.
Parameters
| Name | Type | Description |
|---|---|---|
frame | ModalFrame | Where to draw, and the words to draw in. |
Handle(ModalFrame, KeyPress)
public abstract void Handle(ModalFrame frame, KeyPress key);
Reads one key, which reaches no one else while this dialog is on top.
Parameters
| Name | Type | Description |
|---|---|---|
frame | ModalFrame | The keys to obey, and how to close. |
key | KeyPress | The key that arrived. |
HandleMouse(ModalFrame, MouseEvent)
public virtual void HandleMouse(ModalFrame frame, MouseEvent mouse);
Reads one mouse event. Dialogs that cannot be clicked leave it alone.
Parameters
| Name | Type | Description |
|---|---|---|
frame | ModalFrame | The keys to obey, and how to close. |
mouse | MouseEvent | The event that arrived. |
HandlePaste(ModalFrame, string)
public virtual void HandlePaste(ModalFrame frame, string text);
Takes a block of pasted text, which lands in Modal.Typing as one edit. A dialog of several rows overrides this; one of a single row has nothing to add.
Parameters
| Name | Type | Description |
|---|---|---|
frame | ModalFrame | The keys to obey, and how to close. |
text | string | What was pasted, with the terminal's markers already stripped. |