CommandModal class
Namespace: Arlecchino.Modals.Choosing · Assembly: Arlecchino
The list of what can be pressed right now. It is a reminder rather than a menu, since the keys keep working while it is open and whoever opened it says what a press does.
public sealed class CommandModal : Modal
Inherits from Modal
Constructors
| Member | Summary |
|---|---|
CommandModal() |
Properties
| Member | Summary |
|---|---|
Commands | The key and label of every command available in this context. |
OnKey | What a key press means. Set by whoever opened the palette. |
OnRow | What a click on a row means. Set by whoever opened the palette. |
Rows | Where the rows were drawn last frame, used to turn a click into a command. |
Methods
| Member | Summary |
|---|---|
Draw(ModalFrame) | |
Handle(ModalFrame, KeyPress) | |
HandleMouse(ModalFrame, MouseEvent) |
Constructors in detail
CommandModal()
Obsolete
Constructors of types with required members are not supported in this version of your compiler.
public CommandModal();
Properties in detail
Commands
public IReadOnlyList<ValueTuple<string, string>> Commands { get; init; }
The key and label of every command available in this context.
Type IReadOnlyList<T><ValueTuple<T1, T2><string, string>>
OnKey
public Action<KeyPress>? OnKey { get; init; }
What a key press means. Set by whoever opened the palette.
Type Action<T><KeyPress>
OnRow
public Action<int>? OnRow { get; init; }
What a click on a row means. Set by whoever opened the palette.
Type Action<T><int>
Rows
public SurfaceRegion Rows { get; set; }
Where the rows were drawn last frame, used to turn a click into a command.
Type SurfaceRegion
Methods in detail
Draw(ModalFrame)
public override void Draw(ModalFrame frame);
Parameters
| Name | Type | Description |
|---|---|---|
frame | ModalFrame |
Handle(ModalFrame, KeyPress)
public override void Handle(ModalFrame frame, KeyPress key);
Parameters
| Name | Type | Description |
|---|---|---|
frame | ModalFrame | |
key | KeyPress |
HandleMouse(ModalFrame, MouseEvent)
public override void HandleMouse(ModalFrame frame, MouseEvent mouse);
Parameters
| Name | Type | Description |
|---|---|---|
frame | ModalFrame | |
mouse | MouseEvent |