Skip to content

ZStackNode

Namespace: Hex1b

Assembly: Hex1b.dll

Render node for . Stacks children on the Z-axis, with later children rendering on top of earlier ones.

csharp
public sealed class ZStackNode : Hex1bNode, ILayoutProvider, IPopupHost, INotificationHost

Inheritance

ObjectHex1bNodeZStackNode

Implements

Properties

AllChildrenInOrder

Returns: List<Hex1bNode>

csharp
public List<Hex1bNode> AllChildrenInOrder { get; set; }

Children

The child nodes, in render order (first = bottom, last = top).

Returns: List<Hex1bNode>

csharp
public List<Hex1bNode> Children { get; set; }

ClipMode

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

Returns: ClipMode

csharp
public ClipMode ClipMode { get; set; }

ClipRect

The clip rectangle for child content. Uses the resolved clip scope.

Returns: Rect

csharp
public Rect ClipRect { get; }

ClipScopeValue

The clipping scope for this ZStack's content.

Returns: ClipScope

csharp
public ClipScope ClipScopeValue { get; set; }

Floats

Returns: List<FloatEntry>

csharp
public List<FloatEntry> Floats { get; set; }

ManagesChildFocus

ZStack only manages child focus when popups are open. This allows nested containers (like WindowPanelNode) to set focus normally when no popups are present, but defers to ZStack when popups take focus.

Returns: Boolean

csharp
public override bool ManagesChildFocus { get; }

Notifications

The notification stack for this ZStack. Notifications posted here can be displayed by any NotificationPanel that registers with this stack.

Returns: NotificationStack

csharp
public NotificationStack Notifications { 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; }

Popups

The popup stack for this ZStack. Content pushed here appears as overlay layers.

Returns: PopupStack

csharp
public PopupStack Popups { get; }

Methods

ArrangeCore(Rect)

ZStack needs special dirty handling: if ANY child is dirty, the entire stack must re-render in order to maintain proper z-ordering (later children on top). Exception: Single-child ZStacks (like the root popup host) don't need this.

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 the direct children of this container for input routing.

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)

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.