-/*
- for ( wxWindowList::Node *node = GetChildren().GetFirst();
- node;
- node = node->GetNext() )
- {
- // FIXME all this is totally bogus - we need to do the same as wxPanel,
- // but how to do it without duplicating the code?
-
- // restore focus
- wxWindow *child = node->GetData();
-
- if ( !child->IsTopLevel() && child->AcceptsFocus()
-#if wxUSE_TOOLBAR
- && !wxDynamicCast(child, wxToolBar)
-#endif // wxUSE_TOOLBAR
-#if wxUSE_STATUSBAR
- && !wxDynamicCast(child, wxStatusBar)
-#endif // wxUSE_STATUSBAR
- )
+ // restore focus to the child which was last focused
+ wxWindow *parent = m_winLastFocused ? m_winLastFocused->GetParent()
+ : NULL;
+ if ( !parent )