Layout
Layout
Section titled “Layout”#include <Layout.hpp>Subclassed by:
AbsoluteLayout,GridLayout,StackLayout
Abstract base class for layout engines.
Implement this to create custom layouts. The apply() method is called with a list of child widgets and their specs, and should position each child by setting their rect field.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
void | apply | Applies the layout algorithm to position children. |
void apply(std::vector< ChildSlot > & children, Rect inner)Applies the layout algorithm to position children.
This method should position each child by modifying its rect field. The framework calls measure() before layout(), so you can inspect each widget’s measured size.
Parameters
Section titled “Parameters”-
childrenThe child widgets with their layout specs -
innerThe inner area available for children (accounting for borders/padding)