MyGUI_PointerManager.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_POINTER_MANAGER_H_
#define MYGUI_POINTER_MANAGER_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_Singleton.h"
#include "MyGUI_EventPair.h"
#include "MyGUI_IUnlinkWidget.h"
#include "MyGUI_ImageBox.h"
#include "MyGUI_IPointer.h"
#include "MyGUI_BackwardCompatibility.h"
namespace MyGUI
{
class MYGUI_EXPORT PointerManager : public IUnlinkWidget, public MemberObsolete<PointerManager>
{
MYGUI_SINGLETON_DECLARATION(PointerManager);
public:
PointerManager();
void initialise();
void shutdown();
void setVisible(bool _visible);
bool isVisible() const;
void setPointer(std::string_view _name);
void resetToDefaultPointer();
const std::string& getDefaultPointer() const;
void setDefaultPointer(std::string_view _value);
const std::string& getLayerName() const;
void setLayerName(std::string_view _value);
IPointer* getByName(std::string_view _name) const;
/*events:*/
EventPairConvertStringView<
delegates::MultiDelegate<const std::string&>,
delegates::MultiDelegate<std::string_view>>
eventChangeMousePointer;
private:
void _unlinkWidget(Widget* _widget) override;
void _load(xml::ElementPtr _node, std::string_view _file, Version _version);
// создает виджет
Widget* baseCreateWidget(
WidgetStyle _style,
std::string_view _type,
std::string_view _skin,
const IntCoord& _coord,
Align _align,
std::string_view _layer,
std::string_view _name);
// удаляет всех детей
void _destroyAllChildWidget();
void Update();
void notifyFrameStart(float _time);
void notifyChangeMouseFocus(Widget* _widget);
void setPointer(std::string_view _name, Widget* _owner);
private:
// вектор всех детей виджетов
VectorWidgetPtr mWidgetChild;
std::string mDefaultName;
IntPoint mPoint;
IntPoint mOldPoint;
bool mVisible{false};
std::string mLayerName;
std::string mSkinName;
Widget* mWidgetOwner{nullptr};
ImageBox* mMousePointer{nullptr};
IPointer* mPointer{nullptr};
std::string mCurrentMousePointer;
bool mIsInitialise{false};
std::string mXmlPointerTagName;
std::string mXmlPropertyTagName;
std::string mXmlDefaultPointerValue;
};
} // namespace MyGUI
#endif // MYGUI_POINTER_MANAGER_H_
MyGUI_BackwardCompatibility.h
MyGUI_EventPair.h
MyGUI_IPointer.h
MyGUI_IUnlinkWidget.h
MyGUI_ImageBox.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MyGUI_Singleton.h
MYGUI_SINGLETON_DECLARATION
#define MYGUI_SINGLETON_DECLARATION(ClassName)
Definition MyGUI_Singleton.h:112
MyGUI::EventPairConvertStringView
Definition MyGUI_EventPair.h:213
MyGUI::IPointer
Definition MyGUI_IPointer.h:17
MyGUI::IUnlinkWidget
Definition MyGUI_IUnlinkWidget.h:17
MyGUI::MemberObsolete
Definition MyGUI_DeprecatedTypes.h:14
MyGUI::PointerManager::PointerManager
PointerManager(const PointerManager &)=delete
MyGUI::PointerManager::resetToDefaultPointer
void resetToDefaultPointer()
Definition MyGUI_PointerManager.cpp:157
MyGUI::PointerManager::setPointer
void setPointer(std::string_view _name)
Definition MyGUI_PointerManager.cpp:266
MyGUI::PointerManager::isVisible
bool isVisible() const
Definition MyGUI_PointerManager.cpp:271
MyGUI::PointerManager::getDefaultPointer
const std::string & getDefaultPointer() const
Definition MyGUI_PointerManager.cpp:276
MyGUI::PointerManager::setVisible
void setVisible(bool _visible)
Definition MyGUI_PointerManager.cpp:121
MyGUI::PointerManager::getLayerName
const std::string & getLayerName() const
Definition MyGUI_PointerManager.cpp:281
MyGUI::PointerManager::eventChangeMousePointer
EventPairConvertStringView< delegates::MultiDelegate< const std::string & >, delegates::MultiDelegate< std::string_view > > eventChangeMousePointer
Definition MyGUI_PointerManager.h:64
MyGUI::PointerManager::shutdown
void shutdown()
Definition MyGUI_PointerManager.cpp:62
MyGUI::PointerManager::setDefaultPointer
void setDefaultPointer(std::string_view _value)
Definition MyGUI_PointerManager.cpp:203
MyGUI::PointerManager::setLayerName
void setLayerName(std::string_view _value)
Definition MyGUI_PointerManager.cpp:211
MyGUI::PointerManager::getByName
IPointer * getByName(std::string_view _name) const
Definition MyGUI_PointerManager.cpp:233
MyGUI::PointerManager::initialise
void initialise()
Definition MyGUI_PointerManager.cpp:35
MyGUI::Version
Definition MyGUI_Version.h:18
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:40
MyGUI::delegates::MultiDelegate
Definition MyGUI_Delegate.h:190
MyGUI::xml::ElementPtr
Element * ElementPtr
Definition MyGUI_XmlDocument.h:112
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::IntPoint
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:27
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:36
MyGUI::VectorWidgetPtr
std::vector< Widget * > VectorWidgetPtr
Definition MyGUI_WidgetDefines.h:20
MyGUI::Align
Definition MyGUI_Align.h:20
MyGUI::WidgetStyle
Definition MyGUI_WidgetStyle.h:19