Table of Contents

Class InlineTextInputWidget

Namespace
ItTiger.TigerCli.Tui.Widgets
Assembly
ItTiger.TigerCli.dll
A reusable editable single-line text input widget.
public sealed class InlineTextInputWidget : InlineWidget, ICliRenderable
Inheritance
InlineTextInputWidget
Implements
Inherited Members

Constructors

InlineTextInputWidget(ICliAppShell, string?, bool, int?)

Creates an editable, single-line text input widget.
public InlineTextInputWidget(ICliAppShell shell, string? initialValue = null, bool isSecret = false, int? width = null)

Parameters

shell ICliAppShell
The shell that supplies the theme.
initialValue string
The initial text.
isSecret bool
Whether to mask the displayed text.
width int?
The optional input width in cells.

Properties

CursorIndex

The zero-based insertion point within Text.
public int CursorIndex { get; }

Property Value

int

IsSecret

Whether the rendered text is masked.
public bool IsSecret { get; }

Property Value

bool

Text

The current unmasked input text.
public string Text { 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

SetText(string?, bool)

Replaces the input text and optionally moves the cursor to its end.
public void SetText(string? text, bool moveCursorToEnd = true)

Parameters

text string
The replacement text; null clears the input.
moveCursorToEnd bool
Whether to move the cursor to the end of the replacement text.

ToGrid()

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

Returns

CliGrid