m_frameToolBar = NULL ;
#endif
m_frameStatusBar = NULL;
+ m_winLastFocused = NULL ;
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
{
if ( !event.GetActive() )
{
+ // remember the last focused child
+ m_winLastFocused = FindFocus();
+ while ( m_winLastFocused )
+ {
+ if ( GetChildren().Find(m_winLastFocused) )
+ break;
+
+ m_winLastFocused = m_winLastFocused->GetParent();
+ }
+
event.Skip();
- return;
}
-
+ else
+ {
+/*
for ( wxWindowList::Node *node = GetChildren().GetFirst();
node;
node = node->GetNext() )
// restore focus
wxWindow *child = node->GetData();
- if ( !child->IsTopLevel()
+ if ( !child->IsTopLevel() && child->AcceptsFocus()
#if wxUSE_TOOLBAR
&& !wxDynamicCast(child, wxToolBar)
#endif // wxUSE_TOOLBAR
break;
}
}
-
- if ( m_frameMenuBar != NULL )
- {
- m_frameMenuBar->MacInstallMenuBar() ;
- }
+ */
+ wxSetFocusToChild(this, &m_winLastFocused);
+
+ if ( m_frameMenuBar != NULL )
+ {
+ m_frameMenuBar->MacInstallMenuBar() ;
+ }
+ }
}
void wxFrame::DoGetClientSize(int *x, int *y) const