]> git.saurik.com Git - wxWidgets.git/commitdiff
relay mouse move events to the tooltips even when the window itself doesn't have...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 4 May 2006 16:07:15 +0000 (16:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 4 May 2006 16:07:15 +0000 (16:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39029 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/window.h
src/msw/evtloop.cpp

index 01232d1ac9a8d2c9b1e9db3932137082365d61cb..b69eecbabca8d283032702ed20d1063e3c8d17e3 100644 (file)
@@ -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
     //
index 805fb95ef4aebd703fdfa5f8717ea7b71dc8b3c1..c260f52ea2b3074c05b6328c6512b88e5f37b306 100644 (file)
@@ -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