Skip to content

TextBoxNode

Namespace: Hex1b

Assembly: Hex1b.dll

csharp
public sealed class TextBoxNode : Hex1bNode

Inheritance

ObjectHex1bNodeTextBoxNode

Properties

IsFocusable

Returns true if this node can receive focus.

Returns: Boolean

csharp
public override bool IsFocusable { get; }

IsFocused

Gets or sets whether this node is currently focused. Only meaningful for focusable nodes (where IsFocusable is true).

Returns: Boolean

csharp
public override bool IsFocused { get; set; }

IsHovered

Gets or sets whether the mouse is currently hovering over this node. Set by Hex1bApp based on mouse position during each frame. Only set on focusable nodes (tracked via FocusRing hit testing).

Returns: Boolean

csharp
public override bool IsHovered { get; set; }

IsMultiline

When true, the text box supports multi-line editing.

Returns: Boolean

csharp
public bool IsMultiline { get; set; }

IsWordWrap

When true, long lines are visually wrapped at word boundaries.

Returns: Boolean

csharp
public bool IsWordWrap { get; set; }

MaxLines

Maximum number of lines allowed in multiline mode. When null, there is no limit.

Returns: Nullable<Int32>

csharp
public int? MaxLines { get; set; }

MaxWidth

Maximum width of the text box in columns.

Returns: Nullable<Int32>

csharp
public int? MaxWidth { get; set; }

MinWidth

Minimum width of the text box in columns.

Returns: Nullable<Int32>

csharp
public int? MinWidth { get; set; }

PreferredCursorShape

Mouse hover uses the default cursor shape. The text editing bar cursor is shown via the native terminal cursor only when the TextBox is focused.

Returns: CursorShape

csharp
public override CursorShape PreferredCursorShape { get; }

RequestedHeight

Fixed height in lines. Null means 1 for single-line, content-based for multiline.

Returns: Nullable<Int32>

csharp
public int? RequestedHeight { get; set; }

SourceWidget

The source widget that was reconciled into this node. Used to create typed event args.

Returns: TextBoxWidget

csharp
public TextBoxWidget? SourceWidget { get; set; }

Text

Gets or sets the text content. Convenience property that accesses State.Text.

Returns: String

csharp
public string Text { get; set; }

Methods

ConfigureDefaultBindings(InputBindingsBuilder)

Configures the default input bindings for this node type. Override in derived classes to add default key bindings. These bindings can be inspected and modified by the user's callback.

Parameters:

csharp
public override void ConfigureDefaultBindings(InputBindingsBuilder bindings)

HandleMouseClick(int, int, Hex1bMouseEvent)

Handles mouse click to position the cursor within the text.

Parameters:

Returns: InputResult

csharp
public override InputResult HandleMouseClick(int localX, int localY, Hex1bMouseEvent mouseEvent)

HandlePasteAsync(Hex1bPasteEvent)

Handles bracketed paste. If a custom paste handler is set via OnPaste(), it is called instead of the default text insertion behavior. For default behavior: reads full paste content and inserts at cursor position. For single-line text boxes, newlines are replaced with spaces.

Parameters:

Returns: Task<InputResult>

csharp
public override Task<InputResult> HandlePasteAsync(Hex1bPasteEvent pasteEvent)

MeasureCore(Constraints)

Override this method to implement measuring logic for this node.

Parameters:

Returns: Size

csharp
protected override Size MeasureCore(Constraints constraints)

Render(Hex1bRenderContext)

Renders the node to the given context.

Parameters:

csharp
public override void Render(Hex1bRenderContext context)

Released under the MIT License.