ConsoleForge 0.3.0
Elm-architecture TUI framework for .NET 8
Loading...
Searching...
No Matches
ConsoleForge.Layout.ISingleBodyWidget Interface Reference

Implemented by widgets that wrap a single body child (e.g. More...

Inheritance diagram for ConsoleForge.Layout.ISingleBodyWidget:

Public Member Functions

Region ComputeBodyRegion (Region outer)
 Compute the region allocated to Body given the outer region allocated to this widget.
Public Member Functions inherited from ConsoleForge.Layout.IWidget
void Render (IRenderContext ctx)
 Render this widget into the provided context.

Properties

IWidgetBody [get]
 The single child widget contained by this wrapper, or null if empty.
Properties inherited from ConsoleForge.Layout.IWidget
SizeConstraint Height [get]
 Height constraint used by the layout engine.
Style Style [get]
 Visual style for this widget. Inherits from Theme if unset.
SizeConstraint Width [get]
 Width constraint used by the layout engine.

Detailed Description

Implemented by widgets that wrap a single body child (e.g.

BorderBox, Modal). Used by Core.FocusManager and LayoutEngine to traverse into the body for focus collection and region allocation.

Member Function Documentation

◆ ComputeBodyRegion()

Region ConsoleForge.Layout.ISingleBodyWidget.ComputeBodyRegion ( Region outer)

Compute the region allocated to Body given the outer region allocated to this widget.

The default implementation insets by 1 on all sides (one-character border convention used by BorderBox) plus any additional padding set on the widget's IWidget.Style. Override for widgets whose body occupies a different sub-region (e.g. Modal centers its dialog box within the outer region).

Implemented in ConsoleForge.Widgets.Modal.


The documentation for this interface was generated from the following file:
  • src/ConsoleForge/Layout/ISingleBodyWidget.cs