7 #ifndef __MYGUI_GUI_H__
8 #define __MYGUI_GUI_H__
39 void initialise(
const std::string& _core =
"MyGUI_Core.xml");
41 #ifndef MYGUI_DONT_USE_OBSOLETE
42 MYGUI_OBSOLETE(
" is deprecated, use : void Gui::initialise(const std::string& _core) and set log filename in Platform")
43 void initialise(const std::
string& _core, const std::
string& _logFileName);
44 #endif // MYGUI_DONT_USE_OBSOLETE
58 Widget* createWidgetT(
const std::string& _type,
const std::string& _skin,
const IntCoord& _coord,
Align _align,
const std::string& _layer,
const std::string& _name =
"");
60 Widget* createWidgetT(
const std::string& _type,
const std::string& _skin,
int _left,
int _top,
int _width,
int _height,
Align _align,
const std::string& _layer,
const std::string& _name =
"");
62 Widget* createWidgetRealT(
const std::string& _type,
const std::string& _skin,
const FloatCoord& _coord,
Align _align,
const std::string& _layer,
const std::string& _name =
"");
64 Widget* createWidgetRealT(
const std::string& _type,
const std::string& _skin,
float _left,
float _top,
float _width,
float _height,
Align _align,
const std::string& _layer,
const std::string& _name =
"");
69 T* createWidget(
const std::string& _skin,
const IntCoord& _coord,
Align _align,
const std::string& _layer,
const std::string& _name =
"")
71 return static_cast<T*
>(createWidgetT(T::getClassTypeName(), _skin, _coord, _align, _layer, _name));
75 T* createWidget(
const std::string& _skin,
int _left,
int _top,
int _width,
int _height,
Align _align,
const std::string& _layer,
const std::string& _name =
"")
77 return static_cast<T*
>(createWidgetT(T::getClassTypeName(), _skin,
IntCoord(_left, _top, _width, _height), _align, _layer, _name));
81 T* createWidgetReal(
const std::string& _skin,
const FloatCoord& _coord,
Align _align,
const std::string& _layer,
const std::string& _name =
"")
83 return static_cast<T*
>(createWidgetRealT(T::getClassTypeName(), _skin, _coord, _align, _layer, _name));
87 T* createWidgetReal(
const std::string& _skin,
float _left,
float _top,
float _width,
float _height,
Align _align,
const std::string& _layer,
const std::string& _name =
"")
89 return static_cast<T*
>(createWidgetRealT(T::getClassTypeName(), _skin, _left, _top, _width, _height, _align, _layer, _name));
93 void destroyWidget(
Widget* _widget);
104 Widget* findWidgetT(
const std::string& _name,
bool _throw =
true);
109 Widget* findWidgetT(
const std::string& _name,
const std::string& _prefix,
bool _throw =
true);
114 template <
typename T>
115 T* findWidget(
const std::string& _name,
bool _throw =
true)
117 Widget* widget = findWidgetT(_name, _throw);
118 if (
nullptr == widget)
return nullptr;
125 template <
typename T>
126 T* findWidget(
const std::string& _name,
const std::string& _prefix,
bool _throw =
true)
128 return findWidget<T>(_prefix + _name, _throw);
132 void destroyChildWidget(
Widget* _widget);
135 void destroyAllChildWidget();
143 void frameEvent(
float _time);
153 void _linkChildWidget(
Widget* _widget);
154 void _unlinkChildWidget(
Widget* _widget);
158 Widget* baseCreateWidget(
WidgetStyle _style,
const std::string& _type,
const std::string& _skin,
const IntCoord& _coord,
Align _align,
const std::string& _layer,
const std::string& _name);
161 void _destroyChildWidget(
Widget* _widget);
164 void _destroyAllChildWidget();
166 virtual void _unlinkWidget(
Widget* _widget);
195 #endif // __MYGUI_GUI_H__