20 mOldFocusWidget(nullptr),
21 mToolTipVisible(false),
26 mSingletonHolder(this)
36 mOldFocusWidget =
nullptr;
37 mToolTipVisible =
false;
58 mIsInitialise =
false;
61 void ToolTipManager::notifyEventFrameStart(
float _time)
64 if (mOldFocusWidget != widget)
68 mToolTipVisible =
false;
69 hideToolTip(mOldFocusWidget);
71 mOldFocusWidget = widget;
74 if (mOldFocusWidget !=
nullptr)
78 mOldIndex = getToolTipIndex(mOldFocusWidget);
79 mNeedToolTip = isNeedToolTip(mOldFocusWidget);
82 else if (mNeedToolTip)
89 mToolTipVisible =
false;
90 hideToolTip(mOldFocusWidget);
96 if (!mToolTipVisible && point != mOldMousePoint)
99 mOldMousePoint = point;
100 mOldIndex = getToolTipIndex(mOldFocusWidget);
104 size_t index = getToolTipIndex(mOldFocusWidget);
105 if (mOldIndex != index)
109 mToolTipVisible =
false;
110 hideToolTip(mOldFocusWidget);
117 if (!mToolTipVisible)
119 mCurrentTime += _time;
120 if (mCurrentTime >= mDelayVisible)
122 mToolTipVisible =
true;
123 showToolTip(mOldFocusWidget, mOldIndex, point);
126 else if (point != mOldMousePoint)
128 moveToolTip(mOldFocusWidget, mOldIndex, point);
138 if (mOldFocusWidget == _widget)
142 mToolTipVisible =
false;
143 hideToolTip(mOldFocusWidget);
145 mOldFocusWidget =
nullptr;
146 mNeedToolTip =
false;
150 void ToolTipManager::hideToolTip(
Widget* _widget)
153 if (container !=
nullptr)
159 void ToolTipManager::showToolTip(Widget* _widget,
size_t _index,
const IntPoint& _point)
162 if (container !=
nullptr)
168 void ToolTipManager::moveToolTip(Widget* _widget,
size_t _index,
const IntPoint& _point)
170 Widget* container = _widget->_getContainer();
171 if (container !=
nullptr)
172 container->eventToolTip(container, ToolTipInfo(
ToolTipInfo::Move, _index, _point));
177 bool ToolTipManager::isNeedToolTip(Widget* _widget)
179 Widget* container = _widget->_getContainer();
180 if (container !=
nullptr)
181 return container->getNeedToolTip();
182 return _widget->getNeedToolTip();
185 size_t ToolTipManager::getToolTipIndex(Widget* _widget)
const
187 Widget* container = _widget->_getContainer();
188 if (container !=
nullptr)
189 return container->_getItemIndex(_widget);
195 mDelayVisible = _value;
200 return mDelayVisible;
#define MYGUI_ASSERT(exp, dest)
#define MYGUI_LOG(level, text)
static Gui & getInstance()
EventHandle_FrameEventDelegate eventFrameStart
delegates::DelegateFunction< Args... > * newDelegate(void(*_func)(Args... args))
types::TPoint< int > IntPoint
MYGUI_SINGLETON_DEFINITION(ClipboardManager)