载入中...
搜索中...
未找到
PropertyView.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
6#include "ui/Component.h"
7
8#include <functional>
9#include <string>
10
11namespace eve::ui {
12
15 std::string idPrefix = "property/";
16 std::string title;
17 bool showAdvanced = false;
18 bool showEditorOnly = false;
19 bool showReadOnly = true;
20 bool groupCategories = true;
28 std::function<void()> onStructureChange;
29};
30
32std::string propertyWidgetId(const PropertyViewOptions &options, const std::string &path);
33
36 const PropertyViewOptions &options = {});
37
46 const PropertyViewOptions &options = {});
47
49EVENGINE_API_WORLD void syncPropertyView(UIHost &host, const property_access::IPropertyAccess &model,
50 const PropertyViewOptions &options = {});
51
54public:
58 ~PropertyComponent() override = default;
59
71 property_access::IPropertyAccess *model() const { return model_; }
73 void setOptions(PropertyViewOptions options);
75 WidgetDesc build() override;
76
77private:
78 void observe();
79
80 property_access::IPropertyAccess *model_ = nullptr;
81 PropertyViewOptions options_;
83};
84
85} // namespace eve::ui
#define EVENGINE_API_WORLD
Definition Export.h:109
std::string path
Definition PlayHost.cpp:110
glm::mat4 model
const SquirrelValueOptions & options
UIHostHandle host
Move-only RAII token that owns one observer registration.
Renderer- and transaction-independent MVVM property surface.
React-style UI component: implement build(), call setState / markDirty, then rebuild()....
Definition Component.h:17
Component wrapper that becomes dirty when its bound model changes.
property_access::IPropertyAccess * model() const
Return the currently bound property model, or null when unbound.
~PropertyComponent() override=default
Property component.
WidgetDesc buildPropertyView(property_access::IPropertyAccess &model, const PropertyViewOptions &options)
Generate a declarative, two-way property view from any model schema.
std::string propertyWidgetId(const PropertyViewOptions &options, const std::string &path)
Return the stable widget id generated for a property path.
WidgetDesc buildPropertyField(property_access::IPropertyAccess &model, const std::string &path, const PropertyViewOptions &options)
Generate one field from a model property, or a diagnostic text row.
void syncPropertyView(UIHost &host, const property_access::IPropertyAccess &model, const PropertyViewOptions &options)
Pull current model values into an existing compatible UI tree.
Policy controlling schema-to-widget generation for a UI shell.
std::function< void()> onStructureChange
Optional callback after Array/Map structural mutations (append/remove).
Declarative widget description (build once / on dirty → flatten into UIHost::Tree).
Definition Widget.h:15