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);
DoForAllWindows(&wxToolTip::DoRemove);
}
-void wxToolTip::Add(WXHWND hWnd)
+void wxToolTip::AddOtherWindow(WXHWND hWnd)
{
if ( !m_others )
m_others = new wxToolTipOtherWindows;
m_others->push_back(hWnd);
- DoAddOtherWindow(hWnd);
+ DoAddHWND(hWnd);
}
-void wxToolTip::DoAddOtherWindow(WXHWND hWnd)
+void wxToolTip::DoAddHWND(WXHWND hWnd)
{
HWND hwnd = (HWND)hWnd;
// add the window itself
if ( m_window )
{
- Add(m_window->GetHWND());
+ DoAddHWND(m_window->GetHWND());
}
#if !defined(__WXUNIVERSAL__)
// and all of its subcontrols (e.g. radio buttons in a radiobox) as well
// must have it by now!
wxASSERT_MSG( hwnd, wxT("no hwnd for subcontrol?") );
- Add((WXHWND)hwnd);
+ AddOtherWindow((WXHWND)hwnd);
}
}
#endif // !defined(__WXUNIVERSAL__)
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();