34 template <> Gui* Singleton<Gui>::msInstance =
nullptr;
35 template <>
const char* Singleton<Gui>::mClassTypeName =
"Gui";
63 #ifdef MYGUI_SVN_REVISION
68 << MYGUI_SVN_REVISION);
115 mResourceManager->
load(_core);
120 mIsInitialise =
true;
123 #ifndef MYGUI_DONT_USE_OBSOLETE
128 #endif // MYGUI_DONT_USE_OBSOLETE
137 _destroyAllChildWidget();
159 delete mPointerManager;
160 delete mWidgetManager;
161 delete mInputManager;
163 delete mSubWidgetManager;
164 delete mLayerManager;
166 delete mControllerManager;
167 delete mClipboardManager;
168 delete mLayoutManager;
169 delete mDynLibManager;
170 delete mPluginManager;
171 delete mLanguageManager;
172 delete mResourceManager;
173 delete mFactoryManager;
174 delete mToolTipManager;
180 mIsInitialise =
false;
183 Widget* Gui::baseCreateWidget(
WidgetStyle _style,
const std::string& _type,
const std::string& _skin,
const IntCoord& _coord,
Align _align,
const std::string& _layer,
const std::string& _name)
186 mWidgetChild.push_back(widget);
198 for (VectorWidgetPtr::iterator iter = mWidgetChild.begin(); iter != mWidgetChild.end(); ++iter)
201 if (widget !=
nullptr)
return widget;
203 MYGUI_ASSERT(!_throw,
"Widget '" << _name <<
"' not found");
208 void Gui::_destroyChildWidget(
Widget* _widget)
210 MYGUI_ASSERT(
nullptr != _widget,
"invalid widget pointer");
212 VectorWidgetPtr::iterator iter = std::find(mWidgetChild.begin(), mWidgetChild.end(), _widget);
213 if (iter != mWidgetChild.end())
219 mWidgetChild.erase(iter);
234 void Gui::_destroyAllChildWidget()
236 while (!mWidgetChild.empty())
239 Widget* widget = mWidgetChild.back();
240 mWidgetChild.pop_back();
253 if (parent !=
nullptr)
256 _destroyChildWidget(_widget);
261 for (VectorWidgetPtr::const_iterator iter = _widgets.begin(); iter != _widgets.end(); ++iter)
268 while (_widgets.
next())
269 widgets.push_back(_widgets.
current());
273 void Gui::_unlinkWidget(
Widget* _widget)
280 VectorWidgetPtr::iterator iter = std::find(mWidgetChild.begin(), mWidgetChild.end(), _widget);
281 MYGUI_ASSERT(iter == mWidgetChild.end(),
"widget already exist");
282 mWidgetChild.push_back(_widget);
287 VectorWidgetPtr::iterator iter = std::remove(mWidgetChild.begin(), mWidgetChild.end(), _widget);
288 MYGUI_ASSERT(iter != mWidgetChild.end(),
"widget not found");
289 mWidgetChild.erase(iter);
297 Widget*
Gui::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)
308 Widget*
Gui::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)
321 _destroyChildWidget(_widget);
326 _destroyAllChildWidget();