MyGUI  3.2.0
MyGUI_ToolTipManager.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_TOOL_TIP_MANAGER_H__
23 #define __MYGUI_TOOL_TIP_MANAGER_H__
24 
25 #include "MyGUI_Prerequest.h"
26 #include "MyGUI_IUnlinkWidget.h"
27 #include "MyGUI_Singleton.h"
28 
29 namespace MyGUI
30 {
31 
33  public Singleton<ToolTipManager>,
34  public IUnlinkWidget
35  {
36  public:
38 
39  void initialise();
40  void shutdown();
41 
42  void setDelayVisible(float _value);
43  float getDelayVisible() const;
44 
45  /*internal:*/
46  void _unlinkWidget(Widget* _widget);
47 
48  private:
49  void notifyEventFrameStart(float _time);
50 
51  void hideToolTip(Widget* _widget);
52  void showToolTip(Widget* _widget, size_t _index, const IntPoint& _point);
53  void moveToolTip(Widget* _widget, size_t _index, const IntPoint& _point);
54 
55  bool isNeedToolTip(Widget* _widget);
56  size_t getToolTipIndex(Widget* _widget) const;
57 
58  private:
59  float mDelayVisible;
60  Widget* mOldFocusWidget;
61  IntPoint mOldMousePoint;
62  bool mToolTipVisible;
63  float mCurrentTime;
64  size_t mOldIndex;
65  bool mNeedToolTip;
66 
67  bool mIsInitialise;
68  };
69 
70 } // namespace MyGUI
71 
72 #endif // __MYGUI_TOOL_TIP_MANAGER_H__