From: Vadim Zeitlin Date: Thu, 4 May 2006 16:07:15 +0000 (+0000) Subject: relay mouse move events to the tooltips even when the window itself doesn't have... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c009bf3e9fdbbbe794c0670ff1b1f9f296c91c02?ds=inline relay mouse move events to the tooltips even when the window itself doesn't have a tooltip -- but its subwindow does git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39029 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index 01232d1ac9..b69eecbabc 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -187,6 +187,11 @@ public: // MSW only: true if this control is part of the main control virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return false; }; +#if wxUSE_TOOLTIPS + // MSW only: true if this window or any of its children have a tooltip + virtual bool HasToolTips() const { return GetToolTip() != NULL; } +#endif // wxUSE_TOOLTIPS + // translate wxWidgets style flags for this control into the Windows style // and optional extended style for the corresponding native control // diff --git a/src/msw/evtloop.cpp b/src/msw/evtloop.cpp index 805fb95ef4..c260f52ea2 100644 --- a/src/msw/evtloop.cpp +++ b/src/msw/evtloop.cpp @@ -141,11 +141,10 @@ bool wxEventLoop::PreProcessMessage(WXMSG *msg) // popup the tooltip bubbles if ( msg->message == WM_MOUSEMOVE ) { - wxToolTip *tt = wndThis->GetToolTip(); - if ( tt ) - { - tt->RelayEvent((WXMSG *)msg); - } + // we should do it if one of window children has an associated tooltip + // (and not just if the window has a tooltip itself) + if ( wndThis->HasToolTips() ) + wxToolTip::RelayEvent((WXMSG *)msg); } #endif // wxUSE_TOOLTIPS