Skip to main content

NotificationModal class

Namespace: Arlecchino.Modals.Telling · Assembly: Arlecchino

One notification, read in full, with whatever the entry said could be done about it. The notifications screen opens it, so an application only fills in Notification.Detail and its actions.

public sealed class NotificationModal : Modal

Inherits from Modal

Constructors

MemberSummary
NotificationModal()

Properties

MemberSummary
ActionsWhat can be done about it. Empty for a message that is only to be read.
ChipsWhere each action was drawn last frame, filled in by the renderer, so a click can be resolved to the action under it.
EntryThe entry being read.
IndexWhich action is selected, moved with the left and right keys.
TextThe whole text, wrapped by the renderer to the width of the box.

Methods

MemberSummary
Draw(ModalFrame)
Handle(ModalFrame, KeyPress)The arrows walk its actions, confirming runs the one selected and canceling only closes. The dialog is closed before the action runs, so an action is free to open one of its own.
HandleMouse(ModalFrame, MouseEvent)
Move(int)Moves the selection along the actions, stopping at both ends.
Run()Runs the selected action, if there is one.

Constructors in detail

NotificationModal()

Obsolete

Constructors of types with required members are not supported in this version of your compiler.

public NotificationModal();

Properties in detail

Actions

public IReadOnlyList<NotificationAction> Actions { get; }

What can be done about it. Empty for a message that is only to be read.

Type IReadOnlyList<T><NotificationAction>

Chips

public IReadOnlyList<SurfaceRegion> Chips { get; set; }

Where each action was drawn last frame, filled in by the renderer, so a click can be resolved to the action under it.

Type IReadOnlyList<T><SurfaceRegion>

Entry

public Notification Entry { get; init; }

The entry being read.

Type Notification

Index

public int Index { get; set; }

Which action is selected, moved with the left and right keys.

Type int

Text

public string Text { get; }

The whole text, wrapped by the renderer to the width of the box.

Type string

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);

The arrows walk its actions, confirming runs the one selected and canceling only closes. The dialog is closed before the action runs, so an action is free to open one of its own.

Parameters

NameTypeDescription
frameModalFrameHow to close.
keyKeyPressThe key that arrived.

HandleMouse(ModalFrame, MouseEvent)

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

Parameters

NameTypeDescription
frameModalFrame
mouseMouseEvent

Move(int)

public void Move(int delta);

Moves the selection along the actions, stopping at both ends.

Parameters

NameTypeDescription
deltaintHow far to move; negative goes left.

Run()

public void Run();

Runs the selected action, if there is one.