Skip to main content

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

MemberSummary
CommandModal()

Properties

MemberSummary
CommandsThe key and label of every command available in this context.
OnKeyWhat a key press means. Set by whoever opened the palette.
OnRowWhat a click on a row means. Set by whoever opened the palette.
RowsWhere the rows were drawn last frame, used to turn a click into a command.

Methods

MemberSummary
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

NameTypeDescription
frameModalFrame

Handle(ModalFrame, KeyPress)

public override void Handle(ModalFrame frame, KeyPress key);

Parameters

NameTypeDescription
frameModalFrame
keyKeyPress

HandleMouse(ModalFrame, MouseEvent)

public override void HandleMouse(ModalFrame frame, MouseEvent mouse);

Parameters

NameTypeDescription
frameModalFrame
mouseMouseEvent