MyGUI 3.5.3
MyGUI_ToolTipManager.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_TOOL_TIP_MANAGER_H_
8#define MYGUI_TOOL_TIP_MANAGER_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_IUnlinkWidget.h"
12#include "MyGUI_Macros.h"
13#include "MyGUI_Singleton.h"
14#include "MyGUI_Types.h"
15
16namespace MyGUI
17{
18
19 class MYGUI_EXPORT ToolTipManager : public IUnlinkWidget
20 {
21 MYGUI_SINGLETON_DECLARATION(ToolTipManager);
22
23 public:
24 ToolTipManager();
25
26 void initialise();
27 void shutdown();
28
29 void setDelayVisible(float _value);
30 float getDelayVisible() const;
31
32 /*internal:*/
33 void _unlinkWidget(Widget* _widget) override;
34
35 private:
36 void notifyEventFrameStart(float _time);
37
38 void hideToolTip(Widget* _widget);
39 void showToolTip(Widget* _widget, size_t _index, const IntPoint& _point);
40 void moveToolTip(Widget* _widget, size_t _index, const IntPoint& _point);
41
42 bool isNeedToolTip(Widget* _widget);
43 size_t getToolTipIndex(Widget* _widget) const;
44
45 private:
46 float mDelayVisible{0.5f};
47 Widget* mOldFocusWidget{nullptr};
48 IntPoint mOldMousePoint;
49 bool mToolTipVisible{false};
50 float mCurrentTime{0};
51 size_t mOldIndex{ITEM_NONE};
52 bool mNeedToolTip{false};
53
54 bool mIsInitialise{false};
55 };
56
57} // namespace MyGUI
58
59#endif // MYGUI_TOOL_TIP_MANAGER_H_
#define MYGUI_EXPORT
#define MYGUI_SINGLETON_DECLARATION(ClassName)
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:26
constexpr size_t ITEM_NONE