|
Ultralight C++ API 2.0.0
|
Declarative functions for constructing layout trees.
#include <AppCore/layout/Builder.h>
The panel(), row(), and column() functions return builder elements that describe panels and containers. They let you declare an entire layout hierarchy in a single expression instead of adding nodes step by step with Container::AddPanel(), Container::AddRow(), and Container::AddColumn().
This declares a toolbar above a resizable body with a sidebar and a content pane:
Builder elements construct nodes through a window or an existing container:
The builder functions accept the same PanelOptions and ContainerOptions as Container::AddPanel(), Container::AddRow(), and Container::AddColumn(), and they produce the same Panel and Container nodes.
You can capture handles to nodes during layout construction by passing the address of a RefPtr handle to panel(), row(), or column(). When the layout is built, each function populates the target pointer with the created Panel or Container. This lets you interact with nodes immediately (such as calling Panel::view() to load content) so you don't need to look them up by key later.
Classes | |
| struct | PanelSpec |
| A panel element inside a Build()/BuildLayout() expression. More... | |
| struct | ContainerSpec< Children > |
| A container element inside a Build()/BuildLayout() expression. More... | |
Functions | |
| PanelSpec | panel (PanelOptions options={}, RefPtr< Panel > *out=nullptr) |
| Describe a panel in a builder expression (see Builder.h for an example). | |
| template<typename... Children> requires (LayoutBuildable<Children> && ...) | |
| ContainerSpec< Children... > | row (ContainerOptions options, Children... children) |
| Describe a row container with child elements. | |
| template<typename... Children> requires (LayoutBuildable<Children> && ...) | |
| ContainerSpec< Children... > | row (ContainerOptions options, RefPtr< Container > *out, Children... children) |
| Describe a row container, capturing the created handle in out. | |
| template<typename... Children> requires (LayoutBuildable<Children> && ...) | |
| ContainerSpec< Children... > | column (ContainerOptions options, Children... children) |
| Describe a column container with child elements. | |
| template<typename... Children> requires (LayoutBuildable<Children> && ...) | |
| ContainerSpec< Children... > | column (ContainerOptions options, RefPtr< Container > *out, Children... children) |
| Describe a column container, capturing the created handle in out. | |
Namespaces | |
| namespace | ultralight |
| Root namespace for every public Ultralight type, function, and enumeration. | |