WindowNode
Namespace: Hex1b.Nodes
Assembly: Hex1b.dll
Render node for . A floating window with title bar, close button, and content area.
public sealed class WindowNode : Hex1bNode, ILayoutProviderInheritance
Object → Hex1bNode → WindowNode
Implements
Properties
ClipMode
The clip mode for the window's content. Defaults to Clip.
Returns: ClipMode
public ClipMode ClipMode { get; set; }ClipRect
The clip rectangle for child content (inner area excluding border and title bar).
Returns: Rect
public Rect ClipRect { get; }Content
The child content node.
Returns: Hex1bNode
public Hex1bNode? Content { get; set; }Entry
The window entry from the WindowManager.
Returns: WindowEntry
public WindowEntry? Entry { get; set; }EscapeBehavior
How Escape key is handled for this window.
Returns: WindowEscapeBehavior
public WindowEscapeBehavior EscapeBehavior { get; set; }IsActive
Whether this window is the active (topmost) window. Set by WindowPanelNode during reconciliation.
Returns: Boolean
public bool IsActive { get; set; }IsFocusable
WindowNode is focusable to receive clicks on non-content areas (title bar, borders, empty space).
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
Whether the mouse is currently over this window.
Returns: Boolean
public override bool IsHovered { get; set; }IsModal
Whether this is a modal window.
Returns: Boolean
public bool IsModal { get; set; }IsResizable
Whether this window can be resized.
Returns: Boolean
public bool IsResizable { get; set; }LeftTitleBarActions
Actions displayed on the left side of the title bar.
Returns: IReadOnlyList<WindowAction>
public IReadOnlyList<WindowAction> LeftTitleBarActions { get; set; }ParentLayoutProvider
The parent layout provider, if any. Set when this provider becomes the current layout provider and there was already one active. Used to ensure nested clipping works correctly.
Returns: ILayoutProvider
public ILayoutProvider? ParentLayoutProvider { get; set; }RightTitleBarActions
Actions displayed on the right side of the title bar.
Returns: IReadOnlyList<WindowAction>
public IReadOnlyList<WindowAction> RightTitleBarActions { get; set; }ShowTitleBar
Whether the title bar is displayed.
Returns: Boolean
public bool ShowTitleBar { get; set; }Title
The window title displayed in the title bar.
Returns: String
public string Title { get; set; }Methods
ArrangeCore(Rect)
Override this method to implement arranging logic for this node. The base implementation saves previous bounds, marks dirty on change, and sets bounds.
Parameters:
bounds(Rect):
protected override void ArrangeCore(Rect bounds)ClipString(int, int, string)
Clips a string that starts at the given position, returning only the visible portion. Implementations should also consult the ParentLayoutProvider if present.
Parameters:
x(Int32): Starting absolute X position.y(Int32): Absolute Y position.text(String): The text to potentially clip.
Returns: ValueTuple<Int32, String>
A tuple containing:
- adjustedX: The X position to start rendering (may be > x if left-clipped)
- clippedText: The portion of text that should be rendered (may be empty)
public (int adjustedX, string clippedText) ClipString(int x, int y, string text)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)GetChildren()
Gets the direct children of this container for input routing.
Returns: IEnumerable<Hex1bNode>
public override IEnumerable<Hex1bNode> GetChildren()GetFocusableNodes()
Gets all focusable nodes in this subtree (including this node if focusable).
Returns: IEnumerable<Hex1bNode>
public override IEnumerable<Hex1bNode> GetFocusableNodes()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)ShouldRenderAt(int, int)
Determines if a character at the given absolute position should be rendered. Implementations should also check the ParentLayoutProvider if present.
Parameters:
x(Int32): Absolute X position in terminal coordinates.y(Int32): Absolute Y position in terminal coordinates.
Returns: Boolean
True if the character should be rendered, false if it should be clipped.
public bool ShouldRenderAt(int x, int y)SyncFocusIndex()
When any child of this window receives focus, bring the window to front.
public override void SyncFocusIndex()Fields
ClickAction
Returns: ActionId
public static readonly ActionId ClickActionCloseAction
Returns: ActionId
public static readonly ActionId CloseActionTitleBarIconClickAction
Returns: ActionId
public static readonly ActionId TitleBarIconClickAction