载入中...
搜索中...
未找到
Widget.h
浏览该文件的文档.
448EVENGINE_API_WORLD WidgetDesc window(std::string title, std::vector<WidgetDesc> children = {}, std::string id = "root");
452EVENGINE_API_WORLD WidgetDesc button(std::string label, std::string id = "", std::function<void()> onClick = {});
456EVENGINE_API_WORLD WidgetDesc iconButton(Icon value, std::string label = "", std::string id = "",
466EVENGINE_API_WORLD WidgetDesc checkbox(std::string label, bool checked = false, std::string id = "",
470EVENGINE_API_WORLD WidgetDesc slider(std::string label, float value, float minV, float maxV, std::string id = "",
474EVENGINE_API_WORLD WidgetDesc progress(float fraction, std::string id = "", std::string overlay = "");
477EVENGINE_API_WORLD WidgetDesc combo(std::string label, std::vector<std::string> options, int selected,
491EVENGINE_API_WORLD WidgetDesc filledImage(std::string id, float width, float height, float fraction);
496EVENGINE_API_WORLD WidgetDesc radialFill(std::string id, float width, float height, float fraction);
499EVENGINE_API_WORLD WidgetDesc resourceBar(std::string id, float width, float height, float fraction);
503EVENGINE_API_WORLD WidgetDesc skillSlot(std::string id, float size, uint64_t iconTexture, float cooldown,
512EVENGINE_API_WORLD WidgetDesc viewport(std::string id = "", float width = 0.f, float height = 0.f);
514EVENGINE_API_WORLD WidgetDesc inputText(std::string label, std::string value, std::string id = "",
524EVENGINE_API_WORLD WidgetDesc searchField(std::string hint, std::string value = {}, std::string id = "",
528EVENGINE_API_WORLD WidgetDesc toggleSwitch(std::string label, bool checked = false, std::string id = "",
539EVENGINE_API_WORLD WidgetDesc colorPalette(std::string label, float r, float g, float b, float a = 1.f,
546EVENGINE_API_WORLD WidgetDesc menuBar(std::vector<WidgetDesc> children = {}, std::string id = "");
548EVENGINE_API_WORLD WidgetDesc menu(std::string label, std::vector<WidgetDesc> children = {}, std::string id = "");
550EVENGINE_API_WORLD WidgetDesc menuItem(std::string label, std::string shortcut = {}, std::string id = "",
554EVENGINE_API_WORLD WidgetDesc toolbar(std::vector<WidgetDesc> children = {}, std::string id = "");
556EVENGINE_API_WORLD WidgetDesc toolbox(std::vector<WidgetDesc> children = {}, std::string id = "", float cellSize = 0.f,
559EVENGINE_API_WORLD WidgetDesc sidebar(std::vector<WidgetDesc> children = {}, std::string id = "", float width = 0.f);
561EVENGINE_API_WORLD WidgetDesc statusBar(std::vector<WidgetDesc> children = {}, std::string id = "");
567EVENGINE_API_WORLD WidgetDesc splitPane(FlexDirection direction, WidgetDesc first, WidgetDesc second,
577EVENGINE_API_WORLD WidgetDesc tab(std::string label, std::string pageId, bool selected = false, std::string id = "",
580EVENGINE_API_WORLD WidgetDesc tabBar(std::vector<WidgetDesc> children = {}, std::string id = "");
586EVENGINE_API_WORLD WidgetDesc tabContainer(std::vector<WidgetDesc> pages, std::string activePageId, std::string id = "",
592EVENGINE_API_WORLD WidgetDesc panelFrame(std::string title, std::vector<WidgetDesc> children = {}, std::string id = "");
597EVENGINE_API_WORLD WidgetDesc dockArea(std::string region, std::vector<WidgetDesc> children = {}, std::string id = "");
602EVENGINE_API_WORLD WidgetDesc appFrame(WidgetDesc body, WidgetDesc toolbar = {}, WidgetDesc statusBarWidget = {},
605EVENGINE_API_WORLD WidgetDesc collapsingHeader(std::string label, std::vector<WidgetDesc> children = {},
608EVENGINE_API_WORLD WidgetDesc child(std::string id, std::vector<WidgetDesc> children = {}, float width = 0.f,
616EVENGINE_API_WORLD WidgetDesc scrollList(std::string id, std::vector<WidgetDesc> children = {}, float height = 0.f,
620EVENGINE_API_WORLD WidgetDesc virtualList(std::string listId, const std::vector<std::string> &items,
624EVENGINE_API_WORLD WidgetDesc flex(FlexDirection direction, std::vector<WidgetDesc> children = {}, std::string id = "");
628EVENGINE_API_WORLD WidgetDesc column(std::vector<WidgetDesc> children = {}, std::string id = "");
630EVENGINE_API_WORLD WidgetDesc grid(int columns, std::vector<WidgetDesc> children = {}, std::string id = "");
648EVENGINE_API_WORLD WidgetDesc listButtons(std::string listId, const std::vector<std::string> &items);
Definition Component.cpp:7
WidgetDesc collapsingHeader(std::string label, std::vector< WidgetDesc > children, std::string id, bool defaultOpen)
Collapsible header containing child widgets.
Definition Widget.cpp:814
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:642
WidgetDesc badge(std::string label, std::string id)
Compact status/category pill. Tint controls its background color.
Definition Widget.cpp:581
WidgetDesc filledImage(std::string id, float width, float height, float fraction)
Linear filled image; value is a fraction, layout retains width/height at zero fill....
Definition Widget.cpp:466
WidgetDesc checkbox(std::string label, bool checked, std::string id, std::function< void(bool)> onToggle)
Checkbox with a label; fires onToggle.
Definition Widget.cpp:387
WidgetDesc tabBar(std::vector< WidgetDesc > children, std::string id)
Horizontal strip of Tab children.
Definition Widget.cpp:728
WidgetDesc combo(std::string label, std::vector< std::string > options, int selected, std::string id, std::function< void(float)> onValue)
Combo.
Definition Widget.cpp:439
WidgetDesc statusBar(std::vector< WidgetDesc > children, std::string id)
Compact horizontal status strip; Spacer children absorb free width.
Definition Widget.cpp:688
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:399
WidgetDesc panelFrame(std::string title, std::vector< WidgetDesc > children, std::string id)
Fixed titled panel chrome for dock regions (not a free-floating Window host).
Definition Widget.cpp:767
FlexWrap
Whether Flex children remain on one line or wrap onto additional lines.
Definition UIHost.h:83
@ NoWrap
WidgetDesc whenElse(bool cond, WidgetDesc ifTrue, WidgetDesc ifFalse)
When else.
Definition Widget.cpp:902
WidgetDesc imageButton(std::string id, float width, float height, std::function< void()> onClick)
Image button.
Definition Widget.cpp:512
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:533
WidgetDesc tabContainer(std::vector< WidgetDesc > pages, std::string activePageId, std::string id, std::function< void(const std::string &)> onSelect)
Tab strip plus page bodies; only the active page is visible.
Definition Widget.cpp:739
WidgetDesc resourceBar(std::string id, float width, float height, float fraction)
Composes a display-only resource bar; child IDs are /background, /trail, /value and /label....
Definition Widget.cpp:481
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:888
WidgetDesc child(std::string id, std::vector< WidgetDesc > children, float width, float height)
Scrollable child region with an explicit size.
Definition Widget.cpp:826
@ Text
WidgetDesc when(bool cond, WidgetDesc child)
Conditional: include child only when cond is true (empty group otherwise).
Definition Widget.cpp:897
WidgetDesc appFrame(WidgetDesc body, WidgetDesc toolbarWidget, WidgetDesc statusBarWidget, std::string id)
Fixed editor frame: optional toolbar, growing body, optional status bar. Place as a Window child (Men...
Definition Widget.cpp:793
WidgetDesc toolbar(std::vector< WidgetDesc > children, std::string id)
Horizontal editor command strip; Spacer children absorb free width.
Definition Widget.cpp:655
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:632
WidgetDesc skillSlot(std::string id, float size, uint64_t iconTexture, float cooldown, std::string key)
Composes an interactive skill slot; /activate emits clicks, /cooldown is a solid radial overlay....
Definition Widget.cpp:497
@ 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:413
WidgetDesc ninePatchPanel(std::vector< WidgetDesc > children, std::string id, uint64_t textureId)
Stretchable textured container with asset-defined content padding.
Definition Widget.cpp:603
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:357
WidgetDesc grid(int columns, std::vector< WidgetDesc > children, std::string id)
Fixed-column grid; children are placed in source order.
Definition Widget.cpp:878
@ Inherit
WidgetDesc listButtons(std::string listId, const std::vector< std::string > &items)
Default list: one Button per item, id = listId + "/" + index.
Definition Widget.cpp:919
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:557
WidgetDesc button(std::string label, std::string id, std::function< void()> onClick)
Clickable button; fires onClick.
Definition Widget.cpp:345
WidgetDesc flex(FlexDirection direction, std::vector< WidgetDesc > children, std::string id)
Elastic layout container (row/column). Prefer row / column shorthands.
Definition Widget.cpp:860
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:569
WidgetDesc sidebar(std::vector< WidgetDesc > children, std::string id, float width)
Vertical editor side panel. Width defaults to 240 logical pixels.
Definition Widget.cpp:678
WidgetDesc card(std::vector< WidgetDesc > children, std::string id)
Bordered surface container with editor-friendly padding.
Definition Widget.cpp:594
@ Visible
bool applyTreeReconcile(UIHost *host, WidgetDesc root)
Patch by key/id when structure (type + child keys) matches; otherwise full replace....
Definition Widget.cpp:940
FillDirection
Direction of a linear image fill; geometry stays inside the original layout box.
Definition HudGeometry.h:11
WidgetDesc row(std::vector< WidgetDesc > children, std::string id)
Horizontal elastic layout row.
Definition Widget.cpp:870
@ Start
WidgetDesc virtualList(std::string listId, const std::vector< std::string > &items, float height, float itemHeight)
Virtual list.
Definition Widget.cpp:849
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:666
WidgetDesc tab(std::string label, std::string pageId, bool selected, std::string id, std::function< void()> onClick)
Selectable tab label.
Definition Widget.cpp:715
WidgetDesc scrollList(std::string id, std::vector< WidgetDesc > children, float height, float itemHeight)
Scroll list.
Definition Widget.cpp:837
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:699
WidgetDesc sectionHeader(std::string label, std::string id)
Non-collapsible editor section heading with an accent marker.
Definition Widget.cpp:614
WidgetDesc sameLine(std::string id)
Holds the next widget on the same line as the previous one.
Definition Widget.cpp:371
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:906
WidgetDesc dockArea(std::string region, std::vector< WidgetDesc > children, std::string id)
Named dock fill slot; region name is stored in valueText (left/right/top/bottom/center)....
Definition Widget.cpp:780
WidgetDesc radialFill(std::string id, float width, float height, float fraction)
Solid radial cooldown overlay; supports sectors and rings (no texture sampling). @thread UI thread....
Definition Widget.cpp:475
WidgetDesc menuBar(std::vector< WidgetDesc > children, std::string id)
Window menu bar container. Must be a direct child of a Window.
Definition Widget.cpp:623
Declarative widget description (build once / on dirty → flatten into UIHost::Tree).
Definition Widget.h:15
WidgetDesc & withHelp(std::string help, std::string reason={})
Set always-visible help and an optional disabled explanation.
Definition Widget.h:164
WidgetDesc & withNinePatch(float l, float t, float r, float b)
With nine patch.
Definition Widget.h:334
WidgetDesc & withAbsolute(float ax, float ay, float x=0.f, float y=0.f)
With absolute.
Definition Widget.h:308
WidgetDesc & withTextChange(std::function< void(const std::string &)> fn)
With text change.
Definition Widget.h:433
WidgetDesc & withMouseFilter(MouseFilter v)
Selects whether pointer input stops, passes through, or ignores this widget.
Definition Widget.h:185
WidgetDesc & withAccessibility(AccessibilityRole role, std::string name, std::string description={})
Supplies the semantic role and labels exposed to accessibility clients.
Definition Widget.h:215
WidgetDesc & withFocusOrder(std::string previous, std::string next)
Assigns explicit previous and next focus-neighbor widget identifiers.
Definition Widget.h:200
std::string accessibilityDescription
Definition Widget.h:50
WidgetDesc & withDropTarget(std::string acceptedType)
Marks this widget as a desktop drop target for one type or "*".
Definition Widget.h:230
WidgetDesc & withTextInput(bool multi, bool locked=false, std::string hint={})
Configure plain text input and its empty-input hint.
Definition Widget.h:157
WidgetDesc & withFocusNeighbors(std::string left, std::string right, std::string up, std::string down)
Assigns explicit directional focus-neighbor widget identifiers.
Definition Widget.h:206
WidgetDesc & withDragSource(std::string payloadType, std::string payloadText)
Marks this widget as a desktop drag source with an owning text payload.
Definition Widget.h:223
WidgetDesc & withStyleClass(std::string v)
Applies a named sparse style class resolved when the tree is built.
Definition Widget.h:297
WidgetDesc & withTheme(ThemePreset v)
Overrides the built-in theme for this widget subtree.
Definition Widget.h:190
WidgetDesc & withFocusMode(FocusMode v)
Selects how the widget participates in keyboard focus navigation.
Definition Widget.h:180
WidgetDesc & withTabIndex(int v)
Sets the stable ordering hint used by sequential focus traversal.
Definition Widget.h:195