#include "wx/dialog.h"
#include "wx/settings.h"
#include "wx/dcclient.h"
+ #include "wx/mdi.h"
#endif // WX_PRECOMP
#include "wx/msw/private.h"
wxStatusBar *statusBar = NULL;
#if wxUSE_NATIVE_STATUSBAR
- if ( UsesNativeStatusBar() )
+ if ( !UsesNativeStatusBar() )
{
- statusBar = (wxStatusBar *)new wxStatusBar95(this, id, style);
-
- statusBar->SetFieldsCount(number);
+ statusBar = (wxStatusBar *)new wxStatusBarGeneric(this, id, style);
}
else
#endif
{
- statusBar = (wxStatusBar *)new wxStatusBarGeneric(this, id, style, name);
+ statusBar = new wxStatusBar(this, id, style, name);
+ }
- // Set the height according to the font and the border size
- wxClientDC dc(statusBar);
- dc.SetFont(statusBar->GetFont());
+ // Set the height according to the font and the border size
+ wxClientDC dc(statusBar);
+ dc.SetFont(statusBar->GetFont());
- wxCoord y;
- dc.GetTextExtent(_T("X"), NULL, &y );
+ wxCoord y;
+ dc.GetTextExtent(_T("X"), NULL, &y );
- int height = (int)( (11*y)/10 + 2*statusBar->GetBorderY());
+ int height = (int)( (11*y)/10 + 2*statusBar->GetBorderY());
- statusBar->SetSize(-1, -1, -1, height);
+ statusBar->SetSize(-1, -1, -1, height);
- statusBar->SetFieldsCount(number);
- }
+ statusBar->SetFieldsCount(number);
return statusBar;
}
if ( !m_frameStatusBar )
return;
- // native status bar positions itself, but we must forward the WM_SIZE
- // messages to it
-#if wxUSE_NATIVE_STATUSBAR
- wxStatusBar95 *sb = wxDynamicCast(m_frameStatusBar, wxStatusBar95);
- if ( sb )
- {
- wxSizeEvent event(GetSize(), sb->GetId());
- event.SetEventObject(sb);
+ int w, h;
+ GetClientSize(&w, &h);
+ int sw, sh;
+ m_frameStatusBar->GetSize(&sw, &sh);
- sb->GetEventHandler()->ProcessEvent(event);
- }
- else
-#endif // wxUSE_NATIVE_STATUSBAR
- {
- int w, h;
- GetClientSize(&w, &h);
- int sw, sh;
- m_frameStatusBar->GetSize(&sw, &sh);
-
- // 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, sh);
- }
+ // 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, sh);
}
#endif // wxUSE_STATUSBAR
{
wxWindow *win = node->GetData();
- if ( win->IsKindOf(CLASSINFO(wxFrame)) )
+ // the child MDI frames are a special case and should not be touched by
+ // the parent frame - instead, they are managed by the user
+ wxFrame *frame = wxDynamicCast(win, wxFrame);
+ if ( frame && !wxDynamicCast(frame, wxMDIChildFrame) )
{
- ((wxFrame *)win)->Iconize(bIconize);
+ frame->Iconize(bIconize);
}
}
}