|
ZenitUI
Retained-mode C++20 UI framework
|
Root handle returned by build / instantiate: root node + build context + wiring helpers. More...
#include <ZMarkup.hpp>
Public Member Functions | |
| UINode (std::shared_ptr< Layout > root, std::shared_ptr< BuildContext > ctx) | |
| std::shared_ptr< Layout > | root () const |
| std::shared_ptr< BuildContext > | context () const |
| WeakUINode | weak () const |
| Return a non-owning WeakUINode safe to capture in child callbacks. | |
| std::shared_ptr< Layout > | find (const std::string &id) const |
| Look up a node by its #id. | |
| template<typename T = Layout> | |
| std::shared_ptr< T > | find (const std::string &id) const |
| Typed find: casts the result to T. | |
| template<typename T = Layout> | |
| std::shared_ptr< T > | ref (const std::string &name) const |
| Look up a live node by @ref. | |
| template<typename T = Layout> | |
| std::vector< std::shared_ptr< T > > | refAll (const std::string &name) const |
| Return every live node sharing the given @ref. | |
| UINode & | onClick (const std::string &id, std::function< void()> cb) |
| UINode & | onPress (const std::string &id, std::function< void()> cb) |
| UINode & | onRelease (const std::string &id, std::function< void()> cb) |
| UINode & | onHoverEnter (const std::string &id, std::function< void()> cb) |
| UINode & | onHoverExit (const std::string &id, std::function< void()> cb) |
| UINode & | onValueChanged (const std::string &id, std::function< void(float)> cb) |
| UINode & | onToggle (const std::string &id, std::function< void(bool)> cb) |
| UINode & | setTextRef (const std::string &refName, const std::string &text) |
| UINode & | setButtonTextRef (const std::string &refName, const std::string &text) |
| UINode & | addClassRef (const std::string &refName, const std::string &cls) |
| UINode & | removeClassRef (const std::string &refName, const std::string &cls) |
| UINode & | toggleClassRef (const std::string &refName, const std::string &cls, bool active) |
| UINode & | setEnabledRef (const std::string &refName, bool enabled) |
| UINode & | setInteractiveRef (const std::string &refName, bool interactive) |
| UINode & | setVisibleRef (const std::string &refName, bool visible) |
| UINode & | onClickRef (const std::string &refName, std::function< void()> cb) |
| UINode & | onPressRef (const std::string &refName, std::function< void()> cb) |
| UINode & | onReleaseRef (const std::string &refName, std::function< void()> cb) |
| UINode & | onHoverEnterRef (const std::string &refName, std::function< void()> cb) |
| UINode & | onHoverExitRef (const std::string &refName, std::function< void()> cb) |
| UINode & | onTextChangedRef (const std::string &refName, std::function< void(const std::string &)> cb) |
| UINode & | onValueChangedRef (const std::string &refName, std::function< void(float)> cb) |
| UINode & | onToggleRef (const std::string &refName, std::function< void(bool)> cb) |
| UINode & | setCondition (const std::string &condRef, bool value) |
| UINode & | bindCondition (const std::string &condRef, Bindable< bool > &source, bool fireImmediately=true) |
| template<typename Range, typename Fn> | |
| UINode & | syncEach (const std::string &eachRef, const Range &items, Fn &&binder) |
| template<typename T, typename Fn> | |
| UINode & | bindEach (const std::string &eachRef, Bindable< std::vector< T > > &source, Fn binder, bool fireImmediately=true) |
| template<typename Range, typename KeyFn, typename OnCreateFn, typename OnUpdateFn> | |
| UINode & | syncEachKeyed (const std::string &eachRef, const Range &items, KeyFn &&keyFn, OnCreateFn &&onCreate, OnUpdateFn &&onUpdate) |
| template<typename T, typename KeyFn, typename OnCreateFn, typename OnUpdateFn> | |
| UINode & | bindEachKeyed (const std::string &eachRef, Bindable< std::vector< T > > &source, KeyFn keyFn, OnCreateFn onCreate, OnUpdateFn onUpdate, bool fireImmediately=true) |
Root handle returned by build / instantiate: root node + build context + wiring helpers.
| std::shared_ptr< Layout > ZenitUI::ZMarkup::UINode::find | ( | const std::string & | id | ) | const |
Look up a node by its #id.
| WeakUINode ZenitUI::ZMarkup::UINode::weak | ( | ) | const |
Return a non-owning WeakUINode safe to capture in child callbacks.
Lazily binds this BuildContext's lifetime to root_ so the context stays alive as long as the root remains mounted in the UI tree.