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
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user