Skip to content
ConsoleMonster
Class

Sized

ConsoleMonster.Layout

Namespace
ConsoleMonster.Layout
Assembly
ConsoleMonster
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 4 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

Constructors

public Sized(IWidget widget, LayoutSize size) #

Wraps a widget with a size.

Parameters

widget ConsoleMonster.Layout.IWidget required
The widget.
size ConsoleMonster.Layout.LayoutSize required
Its size inside a row or column layout.

Methods

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

The wrapped widget.

public LayoutSize LayoutSize { get; } #

The size specification.

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.