29 mWidgetOwner(nullptr),
30 mMousePointer(nullptr),
33 mXmlPointerTagName(
"Pointer"),
34 mXmlPropertyTagName(
"Property"),
35 mXmlDefaultPointerValue(
"Default"),
36 mSingletonHolder(this)
56 mMousePointer =
nullptr;
57 mWidgetOwner =
nullptr;
60 mSkinName =
"ImageBox";
79 _destroyAllChildWidget();
81 mWidgetOwner =
nullptr;
87 mIsInitialise =
false;
92#ifndef MYGUI_DONT_USE_OBSOLETE
99 if (node->
getName() == mXmlPropertyTagName)
103 if (key ==
"Default")
105 else if (key ==
"Layer")
107 else if (key ==
"Skin")
113 void PointerManager::notifyFrameStart(
float _time)
116 if (mOldPoint != mPoint)
120 if (
nullptr != mMousePointer && mPointer !=
nullptr)
127 if (
nullptr != mMousePointer) mMousePointer->
setVisible(_visible);
133 if (
nullptr == mMousePointer)
137 if (result ==
nullptr)
145 mPointer = result->
castType<IPointer>();
149 mWidgetOwner = _owner;
152 void PointerManager::_unlinkWidget(Widget* _widget)
154 if (_widget == mWidgetOwner)
setPointer(mDefaultName,
nullptr);
155 else if (_widget == mMousePointer) mMousePointer =
nullptr;
164 Widget* PointerManager::baseCreateWidget(
WidgetStyle _style,
const std::string& _type,
const std::string& _skin,
const IntCoord& _coord,
Align _align,
const std::string& _layer,
const std::string& _name)
167 mWidgetChild.push_back(widget);
178 void PointerManager::_destroyAllChildWidget()
181 while (!mWidgetChild.empty())
184 Widget* widget = mWidgetChild.back();
185 mWidgetChild.pop_back();
188 manager.unlinkFromUnlinkers(widget);
199 mDefaultName = _value;
212 void PointerManager::Update()
214 if (mMousePointer ==
nullptr)
221 if (!_name.empty() && _name != mXmlDefaultPointerValue)
224 if (result ==
nullptr)
230 void PointerManager::notifyChangeMouseFocus(
Widget* _widget)
233 if (pointer != mCurrentMousePointer)
235 mCurrentMousePointer = pointer;
236 if (mCurrentMousePointer.empty())
#define MYGUI_ASSERT(exp, dest)
#define MYGUI_LOG(level, text)
void unregisterFactory(const std::string &_category, const std::string &_type)
static FactoryManager & getInstance()
void registerFactory(const std::string &_category, const std::string &_type, Delegate::IDelegate *_delegate)
static Gui & getInstance()
EventHandle_FrameEventDelegate eventFrameStart
Type * castType(bool _throw=true)
virtual void setImage(ImageBox *_image)=0
virtual void setPosition(ImageBox *_image, const IntPoint &_point)=0
widget description should be here.
static const std::string & getClassTypeName()
static LayerManager & getInstance()
void attachToLayerNode(const std::string &_name, Widget *_item)
void loadOldPointerFormat(xml::ElementPtr _node, const std::string &_file, Version _version, const std::string &_tag)
void resetToDefaultPointer()
delegates::CMultiDelegate1< const std::string & > eventChangeMousePointer
static const char * getClassTypeName()
const std::string & getDefaultPointer() const
void setVisible(bool _visible)
const std::string & getLayerName() const
void setPointer(const std::string &_name)
void setLayerName(const std::string &_value)
IPointer * getByName(const std::string &_name) const
void setDefaultPointer(const std::string &_value)
const std::string & getCategoryName() const
IResource * getByName(const std::string &_name, bool _throw=true) const
void unregisterLoadXmlDelegate(const std::string &_key)
static ResourceManager & getInstance()
LoadXmlDelegate & registerLoadXmlDelegate(const std::string &_key)
ElementEnumerator getElementEnumerator()
const std::string & getName() const
bool findAttribute(const std::string &_name, std::string &_value)
types::TCoord< int > IntCoord
delegates::DelegateFunction< Args... > * newDelegate(void(*_func)(Args... args))
MYGUI_SINGLETON_DEFINITION(ClipboardManager)