MyGUI  3.2.1
MyGUI_ToolTipManager.h
Go to the documentation of this file.
00001 /*
00002  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
00003  * Distributed under the MIT License
00004  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
00005  */
00006 
00007 #ifndef __MYGUI_TOOL_TIP_MANAGER_H__
00008 #define __MYGUI_TOOL_TIP_MANAGER_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_IUnlinkWidget.h"
00012 #include "MyGUI_Singleton.h"
00013 
00014 namespace MyGUI
00015 {
00016 
00017     class MYGUI_EXPORT ToolTipManager :
00018         public Singleton<ToolTipManager>,
00019         public IUnlinkWidget
00020     {
00021     public:
00022         ToolTipManager();
00023 
00024         void initialise();
00025         void shutdown();
00026 
00027         void setDelayVisible(float _value);
00028         float getDelayVisible() const;
00029 
00030         /*internal:*/
00031         void _unlinkWidget(Widget* _widget);
00032 
00033     private:
00034         void notifyEventFrameStart(float _time);
00035 
00036         void hideToolTip(Widget* _widget);
00037         void showToolTip(Widget* _widget, size_t _index, const IntPoint& _point);
00038         void moveToolTip(Widget* _widget, size_t _index, const IntPoint& _point);
00039 
00040         bool isNeedToolTip(Widget* _widget);
00041         size_t getToolTipIndex(Widget* _widget) const;
00042 
00043     private:
00044         float mDelayVisible;
00045         Widget* mOldFocusWidget;
00046         IntPoint mOldMousePoint;
00047         bool mToolTipVisible;
00048         float mCurrentTime;
00049         size_t mOldIndex;
00050         bool mNeedToolTip;
00051 
00052         bool mIsInitialise;
00053     };
00054 
00055 } // namespace MyGUI
00056 
00057 #endif // __MYGUI_TOOL_TIP_MANAGER_H__