25 template <> PointerManager* Singleton<PointerManager>::msInstance =
nullptr;
26 template <>
const char* Singleton<PointerManager>::mClassTypeName =
"PointerManager";
34 mXmlPointerTagName(
"Pointer"),
35 mXmlPropertyTagName(
"Property"),
36 mXmlDefaultPointerValue(
"Default")
56 mMousePointer =
nullptr;
57 mWidgetOwner =
nullptr;
60 mSkinName =
"ImageBox";
79 _destroyAllChildWidget();
81 mWidgetOwner =
nullptr;
87 mIsInitialise =
false;
92 #ifndef MYGUI_DONT_USE_OBSOLETE
94 #endif // 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::_destroyChildWidget(Widget* _widget)
180 MYGUI_ASSERT(
nullptr != _widget,
"invalid widget pointer");
182 VectorWidgetPtr::iterator iter = std::find(mWidgetChild.begin(), mWidgetChild.end(), _widget);
183 if (iter != mWidgetChild.end())
189 mWidgetChild.erase(iter);
199 MYGUI_EXCEPT(
"Widget '" << _widget->getName() <<
"' not found");
204 void PointerManager::_destroyAllChildWidget()
207 while (!mWidgetChild.empty())
210 Widget* widget = mWidgetChild.back();
211 mWidgetChild.pop_back();
214 manager.unlinkFromUnlinkers(widget);
225 mDefaultName = _value;
238 void PointerManager::Update()
240 if (mMousePointer ==
nullptr)
247 if (!_name.empty() && _name != mXmlDefaultPointerValue)
250 if (result ==
nullptr)
256 void PointerManager::notifyChangeMouseFocus(
Widget* _widget)
259 if (pointer != mCurrentMousePointer)
261 mCurrentMousePointer = pointer;
262 if (mCurrentMousePointer.empty())