wxASSERT_MSG( GetChildren().GetCount() == 0, _T("children not destroyed") );
+ // make sure that there are no dangling pointers left pointing to us
+ wxPanel *panel = wxDynamicCast(GetParent(), wxPanel);
+ if ( panel )
+ {
+ if ( panel->GetLastFocus() == this )
+ {
+ panel->SetLastFocus((wxWindow *)NULL);
+ }
+ }
+
#if wxUSE_CARET
if ( m_caret )
delete m_caret;
int maxX = 0,
maxY = 0;
- wxWindowList::Node *node = GetChildren().GetFirst();
- while ( node )
+ for ( wxWindowList::Node *node = GetChildren().GetFirst();
+ node;
+ node = node->GetNext() )
{
wxWindow *win = node->GetData();
if ( win->IsTopLevel() )
maxX = wx + ww;
if ( wy + wh > maxY )
maxY = wy + wh;
-
- node = node->GetNext();
}
// leave a margin