Class InlineTextInputWidget
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
shellICliAppShell- The shell that supplies the theme.
initialValuestring- The initial text.
isSecretbool- Whether to mask the displayed text.
widthint?- The optional input width in cells.
Properties
CursorIndex
The zero-based insertion point within Text.
public int CursorIndex { get; }
Property Value
IsSecret
Whether the rendered text is masked.
public bool IsSecret { get; }
Property Value
Text
The current unmasked input text.
public string Text { get; }
Property Value
Methods
HandleKey(KeyEvent)
Handles a key. Returns whether it was consumed and any requested dialog result.
public override InlineKeyResult HandleKey(KeyEvent key)
Parameters
keyKeyEvent
Returns
SetText(string?, bool)
Replaces the input text and optionally moves the cursor to its end.
public void SetText(string? text, bool moveCursorToEnd = true)
Parameters
textstring- The replacement text;
nullclears the input. moveCursorToEndbool- 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()