MyGUI  3.2.0
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"
31 
32 namespace MyGUI
33 {
34 
36  public Singleton<PointerManager>,
37  public IUnlinkWidget,
38  public MemberObsolete<PointerManager>
39  {
40  public:
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:*/
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__
delegates::CMultiDelegate1< const std::string & > eventChangeMousePointer
#define MYGUI_EXPORT
std::vector< Widget * > VectorWidgetPtr