Skip to content
ConsoleMonster

API Reference

Class

Sized

Namespace ConsoleMonster.Layout
Assembly ConsoleMonster
Implements
Modifiers sealed

Carries a Sized.LayoutSize with a widget, so declarative surfaces (the PowerShell DSL, JSON layouts) can say "this panel takes two shares" or "this log fills the rest" without calling container methods. Rows, Columns use it as the default size when the child is added without an explicit one. Rendering passes straight through to the inner widget.

Inheritance

  • Object
  • Sized

Usage

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

Constructors

public Sized(IWidget widget, LayoutSize size) #

Wraps a widget with a size.

Parameters

widget ConsoleMonster.Layout.IWidget requiredposition: 0
The widget.
size ConsoleMonster.Layout.LayoutSize requiredposition: 1
Its size inside a row or column layout.

Methods

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 IWidget Widget { get; } #

The wrapped widget.

public LayoutSize LayoutSize { get; } #

The size specification.

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.