载入中...
搜索中...
未找到
Widget.cpp 文件参考
#include "ui/Widget.h"

浏览源代码.

命名空间

namespace  eve
 
namespace  eve::ui
 

函数

WidgetDesc eve::ui::window (std::string title, std::vector< WidgetDesc > children={}, std::string id="root")
 Top-level window widget with a title bar.
 
WidgetDesc eve::ui::text (std::string content, std::string id="")
 Static text label.
 
WidgetDesc eve::ui::button (std::string label, std::string id="", std::function< void()> onClick={})
 Clickable button; fires onClick.
 
WidgetDesc eve::ui::group (std::vector< WidgetDesc > children={}, std::string id="")
 Plain group container.
 
WidgetDesc eve::ui::sameLine (std::string id="")
 Holds the next widget on the same line as the previous one.
 
WidgetDesc eve::ui::separator (std::string id="")
 Horizontal separator line.
 
WidgetDesc eve::ui::checkbox (std::string label, bool checked=false, std::string id="", std::function< void(bool)> onToggle={})
 Checkbox with a label; fires onToggle.
 
WidgetDesc eve::ui::slider (std::string label, float value, float minV, float maxV, std::string id="", std::function< void(float)> onValue={})
 Horizontal slider; fires onValue.
 
WidgetDesc eve::ui::progress (float fraction, std::string id="", std::string overlay="")
 Progress bar; fraction is clamped to [0,1].
 
WidgetDesc eve::ui::combo (std::string label, std::vector< std::string > options, int selected, std::string id, std::function< void(int)> onValue)
 
WidgetDesc eve::ui::image (std::string id, float width, float height, std::function< void()> onClick)
 
WidgetDesc eve::ui::imageButton (std::string id, float width, float height, std::function< void()> onClick)
 
WidgetDesc eve::ui::viewport (std::string id, float width, float height)
 
WidgetDesc eve::ui::inputText (std::string label, std::string value, std::string id="", std::function< void(const std::string &)> onChange={})
 Editable text field; fires onTextChange.
 
WidgetDesc eve::ui::collapsingHeader (std::string label, std::vector< WidgetDesc > children={}, std::string id="", bool defaultOpen=true)
 Collapsible header containing child widgets.
 
WidgetDesc eve::ui::child (std::string id, std::vector< WidgetDesc > children={}, float width=0.f, float height=120.f)
 Scrollable child region with an explicit size.
 
WidgetDesc eve::ui::scrollList (std::string id, std::vector< WidgetDesc > children, float height, float itemHeight)
 
WidgetDesc eve::ui::virtualList (std::string listId, const std::vector< std::string > &items, float height, float itemHeight)
 
WidgetDesc eve::ui::flex (FlexDirection direction, std::vector< WidgetDesc > children={}, std::string id="")
 Elastic layout container (row/column). Prefer row / column shorthands.
 
WidgetDesc eve::ui::row (std::vector< WidgetDesc > children={}, std::string id="")
 Horizontal elastic layout row.
 
WidgetDesc eve::ui::column (std::vector< WidgetDesc > children={}, std::string id="")
 Vertical elastic layout column.
 
WidgetDesc eve::ui::spacer (std::string id="", float grow=1.f)
 Flexible empty space; default flexGrow=1 so it absorbs free space in a Flex parent.
 
WidgetDesc eve::ui::when (bool cond, WidgetDesc child)
 Conditional: include child only when cond is true (empty group otherwise).
 
WidgetDesc eve::ui::whenElse (bool cond, WidgetDesc ifTrue, WidgetDesc ifFalse)
 
WidgetDesc eve::ui::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 to id.
 
WidgetDesc eve::ui::listButtons (std::string listId, const std::vector< std::string > &items)
 Default list: one Button per item, id = listId + "/" + index.
 
void eve::ui::applyTree (UIHost *host, WidgetDesc root)
 Full replace flatten.
 
bool eve::ui::applyTreeReconcile (UIHost *host, WidgetDesc root)
 Patch by key/id when structure (type + child keys) matches; otherwise full replace. Returns true if a structural rebuild occurred.