Table of Contents

Class InlineButtonGroupWidget

Namespace
ItTiger.TigerCli.Tui.Widgets
Assembly
ItTiger.TigerCli.dll
A reusable horizontal row of buttons — the main reusable unit for message-box style button rows ([OK], [Yes] [No], [OK] [Cancel], [Abort] [Retry] [Ignore]).
public sealed class InlineButtonGroupWidget : InlineWidget, ICliRenderable
Inheritance
InlineButtonGroupWidget
Implements
Inherited Members

Remarks

Left/Right (and Home/End) move the active button across all buttons, including disabled ones, so a disabled button can be the active one. Enter/Spacebar activate the active button: an enabled button returns its DialogResultKind; a disabled button is consumed without a result (so the dialog does not fall back to Enter-confirm). Escape is intentionally left unhandled so the dialog's cancel fallback can fire.

Constructors

InlineButtonGroupWidget(ICliAppShell, IReadOnlyList<InlineButtonWidget>, int?)

Creates a horizontal group of buttons with one active button.
public InlineButtonGroupWidget(ICliAppShell shell, IReadOnlyList<InlineButtonWidget> buttons, int? activeIndex = null)

Parameters

shell ICliAppShell
The shell that supplies the theme and culture.
buttons IReadOnlyList<InlineButtonWidget>
The buttons to display, from left to right.
activeIndex int?
The initially active button index, or null for the first button.

Properties

ActiveButton

The active button, or null when the group is empty.
public InlineButtonWidget? ActiveButton { get; }

Property Value

InlineButtonWidget

ActiveIndex

The active button index, or -1 when the group is empty.
public int ActiveIndex { get; }

Property Value

int

Buttons

The buttons displayed by the group, from left to right.
public IReadOnlyList<InlineButtonWidget> Buttons { get; }

Property Value

IReadOnlyList<InlineButtonWidget>

Focusable

Whether the widget can receive focus. Non-focusable widgets are skipped by focus traversal.
public override bool Focusable { get; }

Property Value

bool

Hint

Optional focus-aware hint a composite control may surface to the dialog.
public override string? Hint { get; }

Property Value

string

Methods

HandleKey(KeyEvent)

Handles a key. Returns whether it was consumed and any requested dialog result.
public override InlineKeyResult HandleKey(KeyEvent key)

Parameters

key KeyEvent

Returns

InlineKeyResult

ToGrid()

Converts the component into a grid for measurement and rendering.
public override CliGrid ToGrid()

Returns

CliGrid