载入中...
搜索中...
未找到
DatabasePanel.cpp
浏览该文件的文档.
125eve::Result<ObjectHandle> DatabasePanel::registerObject(const ssq::Object& object, const std::string& label) {
178 cell = checkbox(label, value.asBool(), id, [this, entryHandle = entry.handle, name = member.name](bool v) {
228 [this, entryHandle = entry.handle, name = member.name, kind = value.kind](const std::string& text) {
262 button("+", "db_add", [this]() { createInstance().ignore("create UI database row from button"); }),
284 "x##db_" + std::to_string(entry.handle.packed()), "db_del_" + std::to_string(entry.handle.packed()),
285 [this, entryHandle = entry.handle]() { unregister(entryHandle).ignore("delete UI database row"); }));
std::map< std::string, std::span< const std::uint8_t > > members
Definition UnityPackage.cpp:81
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Runtime * runtime()
Active runtime associated with the last expose() call, or nullptr. @ownership Borrowed; the embedding...
Definition Module.cpp:292
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
constexpr std::uint64_t packed() const noexcept
Encodes the two coordinates for a legacy integer boundary.
Definition RuntimeHandle.h:183
bool writeProperty(const ssq::Object &instance, const std::string &name, const ReflectedValue &value) const
Writes one property of a live instance.
Definition Runtime.cpp:732
ReflectedValue readProperty(const ssq::Object &instance, const std::string &name) const
Reads one property of a live instance.
Definition Runtime.cpp:716
eve::Result< ObjectHandle > registerObject(const ssq::Object &object, const std::string &label={})
Registers a live script object (auto-derives class when empty).
Definition DatabasePanel.cpp:125
bool selectClass(const std::string &name)
Selects a class for the grid.
Definition DatabasePanel.cpp:100
bool isOpen() const
True while the database host is mounted and visible.
Definition DatabasePanel.cpp:77
UIHostHandle host() const noexcept
Returns the mounted database host handle, or an empty handle until open().
Definition DatabasePanel.h:45
void open()
Mounts (or updates) the database host on the UI ECS world.
Definition DatabasePanel.cpp:61
eve::Result< void > unregister(ObjectHandle handle)
Removes an entry from the registry and refreshes the grid.
Definition DatabasePanel.cpp:136
eve::Result< ObjectHandle > createInstance()
Creates and registers an instance of the selected class.
Definition DatabasePanel.cpp:110
eve::Result< ObjectHandle > create(const std::string &className)
Creates a class instance through the active Runtime and registers it.
Definition ObjectRegistry.cpp:75
static ObjectRegistry & instance()
Returns the process-local singleton owned by the UI module.
Definition ObjectRegistry.cpp:45
eve::Result< void > unregister(ObjectHandle handle)
Removes a live entry and advances its slot generation.
Definition ObjectRegistry.cpp:183
std::vector< ObjectEntry > entries(const std::string &className) const
Entries of a class, in registration order.
Definition ObjectRegistry.cpp:265
eve::Result< ObjectHandle > registerObject(const std::string &className, const ssq::Object &object, const std::string &label={})
Registers an existing live script instance.
Definition ObjectRegistry.cpp:98
static UIHostHandle createHost(const std::string &name="")
Creates an ECS-owned UI host.
Definition UIHost.cpp:48
static eve::OptionalRef< UIHost > resolve(UIHostHandle handle) noexcept
Resolves a UI host handle with ECS generation checking.
Definition UIHost.cpp:61
Definition Component.cpp:5
WidgetDesc checkbox(std::string label, bool checked, std::string id, std::function< void(bool)> onToggle)
Checkbox with a label; fires onToggle.
Definition Widget.cpp:353
WidgetDesc combo(std::string label, std::vector< std::string > options, int selected, std::string id, std::function< void(float)> onValue)
Combo.
Definition Widget.cpp:405
WidgetDesc inputText(std::string label, std::string value, std::string id, std::function< void(const std::string &)> onChange)
Editable text field; fires onTextChange.
Definition Widget.cpp:453
WidgetDesc window(std::string title, std::vector< WidgetDesc > children, std::string id)
Top-level window widget with a title bar.
Definition Widget.cpp:292
WidgetDesc spacer(std::string id, float grow)
Flexible empty space; default flexGrow=1 so it absorbs free space in a Flex parent.
Definition Widget.cpp:697
eve::RuntimeHandle< UiObjectHandleTag > ObjectHandle
Generation-qualified identity for one live UI database object.
Definition ObjectRegistry.h:28
WidgetDesc row(std::vector< WidgetDesc > children, std::string id)
Horizontal elastic layout row.
Definition Widget.cpp:679
WidgetDesc scrollList(std::string id, std::vector< WidgetDesc > children, float height, float itemHeight)
Scroll list.
Definition Widget.cpp:646
@ InvalidArgument
@ Applied
std::string reflectedFloatString(double value)
Shortest round-trip float formatting (portable).
Definition Runtime.h:33
std::string attrString(const std::string &name, const std::string &def={}) const
Raw string attribute value; def when missing.
Definition Runtime.cpp:358
ssq::Object object
Rooted script instance owned by the registry while live.
Definition ObjectRegistry.h:39
ObjectHandle handle
Generation-qualified handle for the live registry slot.
Definition ObjectRegistry.h:33
Declarative widget description (build once / on dirty → flatten into UIHost::Tree).
Definition Widget.h:15