TextBoxNode
Namespace: Hex1b
Assembly: Hex1b.dll
public sealed class TextBoxNode : Hex1bNodeInheritance
Object → Hex1bNode → TextBoxNode
Properties
IsFocusable
Returns true if this node can receive focus.
Returns: Boolean
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
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
public override bool IsHovered { get; set; }PreferredCursorShape
TextBox uses a blinking bar cursor to indicate text input position.
Returns: CursorShape
public override CursorShape PreferredCursorShape { get; }SourceWidget
The source widget that was reconciled into this node. Used to create typed event args.
Returns: TextBoxWidget
public TextBoxWidget? SourceWidget { get; set; }Text
Gets or sets the text content. Convenience property that accesses State.Text.
Returns: String
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:
bindings(InputBindingsBuilder): The builder to add bindings to.
public override void ConfigureDefaultBindings(InputBindingsBuilder bindings)HandleMouseClick(int, int, Hex1bMouseEvent)
Handles mouse click to position the cursor within the text.
Parameters:
localX(Int32):localY(Int32):mouseEvent(Hex1bMouseEvent):
Returns: InputResult
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:
pasteEvent(Hex1bPasteEvent):
Returns: Task<InputResult>
public override Task<InputResult> HandlePasteAsync(Hex1bPasteEvent pasteEvent)MeasureCore(Constraints)
Override this method to implement measuring logic for this node.
Parameters:
constraints(Constraints):
Returns: Size
protected override Size MeasureCore(Constraints constraints)Render(Hex1bRenderContext)
Renders the node to the given context.
Parameters:
context(Hex1bRenderContext):
public override void Render(Hex1bRenderContext context)