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
This commit is contained in:
Vadim Zeitlin
2006-05-04 16:07:15 +00:00
parent 4453b38d02
commit c009bf3e9f
2 changed files with 9 additions and 5 deletions

View File

@@ -187,6 +187,11 @@ public:
// MSW only: true if this control is part of the main control // MSW only: true if this control is part of the main control
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return false; }; 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 // translate wxWidgets style flags for this control into the Windows style
// and optional extended style for the corresponding native control // and optional extended style for the corresponding native control
// //

View File

@@ -141,11 +141,10 @@ bool wxEventLoop::PreProcessMessage(WXMSG *msg)
// popup the tooltip bubbles // popup the tooltip bubbles
if ( msg->message == WM_MOUSEMOVE ) if ( msg->message == WM_MOUSEMOVE )
{ {
wxToolTip *tt = wndThis->GetToolTip(); // we should do it if one of window children has an associated tooltip
if ( tt ) // (and not just if the window has a tooltip itself)
{ if ( wndThis->HasToolTips() )
tt->RelayEvent((WXMSG *)msg); wxToolTip::RelayEvent((WXMSG *)msg);
}
} }
#endif // wxUSE_TOOLTIPS #endif // wxUSE_TOOLTIPS