Skip to content

TabPanelNode ​

Namespace: Hex1b.Nodes

Assembly: Hex1b.dll

Node representing a complete tabbed panel with tab bar and content area.

csharp
public sealed class TabPanelNode : Hex1bNode, ILayoutProvider

Inheritance ​

Object → Hex1bNode → TabPanelNode

Implements ​

Properties ​

ClipMode ​

The clip mode for this layout region.

Returns: ClipMode

csharp
public ClipMode ClipMode { get; set; }

ClipRect ​

The effective clipping rectangle for this layout region.

Returns: Rect

csharp
public Rect ClipRect { get; }

Content ​

Returns: Hex1bNode

csharp
public Hex1bNode? Content { get; set; }

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; }

ManagesChildFocus ​

Returns true if this node manages focus for its children. When a parent manages focus, child containers should NOT set initial focus themselves. Container nodes like SplitterNode should override this to return true.

Returns: Boolean

csharp
public override bool ManagesChildFocus { 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; }

Position ​

The position of tabs (top or bottom).

Returns: TabPosition

csharp
public TabPosition Position { get; set; }

RenderMode ​

The rendering mode (Full or Compact).

Returns: TabBarRenderMode

csharp
public TabBarRenderMode RenderMode { get; set; }

SelectedIndex ​

Returns: Int32

csharp
public int SelectedIndex { get; set; }

ShowPaging ​

Whether to show paging arrows when tabs overflow.

Returns: Boolean

csharp
public bool ShowPaging { get; set; }

ShowSelector ​

Whether to show the dropdown selector for quick tab navigation.

Returns: Boolean

csharp
public bool ShowSelector { 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:

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 node for structural tree traversal. Container nodes should override this to return their children.

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)

SelectNextTabAsync() ​

Selects the next tab (wraps around).

Returns: Task

csharp
public Task SelectNextTabAsync()

SelectPreviousTabAsync() ​

Selects the previous tab (wraps around).

Returns: Task

csharp
public Task SelectPreviousTabAsync()

SelectTabAsync(int) ​

Selects a tab by index and fires the selection changed event.

Parameters:

Returns: Task

csharp
public Task SelectTabAsync(int index)

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.