From: Vadim Zeitlin Date: Tue, 16 Nov 2010 22:38:13 +0000 (+0000) Subject: Correct wxMSW wxToolTip behaviour for wxRadioBox items tooltips. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a48cf5e2d30e5415d961ffdbb05fdc53e3d88255 Correct wxMSW wxToolTip behaviour for wxRadioBox items tooltips. The assert added in r66053 checking that we couldn't have tooltips for child windows if we didn't have the tooltip for the main one turned out to be wrong, at least in wxRadioBox case it's perfectly possible to have the tooltips for the individual radio buttons without having one for the box itself. Replace the assert with a simple if check. This fixes a unit test failure in RadioBoxTestCase. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66169 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index e9e84c7621..d18525e22b 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -357,7 +357,7 @@ void wxToolTip::Remove(WXHWND hWnd, unsigned int id, const wxRect& rc) void wxToolTip::DoRemove(WXHWND hWnd) { - if ( hWnd == m_window->GetHWND() ) + if ( m_window && hWnd == m_window->GetHWND() ) { // Remove the tooltip from the main window. Remove(hWnd, m_id, m_rect); @@ -567,15 +567,11 @@ void wxToolTip::DoSetTip(WXHWND hWnd) void wxToolTip::DoForAllWindows(void (wxToolTip::*func)(WXHWND)) { - if ( !m_window ) + if ( m_window ) { - wxASSERT_MSG( !m_others, - wxS("Can't have other windows without the main one.") ); - return; + (this->*func)(m_window->GetHWND()); } - (this->*func)(m_window->GetHWND()); - if ( m_others ) { for ( wxToolTipOtherWindows::const_iterator it = m_others->begin();