33 while (widget.
next(
"Widget"))
70 if (node->
getName() ==
"Widget")
74 else if (node->
getName() ==
"Property")
78 else if (node->
getName() ==
"UserString")
84 else if (node->
getName() ==
"Controller")
90 while (prop.
next(
"Property"))
111 widgets.push_back(widget);
119 std::string_view _prefix,
123 std::string widgetName;
125 std::string_view widgetLayer = _widgetInfo.
layer;
127 if (!_widgetInfo.
name.empty())
129 widgetName = _prefix;
130 widgetName += _widgetInfo.
name;
135 if (_parent ==
nullptr && widgetLayer.empty())
139 "Root widget's layer is not specified, widget won't be visible. Specify layer or parent or attach it "
140 "to another widget after load."
158 if (
nullptr == _parent)
185 for (
const auto& property : _widgetInfo.
properties)
190 for (
const auto& userString : _widgetInfo.
userStrings)
207 for (
const auto& property : iter.properties)
209 item->
setProperty(property.first, property.second);
215 MYGUI_LOG(Warning,
"Controller '" << iter.type <<
"' not found");
#define MYGUI_LOG(level, text)
virtual void setProperty(std::string_view, std::string_view)
ControllerItem * createItem(std::string_view _type)
static ControllerManager & getInstance()
void addItem(Widget *_widget, ControllerItem *_item)
static IntCoord convertFromRelative(const FloatCoord &_coord, const IntSize &_view)
static Gui & getInstance()
Widget * createWidgetT(std::string_view _type, std::string_view _skin, const IntCoord &_coord, Align _align, std::string_view _layer, std::string_view _name={})
std::string mResourceName
static LayoutManager & getInstance()
EventHandle_AddUserStringDelegate eventAddUserString
EventHandle_CreateWidgetDelegate eventCreateWidget
static RenderManager & getInstance()
VectorWidgetInfo mLayoutData
void deserialization(xml::ElementPtr _node, Version _version) override
Widget * createWidget(const WidgetInfo &_widgetInfo, std::string_view _prefix={}, Widget *_parent=nullptr, bool _template=false)
VectorWidgetPtr createLayout(std::string_view _prefix={}, Widget *_parent=nullptr)
WidgetInfo parseWidget(xml::ElementEnumerator &_widget)
const VectorWidgetInfo & getLayoutData() const
void setUserString(std::string_view _key, std::string_view _value)
bool findAttribute(std::string_view _name, std::string &_value)
ElementEnumerator getElementEnumerator()
const std::string & getName() const
void mapSet(Map &map, std::string_view key, const Value &value)
std::vector< WidgetInfo > VectorWidgetInfo
types::TCoord< int > IntCoord
std::vector< Widget * > VectorWidgetPtr
static Align parse(std::string_view _value)
static TCoord< int > parse(std::string_view _value)