TextBoxWidget
Namespace: Hex1b.Widgets
Assembly: Hex1b.dll
public sealed record TextBoxWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<TextBoxWidget>Inheritance
Object → Hex1bWidget → TextBoxWidget
Implements
Constructors
TextBoxWidget(string?)
Parameters:
Text(String):
public TextBoxWidget(string? Text = null)Properties
MaxWidth
Maximum width of the text box in columns. When set, the text box will not exceed this width. Defaults to the same value as MinWidth if not explicitly set.
Returns: Nullable<Int32>
public int? MaxWidth { get; init; }MinWidth
Minimum width of the text box in columns. When set, the text box will measure at least this many columns wide regardless of content.
Returns: Nullable<Int32>
public int? MinWidth { get; init; }Text
Returns: String
public string? Text { get; init; }Methods
Height(int)
Sets the height of the text box in lines.
Parameters:
lines(Int32):
Returns: TextBoxWidget
public TextBoxWidget Height(int lines)Multiline()
Enables multi-line text editing. Enter inserts newlines, Up/Down arrows navigate between lines, and word wrapping can be enabled.
Returns: TextBoxWidget
public TextBoxWidget Multiline()Multiline(int)
Enables multi-line text editing with a maximum number of lines. Once the limit is reached, no more newlines can be inserted.
Parameters:
maxLines(Int32):
Returns: TextBoxWidget
public TextBoxWidget Multiline(int maxLines)OnPaste(Action<PasteEventArgs>)
Sets a synchronous handler called when paste data is received. Overrides the default behavior of inserting pasted text at the cursor position.
Parameters:
handler(Action<PasteEventArgs>):
Returns: TextBoxWidget
public TextBoxWidget OnPaste(Action<PasteEventArgs> handler)OnPaste(Func<PasteEventArgs, Task>)
Sets an asynchronous handler called when paste data is received. Overrides the default behavior of inserting pasted text at the cursor position.
Parameters:
handler(Func<PasteEventArgs, Task>):
Returns: TextBoxWidget
public TextBoxWidget OnPaste(Func<PasteEventArgs, Task> handler)OnSubmit(Action<TextSubmittedEventArgs>)
Sets a synchronous handler called when Enter is pressed in the text box.
Parameters:
handler(Action<TextSubmittedEventArgs>):
Returns: TextBoxWidget
public TextBoxWidget OnSubmit(Action<TextSubmittedEventArgs> handler)OnSubmit(Func<TextSubmittedEventArgs, Task>)
Sets an asynchronous handler called when Enter is pressed in the text box.
Parameters:
handler(Func<TextSubmittedEventArgs, Task>):
Returns: TextBoxWidget
public TextBoxWidget OnSubmit(Func<TextSubmittedEventArgs, Task> handler)OnTextChanged(Action<TextChangedEventArgs>)
Sets a synchronous handler called when the text content changes.
Parameters:
handler(Action<TextChangedEventArgs>):
Returns: TextBoxWidget
public TextBoxWidget OnTextChanged(Action<TextChangedEventArgs> handler)OnTextChanged(Func<TextChangedEventArgs, Task>)
Sets an asynchronous handler called when the text content changes.
Parameters:
handler(Func<TextChangedEventArgs, Task>):
Returns: TextBoxWidget
public TextBoxWidget OnTextChanged(Func<TextChangedEventArgs, Task> handler)WordWrap()
Enables word wrapping for multi-line text boxes. Long lines are visually broken at word boundaries to fit the available width.
Returns: TextBoxWidget
public TextBoxWidget WordWrap()Fields
DeleteBackward
Rebindable action: Delete character backward.
Returns: ActionId
public static readonly ActionId DeleteBackwardDeleteForward
Rebindable action: Delete character forward.
Returns: ActionId
public static readonly ActionId DeleteForwardDeleteWordBackward
Rebindable action: Delete previous word.
Returns: ActionId
public static readonly ActionId DeleteWordBackwardDeleteWordForward
Rebindable action: Delete next word.
Returns: ActionId
public static readonly ActionId DeleteWordForwardInsertNewline
Rebindable action: Insert a newline (multiline only).
Returns: ActionId
public static readonly ActionId InsertNewlineInsertText
Rebindable action: Insert typed text.
Returns: ActionId
public static readonly ActionId InsertTextMoveDown
Rebindable action: Move cursor down one line (multiline only).
Returns: ActionId
public static readonly ActionId MoveDownMoveEnd
Rebindable action: Move cursor to end.
Returns: ActionId
public static readonly ActionId MoveEndMoveHome
Rebindable action: Move cursor to start.
Returns: ActionId
public static readonly ActionId MoveHomeMoveLeft
Rebindable action: Move cursor left.
Returns: ActionId
public static readonly ActionId MoveLeftMoveRight
Rebindable action: Move cursor right.
Returns: ActionId
public static readonly ActionId MoveRightMoveUp
Rebindable action: Move cursor up one line (multiline only).
Returns: ActionId
public static readonly ActionId MoveUpMoveWordLeft
Rebindable action: Move cursor to previous word.
Returns: ActionId
public static readonly ActionId MoveWordLeftMoveWordRight
Rebindable action: Move cursor to next word.
Returns: ActionId
public static readonly ActionId MoveWordRightSelectAll
Rebindable action: Select all text.
Returns: ActionId
public static readonly ActionId SelectAllSelectDown
Rebindable action: Extend selection down one line (multiline only).
Returns: ActionId
public static readonly ActionId SelectDownSelectLeft
Rebindable action: Extend selection left.
Returns: ActionId
public static readonly ActionId SelectLeftSelectRight
Rebindable action: Extend selection right.
Returns: ActionId
public static readonly ActionId SelectRightSelectToEnd
Rebindable action: Select to end.
Returns: ActionId
public static readonly ActionId SelectToEndSelectToStart
Rebindable action: Select to start.
Returns: ActionId
public static readonly ActionId SelectToStartSelectUp
Rebindable action: Extend selection up one line (multiline only).
Returns: ActionId
public static readonly ActionId SelectUpSelectWordLeft
Rebindable action: Extend selection to previous word.
Returns: ActionId
public static readonly ActionId SelectWordLeftSelectWordRight
Rebindable action: Extend selection to next word.
Returns: ActionId
public static readonly ActionId SelectWordRightSubmit
Rebindable action: Submit text.
Returns: ActionId
public static readonly ActionId Submit