Skip to content
ConsoleMonster
Class

Rows

ConsoleMonster.Layout

Namespace
ConsoleMonster.Layout
Assembly
ConsoleMonster
Implements
IContainer IWidget IContentOwner
Modifiers
sealed

Stacks children vertically. In print-once output every child gets its measured height; in a live frame, LayoutSize.Fraction rows share the height left after fixed and auto rows (for example a log region that fills the bottom of the screen). Fraction rows are measured after the fixed and auto rows, so under a height limit an earlier fraction row (a long step list) takes only what the rows after it leave.

Inheritance

  • object
  • Rows

Usage

Explore 16 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 8

Accepted by parameters 8

Constructors

public Rows(params IWidget[] children) #

Creates rows from children sized to their content.

Parameters

children ConsoleMonster.Layout.IWidget[] required
The children.

Methods

public Rows Add(IWidget child, LayoutSize? size = null) #

Adds a child.

Parameters

child ConsoleMonster.Layout.IWidget required
The child.
size ConsoleMonster.Layout.LayoutSize? = null optional
Its height specification (default auto).

Returns

Rows This instance.
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 Gap { get; set; } #

Blank rows between children.

public bool DropByPriority { get; set; } #

Whether rows that do not fit shrink and then leave whole, lowest Prioritized.Priority first (default false: the last rows are cut). With it on, a Prioritized child shrinks toward its minimum height and is left out when even the minimums do not fit, so it is never given less than its minimum; the height left over goes back to the highest priorities first. Other children always stay.

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.

public IReadOnlyList<LayoutSize> Sizes { get; } #

Size specifications, parallel to Rows.Children.

Extension Methods

Content 2 overloads
public static Rows Content(Rows rows, IWidget content) #

Configures this container's content before session ownership.

Parameters

rows ConsoleMonster.Layout.Rows required
The instance.
content ConsoleMonster.Layout.IWidget required
The widget or nested content builder.

Returns

Rows The same instance.
public static Rows Content(Rows rows, Action<ContentBuilder> content) #

Configures this container's content before session ownership.

Parameters

rows ConsoleMonster.Layout.Rows required
The instance.
content System.Action<ConsoleMonster.Layout.ContentBuilder> required
The widget or nested content builder.

Returns

Rows The same instance.
public static Rows DropByPriority(Rows rows, bool value = true) #

Sets Rows.DropByPriority: Whether rows that do not fit shrink and then leave whole, lowest Prioritized.Priority first (default false: the last rows are cut). With it on, a Prioritized child shrinks toward its minimum height and is left out when even the minimums do not fit, so it is never given less than its minimum; the height left over goes back to the highest priorities first. Other children always stay.

Parameters

rows ConsoleMonster.Layout.Rows required
The instance.
value bool = true optional
The value; true when omitted.

Returns

Rows The same instance.

Examples

// C# initializer or property    // C# fluent
rows.DropByPriority = value;     Ui.Rows().DropByPriority(value);
public static Rows Gap(Rows rows, int value) #

Sets Rows.Gap: Blank rows between children.

Parameters

rows ConsoleMonster.Layout.Rows required
The instance.
value int required
The value.

Returns

Rows The same instance.

Examples

// C# initializer or property    // C# fluent
rows.Gap = value;                Ui.Rows().Gap(value);