载入中...
搜索中...
未找到
Widget.h
浏览该文件的文档.
417EVENGINE_API_WORLD WidgetDesc window(std::string title, std::vector<WidgetDesc> children = {}, std::string id = "root");
421EVENGINE_API_WORLD WidgetDesc button(std::string label, std::string id = "", std::function<void()> onClick = {});
425EVENGINE_API_WORLD WidgetDesc iconButton(Icon value, std::string label = "", std::string id = "",
435EVENGINE_API_WORLD WidgetDesc checkbox(std::string label, bool checked = false, std::string id = "",
439EVENGINE_API_WORLD WidgetDesc slider(std::string label, float value, float minV, float maxV, std::string id = "",
443EVENGINE_API_WORLD WidgetDesc progress(float fraction, std::string id = "", std::string overlay = "");
446EVENGINE_API_WORLD WidgetDesc combo(std::string label, std::vector<std::string> options, int selected,
463EVENGINE_API_WORLD WidgetDesc viewport(std::string id = "", float width = 0.f, float height = 0.f);
465EVENGINE_API_WORLD WidgetDesc inputText(std::string label, std::string value, std::string id = "",
469EVENGINE_API_WORLD WidgetDesc searchField(std::string hint, std::string value = {}, std::string id = "",
473EVENGINE_API_WORLD WidgetDesc toggleSwitch(std::string label, bool checked = false, std::string id = "",
484EVENGINE_API_WORLD WidgetDesc colorPalette(std::string label, float r, float g, float b, float a = 1.f,
491EVENGINE_API_WORLD WidgetDesc menuBar(std::vector<WidgetDesc> children = {}, std::string id = "");
493EVENGINE_API_WORLD WidgetDesc menu(std::string label, std::vector<WidgetDesc> children = {}, std::string id = "");
495EVENGINE_API_WORLD WidgetDesc menuItem(std::string label, std::string shortcut = {}, std::string id = "",
499EVENGINE_API_WORLD WidgetDesc toolbar(std::vector<WidgetDesc> children = {}, std::string id = "");
501EVENGINE_API_WORLD WidgetDesc toolbox(std::vector<WidgetDesc> children = {}, std::string id = "", float cellSize = 0.f,
504EVENGINE_API_WORLD WidgetDesc sidebar(std::vector<WidgetDesc> children = {}, std::string id = "", float width = 0.f);
506EVENGINE_API_WORLD WidgetDesc statusBar(std::vector<WidgetDesc> children = {}, std::string id = "");
512EVENGINE_API_WORLD WidgetDesc splitPane(FlexDirection direction, WidgetDesc first, WidgetDesc second,
517EVENGINE_API_WORLD WidgetDesc collapsingHeader(std::string label, std::vector<WidgetDesc> children = {},
520EVENGINE_API_WORLD WidgetDesc child(std::string id, std::vector<WidgetDesc> children = {}, float width = 0.f,
528EVENGINE_API_WORLD WidgetDesc scrollList(std::string id, std::vector<WidgetDesc> children = {}, float height = 0.f,
532EVENGINE_API_WORLD WidgetDesc virtualList(std::string listId, const std::vector<std::string> &items,
536EVENGINE_API_WORLD WidgetDesc flex(FlexDirection direction, std::vector<WidgetDesc> children = {}, std::string id = "");
540EVENGINE_API_WORLD WidgetDesc column(std::vector<WidgetDesc> children = {}, std::string id = "");
542EVENGINE_API_WORLD WidgetDesc grid(int columns, std::vector<WidgetDesc> children = {}, std::string id = "");
560EVENGINE_API_WORLD WidgetDesc listButtons(std::string listId, const std::vector<std::string> &items);
Definition Component.cpp:5
WidgetDesc collapsingHeader(std::string label, std::vector< WidgetDesc > children, std::string id, bool defaultOpen)
Collapsible header containing child widgets.
Definition Widget.cpp:623
WidgetDesc menuItem(std::string label, std::string shortcut, std::string id, std::function< void()> onClick, bool selected)
Selectable menu command with an optional shortcut hint.
Definition Widget.cpp:550
WidgetDesc badge(std::string label, std::string id)
Compact status/category pill. Tint controls its background color.
Definition Widget.cpp:489
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 statusBar(std::vector< WidgetDesc > children, std::string id)
Compact horizontal status strip; Spacer children absorb free width.
Definition Widget.cpp:596
WidgetDesc slider(std::string label, float value, float minV, float maxV, std::string id, std::function< void(float)> onValue)
Horizontal slider; fires onValue.
Definition Widget.cpp:365
FlexWrap
Whether Flex children remain on one line or wrap onto additional lines.
Definition UIHost.h:61
@ NoWrap
WidgetDesc whenElse(bool cond, WidgetDesc ifTrue, WidgetDesc ifFalse)
When else.
Definition Widget.cpp:711
WidgetDesc imageButton(std::string id, float width, float height, std::function< void()> onClick)
Image button.
Definition Widget.cpp:432
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 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
WidgetDesc child(std::string id, std::vector< WidgetDesc > children, float width, float height)
Scrollable child region with an explicit size.
Definition Widget.cpp:635
@ Text
WidgetDesc when(bool cond, WidgetDesc child)
Conditional: include child only when cond is true (empty group otherwise).
Definition Widget.cpp:706
WidgetDesc toolbar(std::vector< WidgetDesc > children, std::string id)
Horizontal editor command strip; Spacer children absorb free width.
Definition Widget.cpp:563
WidgetDesc menu(std::string label, std::vector< WidgetDesc > children, std::string id)
Popup menu container used inside a MenuBar or another Menu.
Definition Widget.cpp:540
WidgetDesc progress(float fraction, std::string id, std::string overlay)
Progress bar; fraction is clamped to [0,1].
Definition Widget.cpp:395
@ Start
WidgetDesc colorPalette(std::string label, float r, float g, float b, float a, std::string id, std::function< void(float)> onValue)
Color editor with a swatch grid (调色板). RGBA is stored in tint channels. valueText may list extra swat...
Definition Widget.cpp:379
WidgetDesc ninePatchPanel(std::vector< WidgetDesc > children, std::string id, uint64_t textureId)
Stretchable textured container with asset-defined content padding.
Definition Widget.cpp:511
WidgetDesc iconButton(Icon value, std::string label, std::string id, std::function< void()> onClick)
Button containing a semantic icon and optional visible label.
Definition Widget.cpp:323
WidgetDesc grid(int columns, std::vector< WidgetDesc > children, std::string id)
Fixed-column grid; children are placed in source order.
Definition Widget.cpp:687
@ Inherit
WidgetDesc listButtons(std::string listId, const std::vector< std::string > &items)
Default list: one Button per item, id = listId + "/" + index.
Definition Widget.cpp:728
WidgetDesc searchField(std::string hint, std::string value, std::string id, std::function< void(const std::string &)> onChange)
Compact search field with placeholder text and a bundled search icon.
Definition Widget.cpp:465
WidgetDesc button(std::string label, std::string id, std::function< void()> onClick)
Clickable button; fires onClick.
Definition Widget.cpp:311
WidgetDesc flex(FlexDirection direction, std::vector< WidgetDesc > children, std::string id)
Elastic layout container (row/column). Prefer row / column shorthands.
Definition Widget.cpp:669
WidgetDesc toggleSwitch(std::string label, bool checked, std::string id, std::function< void(bool)> onToggle)
Modern boolean toggle; fires onToggle when changed.
Definition Widget.cpp:477
WidgetDesc sidebar(std::vector< WidgetDesc > children, std::string id, float width)
Vertical editor side panel. Width defaults to 240 logical pixels.
Definition Widget.cpp:586
WidgetDesc card(std::vector< WidgetDesc > children, std::string id)
Bordered surface container with editor-friendly padding.
Definition Widget.cpp:502
@ Visible
bool applyTreeReconcile(UIHost *host, WidgetDesc root)
Patch by key/id when structure (type + child keys) matches; otherwise full replace....
Definition Widget.cpp:748
WidgetDesc row(std::vector< WidgetDesc > children, std::string id)
Horizontal elastic layout row.
Definition Widget.cpp:679
@ Start
WidgetDesc virtualList(std::string listId, const std::vector< std::string > &items, float height, float itemHeight)
Virtual list.
Definition Widget.cpp:658
WidgetDesc toolbox(std::vector< WidgetDesc > children, std::string id, float cellSize, int columns)
Wrapping grid of editor tools with uniform square cells.
Definition Widget.cpp:574
WidgetDesc scrollList(std::string id, std::vector< WidgetDesc > children, float height, float itemHeight)
Scroll list.
Definition Widget.cpp:646
WidgetDesc splitPane(FlexDirection direction, WidgetDesc first, WidgetDesc second, float ratio, std::string id, std::function< void(float)> onResize)
Two resizable panes separated by a drag handle.
Definition Widget.cpp:607
WidgetDesc sectionHeader(std::string label, std::string id)
Non-collapsible editor section heading with an accent marker.
Definition Widget.cpp:522
WidgetDesc sameLine(std::string id)
Holds the next widget on the same line as the previous one.
Definition Widget.cpp:337
WidgetDesc list(std::string listId, const std::vector< std::string > &items, const std::function< WidgetDesc(const std::string &, int)> &itemFn)
Expand a string list into a Group of item widgets. itemFn(label, index) builds each row; keys default...
Definition Widget.cpp:715
WidgetDesc menuBar(std::vector< WidgetDesc > children, std::string id)
Window menu bar container. Must be a direct child of a Window.
Definition Widget.cpp:531
Declarative widget description (build once / on dirty → flatten into UIHost::Tree).
Definition Widget.h:15
WidgetDesc & withNinePatch(float l, float t, float r, float b)
With nine patch.
Definition Widget.h:303
WidgetDesc & withAbsolute(float ax, float ay, float x=0.f, float y=0.f)
With absolute.
Definition Widget.h:277
WidgetDesc & withTextChange(std::function< void(const std::string &)> fn)
With text change.
Definition Widget.h:402
WidgetDesc & withMouseFilter(MouseFilter v)
Selects whether pointer input stops, passes through, or ignores this widget.
Definition Widget.h:154
WidgetDesc & withAccessibility(AccessibilityRole role, std::string name, std::string description={})
Supplies the semantic role and labels exposed to accessibility clients.
Definition Widget.h:184
WidgetDesc & withFocusOrder(std::string previous, std::string next)
Assigns explicit previous and next focus-neighbor widget identifiers.
Definition Widget.h:169
std::string accessibilityDescription
Definition Widget.h:40
WidgetDesc & withDropTarget(std::string acceptedType)
Marks this widget as a desktop drop target for one type or "*".
Definition Widget.h:199
WidgetDesc & withFocusNeighbors(std::string left, std::string right, std::string up, std::string down)
Assigns explicit directional focus-neighbor widget identifiers.
Definition Widget.h:175
WidgetDesc & withDragSource(std::string payloadType, std::string payloadText)
Marks this widget as a desktop drag source with an owning text payload.
Definition Widget.h:192
WidgetDesc & withStyleClass(std::string v)
Applies a named sparse style class resolved when the tree is built.
Definition Widget.h:266
WidgetDesc & withTheme(ThemePreset v)
Overrides the built-in theme for this widget subtree.
Definition Widget.h:159
WidgetDesc & withFocusMode(FocusMode v)
Selects how the widget participates in keyboard focus navigation.
Definition Widget.h:149
WidgetDesc & withTabIndex(int v)
Sets the stable ordering hint used by sequential focus traversal.
Definition Widget.h:164