Table of Contents

Class MessageDialog

Namespace
MiniTui
Assembly
MiniTui.dll

A scrollable message, used by ShowMessageAsync(string, Text). Enter or Esc closes it.

public sealed class MessageDialog : Overlay
Inheritance
MessageDialog
Inherited Members

Constructors

MessageDialog(string, Text)

Create a dialog. Show it with Show(Overlay).

public MessageDialog(string title, Text body)

Parameters

title string
body Text

Properties

Closed

Completes when the dialog closes.

public Task Closed { get; }

Property Value

Task

HasSelection

True while the component has something selected to copy, such as a selectable ScrollState: Ctrl+C then goes to its HandleKey(ConsoleKeyInfo) instead of quitting, as it does for one that captures text.

public override bool HasSelection { get; }

Property Value

bool

Title

The title in the overlay's border.

public override string? Title { get; }

Property Value

string

Methods

HandleKey(ConsoleKeyInfo)

Handle a key before Keys. Return true if handled.

public override bool HandleKey(ConsoleKeyInfo key)

Parameters

key ConsoleKeyInfo

Returns

bool

HandleMouse(MouseEvent)

Handle a mouse event inside this component's Area (1.x spec §4.7). Return true if handled; otherwise the event goes on to the component's parent, and is dropped if nothing handles it. A press has already focused the component when this runs.

public override bool HandleMouse(MouseEvent mouse)

Parameters

mouse MouseEvent

Returns

bool

OnMount()

Called when the component is mounted, before its children.

protected override void OnMount()

OnUnmount()

Called when the component unmounts, after its children and after Lifetime is cancelled.

protected override void OnUnmount()

Placement(Rect)

Where the overlay goes, including its border. The default is centered, 60% × 50% of the screen, at least 30 × 7, and clamped to the screen minus a 2-cell margin.

public override Rect Placement(Rect screen)

Parameters

screen Rect

Returns

Rect

Render(Buffer, Rect, RenderContext)

Draw the component. Called every frame its parent renders it.

public override void Render(Buffer buf, Rect area, RenderContext ctx)

Parameters

buf Buffer
area Rect
ctx RenderContext