MyGUI 3.2.0

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_PointerManager.h
Go to the documentation of this file.
1
6 /*
7 This file is part of MyGUI.
8
9 MyGUI is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 MyGUI is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_POINTER_MANAGER_H__
23 #define __MYGUI_POINTER_MANAGER_H__
24
25 #include "MyGUI_Prerequest.h"
26 #include "MyGUI_Singleton.h"
27 #include "MyGUI_IUnlinkWidget.h"
28 #include "MyGUI_ImageBox.h"
29 #include "MyGUI_IPointer.h"
30 #include "MyGUI_BackwardCompatibility.h"
31
32 namespace MyGUI
33 {
34
35 class MYGUI_EXPORT PointerManager :
36 public Singleton<PointerManager>,
37 public IUnlinkWidget,
38 public MemberObsolete<PointerManager>
39 {
40 public:
41 PointerManager();
42
43 void initialise();
44 void shutdown();
45
47 void setVisible(bool _visible);
49 bool isVisible() const;
50
54 void setPointer(const std::string& _name);
56 void resetToDefaultPointer();
57
59 const std::string& getDefaultPointer() const;
61 void setDefaultPointer(const std::string& _value);
62
64 const std::string& getLayerName() const;
66 void setLayerName(const std::string& _value);
67
69 IPointer* getByName(const std::string& _name) const;
70
71 /*events:*/
76 delegates::CMultiDelegate1<const std::string&>
77 eventChangeMousePointer;
78
79 private:
80 void _unlinkWidget(Widget* _widget);
81 void _load(xml::ElementPtr _node, const std::string& _file, Version _version);
82
83 // создает виджет
84 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);
85
86 // удяляет неудачника
87 void _destroyChildWidget(Widget* _widget);
88
89 // удаляет всех детей
90 void _destroyAllChildWidget();
91
92 void Update();
93
94 void notifyFrameStart(float _time);
95 void notifyChangeMouseFocus(Widget* _widget);
96 void setPointer(const std::string& _name, Widget* _owner);
97
98 private:
99 // вектор всех детей виджетов
100 VectorWidgetPtr mWidgetChild;
101
102 std::string mDefaultName;
103 IntPoint mPoint;
104 bool mVisible;
105 std::string mLayerName;
106 std::string mSkinName;
107
108 Widget* mWidgetOwner;
109 ImageBox* mMousePointer;
110 IPointer* mPointer;
111 std::string mCurrentMousePointer;
112
113 bool mIsInitialise;
114 };
115
116 } // namespace MyGUI
117
118 #endif // __MYGUI_POINTER_MANAGER_H__
MyGUI::types::TCoord< int >
MyGUI::PointerManager
Definition: MyGUI_PointerManager.h:35
MyGUI::Widget
Definition: MyGUI_Widget.h:41
MyGUI::ImageBox
Definition: MyGUI_ImageBox.h:33
MyGUI::types::TPoint< int >
MyGUI_Prerequest.h
MyGUI_Singleton.h
MyGUI::PointerManager::eventChangeMousePointer
delegates::CMultiDelegate1< const std::string & > eventChangeMousePointer
Definition: MyGUI_PointerManager.h:77
MyGUI_IPointer.h
MyGUI::IUnlinkWidget
Definition: MyGUI_IUnlinkWidget.h:31
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:120
MyGUI::VectorWidgetPtr
std::vector< Widget * > VectorWidgetPtr
Definition: MyGUI_WidgetDefines.h:33
MyGUI_BackwardCompatibility.h
MyGUI::xml::Element
Definition: MyGUI_XmlDocument.h:168
MyGUI::Version
Definition: MyGUI_Version.h:32
MyGUI::WidgetStyle
Definition: MyGUI_WidgetStyle.h:31
MyGUI_ImageBox.h
MyGUI::MemberObsolete
Definition: MyGUI_DeprecatedTypes.h:28
MyGUI::Align
Definition: MyGUI_Align.h:34
MyGUI::Singleton
Definition: MyGUI_Singleton.h:35
MyGUI::delegates::CMultiDelegate1< const std::string & >
MyGUI_IUnlinkWidget.h
MyGUI::IPointer
Definition: MyGUI_IPointer.h:31