Reflection-driven database panel (DevTools, MVVM). 更多...
#include <DatabasePanel.h>
Public 成员函数 | |
| DatabasePanel ()=default | |
| ~DatabasePanel () | |
| DatabasePanel (const DatabasePanel &)=delete | |
| DatabasePanel & | operator= (const DatabasePanel &)=delete |
| void | open () |
| Mounts (or updates) the database host on the UI ECS world. | |
| void | close () |
| Hides the database host. | |
| bool | isOpen () const |
| True while the database host is mounted and visible. | |
| UIHost * | host () const |
| The mounted host (nullptr until open()); for embedding/tests. | |
| void | refresh () |
| Re-scans reflected classes and refreshes the grid. | |
| bool | selectClass (const std::string &name) |
| Selects a class for the grid. | |
| const std::string & | selectedClass () const |
| Name of the currently selected class ("" when none). | |
| uint64_t | createInstance () |
| Creates + registers an instance of the selected class. | |
| uint64_t | registerObject (const ssq::Object &object, const std::string &label={}) |
| Registers a live script object (auto-derives class when empty). | |
| bool | unregister (uint64_t id) |
| Removes an entry from the registry and refreshes the grid. | |
| void | sync () |
| Pulls model → view for visible cells (per-frame). | |
| WidgetDesc | build () |
| Declarative tree of the current selection. | |
详细描述
Reflection-driven database panel (DevTools, MVVM).
Left/top: class menu generated from reflected script classes. Below: one editable row per registered instance (ObjectRegistry), with one cell per reflected member. Cell edits write back to the live script instance; sync() pulls model changes back into the grid.
Grid cells reuse the declarative widget set (InputText / Checkbox / Combo / read-only text), so no separate table node type is needed.
在文件 DatabasePanel.h 第 29 行定义.
构造及析构函数说明
◆ DatabasePanel() [1/2]
|
default |
◆ ~DatabasePanel()
| eve::ui::DatabasePanel::~DatabasePanel | ( | ) |
在文件 DatabasePanel.cpp 第 50 行定义.
引用了 eve::ui::UIHost::setTree() , 以及 eve::ui::window().
◆ DatabasePanel() [2/2]
|
delete |
成员函数说明
◆ build()
| WidgetDesc eve::ui::DatabasePanel::build | ( | ) |
Declarative tree of the current selection.
在文件 DatabasePanel.cpp 第 231 行定义.
引用了 eve::ui::button(), c, children, eve::ui::combo(), eve::ui::ObjectEntry::id, eve::ui::ObjectEntry::object, eve::Runtime::readProperty(), eve::ui::row(), eve::ModuleManager::runtime(), eve::ui::scrollList(), eve::ui::separator(), eve::ui::spacer(), eve::ui::text(), value, eve::ui::window() , 以及 eve::ui::WidgetDesc::withSize().
◆ close()
| void eve::ui::DatabasePanel::close | ( | ) |
◆ createInstance()
| uint64_t eve::ui::DatabasePanel::createInstance | ( | ) |
Creates + registers an instance of the selected class.
在文件 DatabasePanel.cpp 第 99 行定义.
引用了 eve::ui::ObjectRegistry::create(), id , 以及 eve::ui::ObjectRegistry::instance().
◆ host()
|
inline |
The mounted host (nullptr until open()); for embedding/tests.
在文件 DatabasePanel.h 第 43 行定义.
◆ isOpen()
| bool eve::ui::DatabasePanel::isOpen | ( | ) | const |
True while the database host is mounted and visible.
在文件 DatabasePanel.cpp 第 67 行定义.
◆ open()
| void eve::ui::DatabasePanel::open | ( | ) |
Mounts (or updates) the database host on the UI ECS world.
在文件 DatabasePanel.cpp 第 56 行定义.
引用了 eve::ui::UIHost::createHost(), refresh(), eve::ui::UIHost::setLayer() , 以及 eve::ui::UIHost::setVisible().
◆ operator=()
|
delete |
◆ refresh()
| void eve::ui::DatabasePanel::refresh | ( | ) |
Re-scans reflected classes and refreshes the grid.
在文件 DatabasePanel.cpp 第 71 行定义.
引用了 cls , 以及 eve::ModuleManager::runtime().
被这些函数引用 open().
◆ registerObject()
| uint64_t eve::ui::DatabasePanel::registerObject | ( | const ssq::Object & | object, |
| const std::string & | label = {} |
||
| ) |
Registers a live script object (auto-derives class when empty).
在文件 DatabasePanel.cpp 第 109 行定义.
引用了 id, eve::ui::ObjectRegistry::instance() , 以及 eve::ui::ObjectRegistry::registerObject().
◆ selectClass()
| bool eve::ui::DatabasePanel::selectClass | ( | const std::string & | name | ) |
◆ selectedClass()
|
inline |
Name of the currently selected class ("" when none).
在文件 DatabasePanel.h 第 50 行定义.
◆ sync()
| void eve::ui::DatabasePanel::sync | ( | ) |
Pulls model → view for visible cells (per-frame).
在文件 DatabasePanel.cpp 第 294 行定义.
引用了 eve::Array, eve::ReflectedValue::asBool(), eve::ReflectedMember::attrOptions(), eve::ReflectedMember::attrString(), eve::Bool, c, eve::Instance, eve::ReflectedValue::kind, name, eve::None, eve::Other, eve::Runtime::readProperty(), eve::ModuleManager::runtime(), eve::String, eve::Table , 以及 eve::ReflectedValue::text.
◆ unregister()
| bool eve::ui::DatabasePanel::unregister | ( | uint64_t | id | ) |
Removes an entry from the registry and refreshes the grid.
在文件 DatabasePanel.cpp 第 120 行定义.
引用了 eve::ui::ObjectRegistry::instance(), removed , 以及 eve::ui::ObjectRegistry::unregister().
该类的文档由以下文件生成:
- src/modules/ui/DatabasePanel.h
- src/modules/ui/DatabasePanel.cpp