MyGUI 3.4.3
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_EventPair.h"
13#include "MyGUI_IUnlinkWidget.h"
14#include "MyGUI_ImageBox.h"
15#include "MyGUI_IPointer.h"
17
18namespace MyGUI
19{
20
21 class MYGUI_EXPORT PointerManager : public IUnlinkWidget, public MemberObsolete<PointerManager>
22 {
24
25 public:
27
28 void initialise();
29 void shutdown();
30
32 void setVisible(bool _visible);
34 bool isVisible() const;
35
39 void setPointer(std::string_view _name);
41 void resetToDefaultPointer();
42
44 const std::string& getDefaultPointer() const;
46 void setDefaultPointer(std::string_view _value);
47
49 const std::string& getLayerName() const;
51 void setLayerName(std::string_view _value);
52
54 IPointer* getByName(std::string_view _name) const;
55
56 /*events:*/
65
66 private:
67 void _unlinkWidget(Widget* _widget) override;
68 void _load(xml::ElementPtr _node, std::string_view _file, Version _version);
69
70 // создает виджет
71 Widget* baseCreateWidget(
72 WidgetStyle _style,
73 std::string_view _type,
74 std::string_view _skin,
75 const IntCoord& _coord,
76 Align _align,
77 std::string_view _layer,
78 std::string_view _name);
79
80 // удаляет всех детей
81 void _destroyAllChildWidget();
82
83 void Update();
84
85 void notifyFrameStart(float _time);
86 void notifyChangeMouseFocus(Widget* _widget);
87 void setPointer(std::string_view _name, Widget* _owner);
88
89 private:
90 // вектор всех детей виджетов
91 VectorWidgetPtr mWidgetChild;
92
93 std::string mDefaultName;
94 IntPoint mPoint;
95 IntPoint mOldPoint;
96 bool mVisible{false};
97 std::string mLayerName;
98 std::string mSkinName;
99
100 Widget* mWidgetOwner{nullptr};
101 ImageBox* mMousePointer{nullptr};
102 IPointer* mPointer{nullptr};
103 std::string mCurrentMousePointer;
104
105 bool mIsInitialise{false};
106 std::string mXmlPointerTagName;
107 std::string mXmlPropertyTagName;
108 std::string mXmlDefaultPointerValue;
109 };
110
111} // namespace MyGUI
112
113#endif // MYGUI_POINTER_MANAGER_H_
#define MYGUI_EXPORT
#define MYGUI_SINGLETON_DECLARATION(ClassName)
EventPairConvertStringView< delegates::MultiDelegate< const std::string & >, delegates::MultiDelegate< std::string_view > > eventChangeMousePointer
widget description should be here.
std::vector< Widget * > VectorWidgetPtr