Skip to content

WindowPanelNode ​

Namespace: Hex1b.Nodes

Assembly: Hex1b.dll

Render node for . A container that hosts floating windows rendered on top of main content.

csharp
public sealed class WindowPanelNode : Hex1bNode, IWindowHost, ILayoutProvider

Inheritance ​

Object → Hex1bNode → WindowPanelNode

Implements ​

Properties ​

AllowOutOfBounds ​

Whether windows can be moved outside the panel bounds. When true, scrollbars appear to allow panning to out-of-bounds windows.

Returns: Boolean

csharp
public bool AllowOutOfBounds { get; set; }

BackgroundNode ​

Optional background node that renders behind all windows. Participates in input routing and focus management.

Returns: Hex1bNode

csharp
public Hex1bNode? BackgroundNode { get; set; }

ClipMode ​

The clip mode for the panel's content. Defaults to Clip.

Returns: ClipMode

csharp
public ClipMode ClipMode { get; set; }

ClipRect ​

The clip rectangle for child content.

Returns: Rect

csharp
public Rect ClipRect { get; }

ClipScopeValue ​

The clipping scope for this panel's content.

Returns: ClipScope

csharp
public ClipScope ClipScopeValue { get; set; }

ManagesChildFocus ​

WindowPanel manages focus for its descendants including windows.

Returns: Boolean

csharp
public override bool ManagesChildFocus { get; }

Name ​

Optional name for this panel. Used when multiple WindowPanels exist.

Returns: String

csharp
public string? Name { get; set; }

NeedsHorizontalScroll ​

Whether horizontal scrollbar is needed.

Returns: Boolean

csharp
public bool NeedsHorizontalScroll { get; }

NeedsVerticalScroll ​

Whether vertical scrollbar is needed.

Returns: Boolean

csharp
public bool NeedsVerticalScroll { get; }

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

csharp
public ILayoutProvider? ParentLayoutProvider { get; set; }

ScrollX ​

Current horizontal scroll offset (for panning to out-of-bounds windows).

Returns: Int32

csharp
public int ScrollX { get; set; }

ScrollY ​

Current vertical scroll offset (for panning to out-of-bounds windows).

Returns: Int32

csharp
public int ScrollY { get; set; }

WindowNodes ​

The window nodes, in z-order (bottom to top).

Returns: List<WindowNode>

csharp
public List<WindowNode> WindowNodes { get; }

Windows ​

The window manager for this panel.

Returns: WindowManager

csharp
public WindowManager Windows { get; }

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:

csharp
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)
csharp
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:

csharp
public override void ConfigureDefaultBindings(InputBindingsBuilder bindings)

GetChildren() ​

Gets all direct children in render order.

Returns: IEnumerable<Hex1bNode>

csharp
public override IEnumerable<Hex1bNode> GetChildren()

GetFocusableNodes() ​

Gets all focusable nodes in this subtree (including this node if focusable).

Returns: IEnumerable<Hex1bNode>

csharp
public override IEnumerable<Hex1bNode> GetFocusableNodes()

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)

ScrollByAmount(int, int) ​

Scrolls the panel view by the specified amount.

Parameters:

csharp
public void ScrollByAmount(int deltaX, int deltaY)

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.

csharp
public bool ShouldRenderAt(int x, int y)

Released under the MIT License.