Skip to content
ConsoleMonster

API Reference

Class

Columns

Namespace ConsoleMonster.Layout
Assembly ConsoleMonster
Implements
Modifiers sealed

Places children side by side. Children in a row share their height, so panels line up instead of forming a staircase. When the width drops below the children's minimum widths the columns stack vertically instead of squeezing content unreadably.

Inheritance

  • Object
  • Columns

Usage

Explore 11 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 7

Accepted by parameters 4

Constructors

public Columns(params IWidget[] children) #

Creates columns that share the width equally.

Parameters

children ConsoleMonster.Layout.IWidget[] requiredposition: 0
The children.

Methods

public Columns Add(IWidget child, LayoutSize? size = null) #
Returns: Columns

Adds a child.

Parameters

child ConsoleMonster.Layout.IWidget requiredposition: 0
The child.
size ConsoleMonster.Layout.LayoutSize? = null optionalposition: 1
Its width specification (default one equal fraction).

Returns

This instance.

public Size Measure(Constraints constraints, RenderContext context) #
Returns: Size

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints requiredposition: 0
The space offered.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Returns

The desired size, never larger than the constraints.

public Void Render(Region region, RenderContext context) #
Returns: Void

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

Parameters

region ConsoleMonster.Canvas.Region requiredposition: 0
The target region.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Properties

public Int32 Gap { get; set; } #

Blank columns between children (default 1).

public Int32 CollapseBelow { get; set; } #

Width below which the columns stack vertically. -1 (default) uses the sum of the children's minimum widths (fractions without a minimum count as 16 cells).

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.

public IReadOnlyList<LayoutSize> Sizes { get; } #

Size specifications, parallel to Columns.Children.

Extension Methods

public static Columns WithCollapseBelow(Columns columns, Int32 value) #
Returns: Columns

Sets Columns.CollapseBelow: Width below which the columns stack vertically. -1 (default) uses the sum of the children's minimum widths (fractions without a minimum count as 16 cells).

Parameters

columns ConsoleMonster.Layout.Columns requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.

public static Columns WithGap(Columns columns, Int32 value) #
Returns: Columns

Sets Columns.Gap: Blank columns between children (default 1).

Parameters

columns ConsoleMonster.Layout.Columns requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.