#endif
#include "wx/frame.h"
-#include "wx/mac/statusbr.h"
+#include "wx/statusbr.h"
#include "wx/toolbar.h"
#include "wx/menuitem.h"
#include "wx/menu.h"
void wxFrame::Init()
{
+ m_frameMenuBar = NULL;
+
+#if wxUSE_TOOLBAR
+ m_frameToolBar = NULL ;
+#endif
+ m_frameStatusBar = NULL;
+ m_winLastFocused = NULL ;
+
m_iconized = FALSE;
#if wxUSE_TOOLTIPS
long style,
const wxString& name)
{
- m_frameMenuBar = NULL;
-
-#if wxUSE_TOOLBAR
- m_frameToolBar = NULL ;
-#endif
- m_frameStatusBar = NULL;
-
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
if ( id > -1 )
{
wxStatusBar *statusBar = NULL;
- statusBar = new wxStatusBar(this, id, style, name);
-
+ statusBar = new wxStatusBar(this, id,
+ style, name);
+ statusBar->SetSize( 100 , 15 ) ;
statusBar->SetFieldsCount(number);
return statusBar;
}
// Since we wish the status bar to be directly under the client area,
// we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
- m_frameStatusBar->SetSize(0, h, w, WX_MAC_STATUSBAR_HEIGHT );
+ m_frameStatusBar->SetSize(0, h, w, sh);
}
}
return;
}
- m_frameMenuBar = NULL;
m_frameMenuBar = menuBar;
- m_frameMenuBar->MacInstallMenuBar() ;
+// m_frameMenuBar->MacInstallMenuBar() ;
m_frameMenuBar->Attach(this);
}
{
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
)
{
child->SetFocus();
- return;
+ break;
}
}
+ */
+ wxSetFocusToChild(this, &m_winLastFocused);
+
+ if ( m_frameMenuBar != NULL )
+ {
+ m_frameMenuBar->MacInstallMenuBar() ;
+ }
+ }
}
void wxFrame::DoGetClientSize(int *x, int *y) const
{
int statusX, statusY;
GetStatusBar()->GetClientSize(&statusX, &statusY);
- // right now this is a constant, this might change someday
- *y -= WX_MAC_STATUSBAR_HEIGHT ;
+ *y -= statusY;
}
#endif // wxUSE_STATUSBAR