41#ifndef MYGUI_DONT_USE_OBSOLETE
45 static_cast<Button*
>(
this)->setStateSelected(_value);
49 return static_cast<const Button*
>(
this)->getStateSelected();
53 static_cast<Button*
>(
this)->setStateSelected(_value);
57 return static_cast<const Button*
>(
this)->getStateSelected();
61 return static_cast<const Button*
>(
this)->_getImageBox();
65 if (
static_cast<Button*
>(
this)->_getImageBox())
70 if (
static_cast<const Button*
>(
this)->_getImageBox())
77 static_cast<ImageBox*
>(
this)->addItemFrameDuplicate(_index, _indexSourceFrame);
81 static_cast<ImageBox*
>(
this)->insertItemFrameDuplicate(_index, _indexFrame, _indexSourceFrame);
87 return static_cast<const ComboBox*
>(
this)->getIndexSelected();
91 static_cast<ComboBox*
>(
this)->setIndexSelected(_index);
95 static_cast<ComboBox*
>(
this)->clearIndexSelected();
100 static_cast<ComboBox*
>(
this)->insertItemAt(_index, _name);
104 static_cast<ComboBox*
>(
this)->setItemNameAt(_index, _item);
108 return static_cast<const ComboBox*
>(
this)->getItemNameAt(_index);
112 static_cast<ComboBox*
>(
this)->removeItemAt(_index);
116 static_cast<ComboBox*
>(
this)->removeAllItems();
120 return static_cast<const ComboBox*
>(
this)->getIndexSelected();
124 static_cast<ComboBox*
>(
this)->clearIndexSelected();
128 static_cast<ComboBox*
>(
this)->setIndexSelected(_index);
133 static_cast<ComboBox*
>(
this)->setMaxListLength(_value);
137 return static_cast<const ComboBox*
>(
this)->getMaxListLength();
143 static_cast<EditBox*
>(
this)->setVisibleVScroll(_visible);
147 return static_cast<EditBox*
>(
this)->isVisibleVScroll();
151 static_cast<EditBox*
>(
this)->setVisibleHScroll(_visible);
155 return static_cast<EditBox*
>(
this)->isVisibleHScroll();
160 static_cast<EditBox*
>(
this)->setTextIntervalColour(_start, _count, _colour);
164 _start =
static_cast<const EditBox*
>(
this)->getTextSelectionStart();
165 _end =
static_cast<const EditBox*
>(
this)->getTextSelectionEnd();
169 return static_cast<const EditBox*
>(
this)->getTextInterval(_start, _count);
173 static_cast<EditBox*
>(
this)->setTextSelection(_start, _end);
177 static_cast<EditBox*
>(
this)->deleteTextSelection();
181 return static_cast<const EditBox*
>(
this)->getTextSelection();
185 return static_cast<EditBox*
>(
this)->isTextSelection();
189 static_cast<EditBox*
>(
this)->setTextSelectionColour(_colour);
195 return static_cast<const ItemBox*
>(
this)->getIndexSelected();
199 static_cast<ItemBox*
>(
this)->setIndexSelected(_index);
203 static_cast<ItemBox*
>(
this)->clearIndexSelected();
208 static_cast<ItemBox*
>(
this)->insertItemAt(_index, _data);
212 static_cast<ItemBox*
>(
this)->setItemDataAt(_index, _data);
216 static_cast<ItemBox*
>(
this)->removeItemAt(_index);
220 static_cast<ItemBox*
>(
this)->removeAllItems();
224 return static_cast<const ItemBox*
>(
this)->getIndexSelected();
228 static_cast<ItemBox*
>(
this)->clearIndexSelected();
232 static_cast<ItemBox*
>(
this)->setIndexSelected(_index);
237 return static_cast<const ItemBox*
>(
this)->getWidgetDrag();
241 static_cast<ItemBox*
>(
this)->resetDrag();
246 static_cast<ItemBox*
>(
this)->setVerticalAlignment(_value);
250 return static_cast<const ItemBox*
>(
this)->getVerticalAlignment();
256 return static_cast<const ListBox*
>(
this)->getIndexSelected();
260 static_cast<ListBox*
>(
this)->setIndexSelected(_index);
264 static_cast<ListBox*
>(
this)->clearIndexSelected();
269 static_cast<ListBox*
>(
this)->insertItemAt(_index, _item);
273 static_cast<ListBox*
>(
this)->setItemNameAt(_index, _item);
277 return static_cast<const ListBox*
>(
this)->getItemNameAt(_index);
281 static_cast<ListBox*
>(
this)->removeItemAt(_index);
285 static_cast<ListBox*
>(
this)->removeAllItems();
289 return static_cast<ListBox*
>(
this)->findItemIndexWith(_item);
293 return static_cast<const ListBox*
>(
this)->getIndexSelected();
297 static_cast<ListBox*
>(
this)->clearIndexSelected();
301 static_cast<ListBox*
>(
this)->setIndexSelected(_index);
305 static_cast<ListBox*
>(
this)->beginToItemAt(_index);
309 static_cast<ListBox*
>(
this)->beginToItemFirst();
313 static_cast<ListBox*
>(
this)->beginToItemLast();
317 static_cast<ListBox*
>(
this)->beginToItemSelected();
321 return static_cast<ListBox*
>(
this)->isItemVisibleAt(_index, _fill);
325 return static_cast<ListBox*
>(
this)->isItemSelectedVisible(_fill);
335 static_cast<MenuControl*
>(
this)->setVisible(
false);
339 return static_cast<MenuControl*
>(
this)->getVisible();
344 static_cast<MenuControl*
>(
this)->setItemChildVisibleAt(_index,
true);
348 static_cast<MenuControl*
>(
this)->setItemChildVisible(_item,
true);
352 static_cast<MenuControl*
>(
this)->setItemChildVisibleAt(_index,
false);
356 static_cast<MenuControl*
>(
this)->setItemChildVisible(_item,
false);
361 static_cast<MenuControl*
>(
this)->setVerticalAlignment(_value);
365 return static_cast<const MenuControl*
>(
this)->getVerticalAlignment();
370 static_cast<MenuItem*
>(
this)->setItemChildVisible(
true);
374 static_cast<MenuItem*
>(
this)->setItemChildVisible(
false);
380 return static_cast<const MultiListBox*
>(
this)->getIndexSelected();
384 static_cast<MultiListBox*
>(
this)->setIndexSelected(_index);
393 return static_cast<MultiListBox*
>(
this)->findSubItemWith(_column, _name);
397 return static_cast<const MultiListBox*
>(
this)->getSubItemNameAt(_column, _index);
401 static_cast<MultiListBox*
>(
this)->setSubItemNameAt(_column, _index, _name);
405 static_cast<MultiListBox*
>(
this)->removeColumnAt(_column);
413 return static_cast<const MultiListBox*
>(
this)->getColumnWidthAt(_column);
417 return static_cast<const MultiListBox*
>(
this)->getColumnNameAt(_column);
421 static_cast<MultiListBox*
>(
this)->setColumnWidthAt(_column, _width);
429 static_cast<MultiListBox*
>(
this)->setColumnNameAt(_column, _name);
433 static_cast<MultiListBox*
>(
this)->insertColumnAt(_column, _name, _width);
437 return static_cast<const MultiListBox*
>(
this)->getIndexSelected();
445 static_cast<MultiListBox*
>(
this)->setIndexSelected(_index);
449 static_cast<MultiListBox*
>(
this)->insertItemAt(_index, _name);
453 static_cast<MultiListBox*
>(
this)->setItemNameAt(_index, _name);
457 return static_cast<const MultiListBox*
>(
this)->getItemNameAt(_index);
496 static_cast<ScrollView*
>(
this)->setVisibleVScroll(_visible);
500 return static_cast<ScrollView*
>(
this)->isVisibleVScroll();
504 static_cast<ScrollView*
>(
this)->setVisibleHScroll(_visible);
508 return static_cast<ScrollView*
>(
this)->isVisibleHScroll();
514 return static_cast<const TabControl*
>(
this)->getButtonWidthAt(_index);
518 return static_cast<const TabControl*
>(
this)->getButtonWidth(_sheet);
522 static_cast<TabControl*
>(
this)->setButtonWidthAt(_index, _width);
526 static_cast<TabControl*
>(
this)->setButtonWidth(_sheet, _width);
530 static_cast<TabControl*
>(
this)->beginToItemAt(_index);
534 static_cast<TabControl*
>(
this)->beginToItemSelected();
538 return static_cast<const TabControl*
>(
this)->getItemCount();
542 return static_cast<const TabControl*
>(
this)->getItemName(_sheet);
546 return static_cast<const TabControl*
>(
this)->getItemNameAt(_index);
550 return static_cast<const TabControl*
>(
this)->getItemAt(_index);
554 static_cast<TabControl*
>(
this)->setItemNameAt(_index, _name);
558 static_cast<TabControl*
>(
this)->setItemName(_sheet, _name);
562 return static_cast<TabControl*
>(
this)->addItem(_name, _width);
566 return static_cast<TabControl*
>(
this)->insertItemAt(_index, _name);
570 static_cast<TabControl*
>(
this)->removeItemAt(_index);
574 static_cast<TabControl*
>(
this)->removeItem(_sheet);
578 static_cast<TabControl*
>(
this)->setIndexSelected(_index);
582 static_cast<TabControl*
>(
this)->setItemSelected(_sheet);
586 return static_cast<const TabControl*
>(
this)->getIndexSelected();
591 return static_cast<const TabControl*
>(
this)->getIndexSelected();
595 static_cast<TabControl*
>(
this)->setIndexSelected(_index);
601 return static_cast<Widget*
>(
this)->getEnabled();
605 return static_cast<Widget*
>(
this)->getInheritsAlpha();
609 return static_cast<Widget*
>(
this)->getNeedKeyFocus();
613 return static_cast<Widget*
>(
this)->getNeedMouseFocus();
617 return static_cast<Widget*
>(
this)->getInheritsPick();
621 return static_cast<Widget*
>(
this)->getVisible();
627 static_cast<Window*
>(
this)->setVisibleSmooth(
true);
631 static_cast<Window*
>(
this)->setVisibleSmooth(
false);
635 static_cast<Window*
>(
this)->setMinSize(_minmax.
left, _minmax.
top);
640 static_cast<Window*
>(
this)->setMinSize(_min_w, _min_h);
641 static_cast<Window*
>(
this)->setMaxSize(_max_w, _max_h);
646 static_cast<const Window*
>(
this)->getMinSize().width,
647 static_cast<const Window*
>(
this)->getMinSize().height,
648 static_cast<const Window*
>(
this)->getMaxSize().width,
649 static_cast<const Window*
>(
this)->getMaxSize().height};
659 std::string_view _file,
661 std::string_view _tag)
672 std::string_view type;
674 type =
"ResourceManualFont";
676 type =
"ResourceTrueTypeFont";
758 while (codeold.
next(
"Code"))
782 static_cast<Gui*
>(
this)->destroyWidgets(_widgets);
908 std::string_view _file,
910 std::string_view _tag)
912 std::string_view pointer;
913 std::string_view layer;
924 std::string_view shared_text = node->
findAttribute(
"texture");
928 while (info.
next(
"Info"))
936 std::string_view type =
937 (shared_text.empty() && texture.empty()) ?
"ResourceImageSetPointer" :
"ResourceManualPointer";
974 if (!shared_text.empty() || !texture.empty())
978 prop->
addAttribute(
"value", shared_text.empty() ? texture : shared_text);
989 if (!pointer.empty())
999 return static_cast<const ResourceManager*
>(
this)->getByName(_name, _throw);
1004 return static_cast<const SkinManager*
>(
this)->getByName(_name);
1014 std::string_view _tag)
1020 while (skin.
next(_tag))
1024 type =
"ResourceSkin";
1027 if (
object !=
nullptr)
1040 static_cast<WidgetManager*
>(
this)->destroyWidgets(_widgets);
1058#ifndef MYGUI_DONT_USE_OBSOLETE
1076 return coord.
print();
1088#ifndef MYGUI_DONT_USE_OBSOLETE
1097#ifndef MYGUI_DONT_USE_OBSOLETE
1106 (*item).first <<
" is deprecated, use " << (*item).second <<
" ["
1108 _key = (*item).second;
1110 else if (_key ==
"Progress_StartPoint")
1114 "Progress_StartPoint is deprecated, use Progress_FlowDirection"
1116 _key =
"Progress_FlowDirection";
1119 else if (_key ==
"ComboBox_AddItem")
1123 "ComboBox_AddItem is deprecated"
1126 if (widget !=
nullptr)
1130 else if (_key ==
"List_AddItem")
1134 "List_AddItem is deprecated"
1137 if (widget !=
nullptr)
1141 else if (_key ==
"Tab_AddSheet")
1145 "Tab_AddSheet is deprecated"
1148 if (widget !=
nullptr)
1152 else if (_key ==
"Tab_AddItem")
1156 "Tab_AddItem is deprecated"
1159 if (widget !=
nullptr)
1163 else if (_key ==
"Window_MinMax")
1167 "Window_MinMax is deprecated, use Window_MinSize or Window_MaxSize"
1170 if (widget !=
nullptr)
1178 else if (_key ==
"ImageRect")
1182 "ImageRect is deprecated, use ImageCoord"
1184 _key =
"ImageCoord";
1187 else if (_key ==
"StartPoint")
1191 "StartPoint is deprecated, use FlowDirection"
1193 _key =
"FlowDirection";
1203#ifndef MYGUI_DONT_USE_OBSOLETE
1292 mSkinRename[
"DefaultClient"] =
"ClientDefaultSkin";
1306 mSkinRename[
"ButtonMinusPlus"] =
"ButtonExpandSkin";
1312#ifndef MYGUI_DONT_USE_OBSOLETE
1315 return (*item).second;
1317 return _propertyName;
1321 std::string_view _categoryName,
1322 std::string_view _factoryName)
1324#ifndef MYGUI_DONT_USE_OBSOLETE
1325 if (_categoryName ==
"Widget")
1327 if (_factoryName ==
"HScroll")
1334 else if (_factoryName ==
"VScroll")
1341 else if (_factoryName ==
"RenderBox")
1348 else if (_factoryName ==
"Sheet")
1355 else if (_factoryName ==
"StaticImage")
1359 "StaticImage factory is deprecated, use "
1363 else if (_factoryName ==
"StaticText")
1370 else if (_factoryName ==
"Progress")
1377 else if (_factoryName ==
"List")
1384 else if (_factoryName ==
"Edit")
1391 else if (_factoryName ==
"Tab")
1398 else if (_factoryName ==
"MultiList")
1405 else if (_factoryName ==
"MenuCtrl")
1414 return _factoryName;
1419#ifndef MYGUI_DONT_USE_OBSOLETE
1420 MapString::iterator item =
mSkinRename.find(_skinName);
1425 (*item).first <<
" skin is deprecated, use " << (*item).second <<
" ["
1427 return (*item).second;
1435#ifndef MYGUI_DONT_USE_OBSOLETE
1442#ifndef MYGUI_DONT_USE_OBSOLETE
#define MYGUI_LOG(level, text)
static std::string_view getSkinRename(std::string_view _skinName)
static void registerWidgetTypes()
static bool isIgnoreProperty(std::string_view _key)
static std::string_view getPropertyRename(std::string_view _propertyName)
static bool checkProperty(Widget *_owner, std::string &_key, std::string &_value)
static std::string_view getFactoryRename(std::string_view _categoryName, std::string_view _factoryName)
wrapper over Texture - shows the texture. Implemented: resizing of texture (see TextureResizeMode); r...
static std::string_view getClassTypeName()
widget description should be here.
void addItem(const UString &_name, Any _data=Any::Null)
Add an item to the end of a array.
widget description should be here.
static std::string_view getClassTypeName()
void registerFactory(std::string_view _category, std::string_view _type, Delegate::IDelegate *_delegate)
static FactoryManager & getInstance()
IObject * createObject(std::string_view _category, std::string_view _type)
void frameEvent(float _time) const
Widget * findWidgetT(std::string_view _name, bool _throw=true) const
static Gui & getInstance()
Type * castType(bool _throw=true)
widget description should be here.
static std::string_view getClassTypeName()
widget description should be here.
static LayerManager & getInstance()
void resizeView(const IntSize &_viewSize)
static LayoutManager & getInstance()
widget description should be here.
void addItem(const UString &_name, Any _data=Any::Null)
Add an item to the end of a array.
static std::string_view getClassTypeName()
void addColumn(int _width, const UString &_name)
widget description should be here.
static std::string_view getClassTypeName()
static PointerManager & getInstance()
void setVisible(bool _visible)
widget description should be here.
static std::string_view getClassTypeName()
virtual const IntSize & getViewSize() const =0
static RenderManager & getInstance()
const std::string & getCategoryName() const
void loadFromXmlNode(xml::ElementPtr _node, std::string_view _file, Version _version)
bool load(const std::string &_file)
static ResourceManager & getInstance()
void addResource(IResourcePtr _item)
void deserialization(xml::ElementPtr _node, Version _version) override
widget description should be here.
static std::string_view getClassTypeName()
TabItem * addItem(const UString &_name, Any _data=Any::Null)
Add an item to the end of a array.
widget description should be here.
static std::string_view getClassTypeName()
widget description should be here.
static std::string_view getClassTypeName()
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
widget description should be here.
void setMinSize(const IntSize &_value)
void setMaxSize(const IntSize &_value)
ElementPtr createRoot(std::string_view _name)
bool findAttribute(std::string_view _name, std::string &_value)
ElementEnumerator getElementEnumerator()
const std::string & getName() const
void addAttribute(std::string_view _key, const T &_value)
ElementPtr createChild(std::string_view _name, std::string_view _content={}, ElementType _type=ElementType::Normal)
T parseValue(std::string_view _value)
std::set< std::string, std::less<> > SetString
types::TRect< int > IntRect
static MapString mPropertyRename
types::TPoint< int > IntPoint
static std::string_view convertAlignToDirection(std::string_view _value)
std::map< std::string, std::string, std::less<> > MapString
static std::string convertRectToCoord(std::string_view _value)
static SetString mPropertyIgnore
constexpr size_t ITEM_NONE
types::TCoord< int > IntCoord
types::TSize< int > IntSize
static MapString mSkinRename
std::vector< Widget * > VectorWidgetPtr
std::string_view print() const
std::string print() const
static TRect< int > parse(std::string_view _value)