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
| Member | Summary |
|---|---|
NotificationModal() |
Properties
| Member | Summary |
|---|---|
Actions | What can be done about it. Empty for a message that is only to be read. |
Chips | Where each action was drawn last frame, filled in by the renderer, so a click can be resolved to the action under it. |
Entry | The entry being read. |
Index | Which action is selected, moved with the left and right keys. |
Text | The whole text, wrapped by the renderer to the width of the box. |
Methods
| Member | Summary |
|---|---|
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()
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
| Name | Type | Description |
|---|---|---|
frame | ModalFrame |
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
| Name | Type | Description |
|---|---|---|
frame | ModalFrame | How to close. |
key | KeyPress | The key that arrived. |
HandleMouse(ModalFrame, MouseEvent)
public override void HandleMouse(ModalFrame frame, MouseEvent mouse);
Parameters
| Name | Type | Description |
|---|---|---|
frame | ModalFrame | |
mouse | MouseEvent |
Move(int)
public void Move(int delta);
Moves the selection along the actions, stopping at both ends.
Parameters
| Name | Type | Description |
|---|---|---|
delta | int | How far to move; negative goes left. |
Run()
public void Run();
Runs the selected action, if there is one.