37 mInputManager(nullptr),
38 mSubWidgetManager(nullptr),
39 mLayerManager(nullptr),
40 mSkinManager(nullptr),
41 mWidgetManager(nullptr),
42 mFontManager(nullptr),
43 mControllerManager(nullptr),
44 mPointerManager(nullptr),
45 mClipboardManager(nullptr),
46 mLayoutManager(nullptr),
47 mDynLibManager(nullptr),
48 mPluginManager(nullptr),
49 mLanguageManager(nullptr),
50 mResourceManager(nullptr),
51 mFactoryManager(nullptr),
52 mToolTipManager(nullptr),
54 mSingletonHolder(this)
107 mResourceManager->
load(_core);
112 mIsInitialise =
true;
115#ifndef MYGUI_DONT_USE_OBSOLETE
129 _destroyAllChildWidget();
151 delete mPointerManager;
152 delete mWidgetManager;
153 delete mInputManager;
155 delete mSubWidgetManager;
156 delete mLayerManager;
158 delete mControllerManager;
159 delete mClipboardManager;
160 delete mLayoutManager;
161 delete mDynLibManager;
162 delete mPluginManager;
163 delete mLanguageManager;
164 delete mResourceManager;
165 delete mFactoryManager;
166 delete mToolTipManager;
172 mIsInitialise =
false;
175 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)
178 mWidgetChild.push_back(widget);
190 for (VectorWidgetPtr::iterator iter = mWidgetChild.begin(); iter != mWidgetChild.end(); ++iter)
193 if (widget !=
nullptr)
return widget;
195 MYGUI_ASSERT(!_throw,
"Widget '" << _name <<
"' not found");
200 void Gui::_destroyChildWidget(
Widget* _widget)
202 MYGUI_ASSERT(
nullptr != _widget,
"invalid widget pointer");
204 VectorWidgetPtr::iterator iter = std::find(mWidgetChild.begin(), mWidgetChild.end(), _widget);
205 if (iter != mWidgetChild.end())
211 mWidgetChild.erase(iter);
226 void Gui::_destroyAllChildWidget()
228 while (!mWidgetChild.empty())
231 Widget* widget = mWidgetChild.back();
232 mWidgetChild.pop_back();
245 if (parent !=
nullptr)
248 _destroyChildWidget(_widget);
253 for (VectorWidgetPtr::const_iterator iter = _widgets.begin(); iter != _widgets.end(); ++iter)
260 while (_widgets.
next())
261 widgets.push_back(_widgets.
current());
265 void Gui::_unlinkWidget(
Widget* _widget)
272 VectorWidgetPtr::iterator iter = std::find(mWidgetChild.begin(), mWidgetChild.end(), _widget);
273 MYGUI_ASSERT(iter == mWidgetChild.end(),
"widget already exist");
274 mWidgetChild.push_back(_widget);
279 VectorWidgetPtr::iterator iter = std::remove(mWidgetChild.begin(), mWidgetChild.end(), _widget);
280 MYGUI_ASSERT(iter != mWidgetChild.end(),
"widget not found");
281 mWidgetChild.erase(iter);
289 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)
300 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)
313 _destroyChildWidget(_widget);
318 _destroyAllChildWidget();
#define MYGUI_ASSERT(exp, dest)
#define MYGUI_EXCEPT(dest)
#define MYGUI_LOG(level, text)
#define MYGUI_VERSION_PATCH
#define MYGUI_VERSION_MAJOR
#define MYGUI_VERSION_MINOR
Manager of dynamic libraries.
T::const_reference current()
void _unlinkChildWidget(Widget *_widget)
void destroyWidget(Widget *_widget)
void initialise(const std::string &_core="MyGUI_Core.xml")
Widget * createWidgetT(const std::string &_type, const std::string &_skin, const IntCoord &_coord, Align _align, const std::string &_layer, const std::string &_name="")
void destroyAllChildWidget()
void destroyWidgets(const VectorWidgetPtr &_widgets)
Widget * createWidgetRealT(const std::string &_type, const std::string &_skin, const FloatCoord &_coord, Align _align, const std::string &_layer, const std::string &_name="")
void _linkChildWidget(Widget *_widget)
Widget * findWidgetT(const std::string &_name, bool _throw=true)
static const char * getClassTypeName()
void frameEvent(float _time)
friend class WidgetManager
void destroyChildWidget(Widget *_widget)
EventHandle_FrameEventDelegate eventFrameStart
EnumeratorWidgetPtr getEnumerator() const
static LayerManager & getInstance()
void attachToLayerNode(const std::string &_name, Widget *_item)
Plugin manager. Load/unload and register plugins.
virtual const IntSize & getViewSize() const =0
static RenderManager & getInstance()
bool load(const std::string &_file)
const IntSize & getTextureSize(const std::string &_texture, bool _cache=true)
Enumerator< VectorWidgetPtr > EnumeratorWidgetPtr
types::TCoord< int > IntCoord
std::vector< Widget * > VectorWidgetPtr
MYGUI_SINGLETON_DEFINITION(ClipboardManager)