Skip to content
ConsoleMonster
Class

LayoutRegions

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Modifiers
sealed

Equal layout regions that show only the active region below a configurable width. Focus and retained control state follow swapped content.

Inheritance

  • object
  • LayoutRegions

Usage

Explore 14 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.

Accepted by parameters 6

Constructors

public LayoutRegions() #

Methods

public void Activate(string key) #

Shows a region and focuses its first enabled input.

Parameters

key string required
public LayoutRegions Add(string key, IWidget content) #

Adds a stable named region.

Parameters

key string required
content ConsoleMonster.Layout.IWidget required
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.
public void Swap(string first, string second) #

Swaps two existing subtrees without reconstructing their controls.

Parameters

first string required
second string required

Properties

public int NarrowBelow { get; set; } #

The minimum width for showing regions side by side.

public string? ActiveRegion { get; set; } #

The region shown in narrow mode when no region owns focus.

public int Gap { get; set; } #

The gap in cells between regions.

public IReadOnlyList<LayoutRegion> Regions { get; } #

The configured slots.

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.

Extension Methods

public static LayoutRegions ActiveRegion(LayoutRegions layoutRegions, string? value) #

Sets LayoutRegions.ActiveRegion: The region shown in narrow mode when no region owns focus.

Parameters

layoutRegions ConsoleMonster.Widgets.LayoutRegions required
The instance.
value string? required
The value.

Returns

LayoutRegions The same instance.

Examples

// C# initializer or property                                                 // C# fluent
new global::ConsoleMonster.Widgets.LayoutRegions { ActiveRegion = value };    Ui.LayoutRegions().ActiveRegion(value);
public static LayoutRegions Gap(LayoutRegions layoutRegions, int value) #

Sets LayoutRegions.Gap: The gap in cells between regions.

Parameters

layoutRegions ConsoleMonster.Widgets.LayoutRegions required
The instance.
value int required
The value.

Returns

LayoutRegions The same instance.

Examples

// C# initializer or property                                        // C# fluent
new global::ConsoleMonster.Widgets.LayoutRegions { Gap = value };    Ui.LayoutRegions().Gap(value);
public static LayoutRegions NarrowBelow(LayoutRegions layoutRegions, int value) #

Sets LayoutRegions.NarrowBelow: The minimum width for showing regions side by side.

Parameters

layoutRegions ConsoleMonster.Widgets.LayoutRegions required
The instance.
value int required
The value.

Returns

LayoutRegions The same instance.

Examples

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