|
| Builder (LayoutNode &active_layout_node) |
|
| Builder (ScreenGraph &screen_graph) |
|
virtual | ~Builder ()=default |
|
void | setActiveLayout (bwScreenGraph::LayoutNode &) |
| Activate a layout node. More...
|
|
template<typename _LayoutType , typename... _Args> |
auto | addLayout (_Args &&... __args) -> LayoutNode & |
| Add and activate a child node for a layout created in-place. More...
|
|
template<typename _LayoutType , typename... _Args> |
auto | buildLayout (BuildFunc<> build_func, _Args &&... __args) -> LayoutNode & |
| Build a sub-layout node in-place using build_func. More...
|
|
template<typename _LayoutType , typename _BuilderType , typename... _Args> |
auto | buildLayout (BuildFunc< _BuilderType > build_func, _Args &&... __args) -> LayoutNode & |
| Build a sub-layout node in-place using build_func. More...
|
|
template<typename _WidgetType , typename... _Args> |
auto | addWidget (_Args &&... __args) -> _WidgetType & |
|
template<typename _WidgetType , typename... _Args> |
auto | addContainer (std::unique_ptr< bwLayoutInterface > layout, _Args &&... __args) -> ContainerNode & |
|
template<typename _WidgetType , typename... _Args> |
auto | buildContainer (BuildFunc<> build_func, std::unique_ptr< bwLayoutInterface > layout, _Args &&... __args) -> ContainerNode & |
| Build a container node in-place using build_func. More...
|
|
template<typename _WidgetType , typename _BuilderType , typename... _Args> |
auto | buildContainer (BuildFunc< _BuilderType > build_func, std::unique_ptr< bwLayoutInterface > layout, _Args &&... __args) -> ContainerNode & |
| Build a container node in-place using build_func. More...
|
|
Helper class to construct screen-graphs.
Use this to create all screen-graphs or sub-trees.
addFoo
functions add a node and constructs its item (widget or layout) in-place. That means arguments are passed to the function are forwarded to the widget or layout constructor.
buildFoo
functions do the same but allow specifying a build-function for sub-layouts. This is the prefered way to construct sub-layouts, because the builder manages all state. For the caller it's a stateless way to build.
template<typename _WidgetType , typename _BuilderType , typename... _Args>
Build a container node in-place using build_func.
This override passes a custom builder type to the build_func (must inherit from Builder).
Only creates widget in-place, layout still needs to be created by the caller. Otherwise, we'd have to do perfect forwarding of parameters to multiple constructors. This can be done (e.g. see https://cpptruths.blogspot.com/2012/06/perfect-forwarding-of-parameter-groups.html) but in the end, just letting the caller create the layout is less verbose and easier to understand.
- Parameters
-
build_func | Callback to create the subtree for this container. |