React-style UI component: implement build(), call setState / markDirty, then rebuild(). Mounts onto a named UIHost via mountAs / attach. 更多...
#include <Component.h>
Public 成员函数 | |
| virtual | ~Component ()=default |
| Component. | |
| virtual WidgetDesc | build ()=0 |
| Builds . | |
| void | attach (UIHostHandle host) |
| Attaches . | |
| void | mountAs (const std::string &hostName) |
| Mounts as. | |
| UIHostHandle | host () const noexcept |
| Returns the attached host handle, or an empty handle before attach. | |
| void | rebuild (bool forceFull=false) |
| Rebuild tree onto host (reconcile by key when possible). | |
| void | markDirty () |
| Mark dirty. | |
| bool | isDirty () const |
| True when dirty. | |
| bool | updateIfDirty () |
| If dirty, rebuild and clear flag. Returns true if rebuilt. | |
Protected 成员函数 | |
| void | setState () |
| Subclasses call after mutating local state that affects build(). | |
详细描述
React-style UI component: implement build(), call setState / markDirty, then rebuild(). Mounts onto a named UIHost via mountAs / attach.
在文件 Component.h 第 17 行定义.
构造及析构函数说明
◆ ~Component()
|
virtualdefault |
成员函数说明
◆ attach()
| void eve::ui::Component::attach | ( | UIHostHandle | host | ) |
◆ build()
|
pure virtual |
◆ host()
|
inlinenoexcept |
Returns the attached host handle, or an empty handle before attach.
在文件 Component.h 第 30 行定义.
◆ isDirty()
|
inline |
True when dirty.
在文件 Component.h 第 38 行定义.
◆ markDirty()
|
inline |
Mark dirty.
在文件 Component.h 第 36 行定义.
被这些函数引用 eve::ui::PropertyComponent::bind() , 以及 eve::ui::PropertyComponent::setOptions().
◆ mountAs()
| void eve::ui::Component::mountAs | ( | const std::string & | hostName | ) |
Mounts as.
在文件 Component.cpp 第 12 行定义.
引用了 attach(), eve::ui::UIHost::createHost(), eve::ui::UISystem::findHost(), h, rebuild() , 以及 eve::ui::UIHost::resolve().
◆ rebuild()
| void eve::ui::Component::rebuild | ( | bool | forceFull = false | ) |
Rebuild tree onto host (reconcile by key when possible).
在文件 Component.cpp 第 19 行定义.
引用了 build(), host() , 以及 eve::ui::UIHost::resolve().
被这些函数引用 mountAs() , 以及 updateIfDirty().
◆ setState()
|
inlineprotected |
Subclasses call after mutating local state that affects build().
在文件 Component.h 第 45 行定义.
◆ updateIfDirty()
| bool eve::ui::Component::updateIfDirty | ( | ) |
If dirty, rebuild and clear flag. Returns true if rebuilt.
在文件 Component.cpp 第 30 行定义.
引用了 rebuild() , 以及 eve::ui::UIHost::resolve().
该类的文档由以下文件生成:
- src/modules/ui/Component.h
- src/modules/ui/Component.cpp