Skip to content
ConsoleMonster
Class

Tabs

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Implements
IContainer IWidget IAppInputContainer
Modifiers
sealed

Retained tab subtrees. Ctrl+PageUp/PageDown and header clicks switch tabs; only the active subtree is mounted.

Inheritance

  • object
  • Tabs

Usage

Explore 8 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 4

Accepted by parameters 4

Constructors

public Tabs() #

Methods

public Tabs Add(string label, IWidget content) #

Adds a tab; its key is also its visible label.

Parameters

label string required
content ConsoleMonster.Layout.IWidget required

Returns

Tabs
public Size Measure(Constraints constraints, RenderContext context) #

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints required
The space offered.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Returns

Size The desired size, never larger than the constraints.
public void Render(Region region, RenderContext context) #

Renders into a region. The region may be smaller or larger than the measured size.

Parameters

region ConsoleMonster.Canvas.Region required
The target region.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Properties

public int SelectedIndex { get; set; } #

The active tab index.

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.

Extension Methods

public static Tabs SelectedIndex(Tabs tabs, int value) #

Sets Tabs.SelectedIndex: The active tab index.

Parameters

tabs ConsoleMonster.Widgets.Tabs required
The instance.
value int required
The value.

Returns

Tabs The same instance.

Examples

// C# initializer or property                                         // C# fluent
new global::ConsoleMonster.Widgets.Tabs { SelectedIndex = value };    Ui.Tabs().SelectedIndex(value);