MyGUI: MyGUI_PointerManager.h Source File

MyGUI 3.2.2

MyGUI_PointerManager.h
Go to the documentation of this file.
1 /*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7 #ifndef MYGUI_POINTER_MANAGER_H_
8 #define MYGUI_POINTER_MANAGER_H_
9
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_Singleton.h"
12 #include "MyGUI_IUnlinkWidget.h"
13 #include "MyGUI_ImageBox.h"
14 #include "MyGUI_IPointer.h"
15 #include "MyGUI_BackwardCompatibility.h"
16
17 namespace MyGUI
18 {
19
20 class MYGUI_EXPORT PointerManager :
21 public Singleton<PointerManager>,
22 public IUnlinkWidget,
23 public MemberObsolete<PointerManager>
24 {
25 public:
26 PointerManager();
27
28 void initialise();
29 void shutdown();
30
32 void setVisible(bool _visible);
34 bool isVisible() const;
35
39 void setPointer(const std::string& _name);
41 void resetToDefaultPointer();
42
44 const std::string& getDefaultPointer() const;
46 void setDefaultPointer(const std::string& _value);
47
49 const std::string& getLayerName() const;
51 void setLayerName(const std::string& _value);
52
54 IPointer* getByName(const std::string& _name) const;
55
56 /*events:*/
61 delegates::CMultiDelegate1<const std::string&> eventChangeMousePointer;
62
63 private:
64 void _unlinkWidget(Widget* _widget);
65 void _load(xml::ElementPtr _node, const std::string& _file, Version _version);
66
67 // создает виджет
68 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);
69
70 // удяляет неудачника
71 void _destroyChildWidget(Widget* _widget);
72
73 // удаляет всех детей
74 void _destroyAllChildWidget();
75
76 void Update();
77
78 void notifyFrameStart(float _time);
79 void notifyChangeMouseFocus(Widget* _widget);
80 void setPointer(const std::string& _name, Widget* _owner);
81
82 private:
83 // вектор всех детей виджетов
84 VectorWidgetPtr mWidgetChild;
85
86 std::string mDefaultName;
87 IntPoint mPoint;
88 IntPoint mOldPoint;
89 bool mVisible;
90 std::string mLayerName;
91 std::string mSkinName;
92
93 Widget* mWidgetOwner;
94 ImageBox* mMousePointer;
95 IPointer* mPointer;
96 std::string mCurrentMousePointer;
97
98 bool mIsInitialise;
99 std::string mXmlPointerTagName;
100 std::string mXmlPropertyTagName;
101 std::string mXmlDefaultPointerValue;
102 };
103
104 } // namespace MyGUI
105
106 #endif // MYGUI_POINTER_MANAGER_H_
MyGUI::IPointer
Definition: MyGUI_IPointer.h:16
MyGUI::ImageBox
ImageBox properties. Skin childs. ImageBox widget description should be here.
Definition: MyGUI_ImageBox.h:21
MyGUI::Widget
Widget properties. Skin childs. Widget widget description should be here.
Definition: MyGUI_Widget.h:29
MyGUI::VectorWidgetPtr
std::vector< Widget * > VectorWidgetPtr
Definition: MyGUI_WidgetDefines.h:19
MyGUI::types::TPoint< int >
MyGUI::Align
Definition: MyGUI_Align.h:19
MyGUI::xml::Element
Definition: MyGUI_XmlDocument.h:158
MyGUI::Version
Definition: MyGUI_Version.h:17
MyGUI_ImageBox.h
MyGUI_Prerequest.h
MyGUI_Singleton.h
MyGUI::MemberObsolete
Definition: MyGUI_DeprecatedTypes.h:13
MyGUI::PointerManager
Definition: MyGUI_PointerManager.h:20
MyGUI::WidgetStyle
Definition: MyGUI_WidgetStyle.h:16
MyGUI::PointerManager::eventChangeMousePointer
delegates::CMultiDelegate1< const std::string & > eventChangeMousePointer
Definition: MyGUI_PointerManager.h:61
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:103
MyGUI_IPointer.h
MyGUI_IUnlinkWidget.h
MyGUI::types::TCoord< int >
MyGUI::IUnlinkWidget
Definition: MyGUI_IUnlinkWidget.h:16
MyGUI::Singleton
Definition: MyGUI_Singleton.h:20
MyGUI_BackwardCompatibility.h
MyGUI
Definition: MyGUI_ActionController.h:14