X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a4f1a5f286aba99a0ed1098bfae1e28eb68c62d1..460354e939bc52de1b5a749b6d88d6ef21f5827b:/samples/mdi/mdi.cpp diff --git a/samples/mdi/mdi.cpp b/samples/mdi/mdi.cpp index f8b7b47e74..24f0741ccb 100644 --- a/samples/mdi/mdi.cpp +++ b/samples/mdi/mdi.cpp @@ -72,7 +72,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxMDIParentFrame) EVT_MENU(MDI_QUIT, MyFrame::OnQuit) EVT_CLOSE(MyFrame::OnClose) - + EVT_ICONIZE(MyFrame::OnIconize) EVT_SIZE(MyFrame::OnSize) END_EVENT_TABLE() @@ -145,7 +145,9 @@ bool MyApp::OnInit() // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); +#if wxUSE_STATUSBAR frame->CreateStatusBar(); +#endif // wxUSE_STATUSBAR frame->Show(true); @@ -260,8 +262,10 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event) ) // Associate the menu bar with the frame subframe->SetMenuBar(menu_bar); +#if wxUSE_STATUSBAR subframe->CreateStatusBar(); subframe->SetStatusText(title); +#endif // wxUSE_STATUSBAR int width, height; subframe->GetClientSize(&width, &height); @@ -297,6 +301,12 @@ void MyFrame::OnSize(wxSizeEvent& #endif } +void MyFrame::OnIconize(wxIconizeEvent& event) +{ + wxSizeEvent e; + OnSize (e) ; +} + #if wxUSE_TOOLBAR void MyFrame::InitToolBar(wxToolBar* toolBar) { @@ -314,24 +324,24 @@ void MyFrame::InitToolBar(wxToolBar* toolBar) int width = 24; int currentX = 5; - toolBar->AddTool( MDI_NEW_WINDOW, *(bitmaps[0]), wxNullBitmap, false, currentX, wxDefaultPosition.y, (wxObject *) NULL, _T("New file")); + toolBar->AddTool( MDI_NEW_WINDOW, *(bitmaps[0]), wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, _T("New file")); currentX += width + 5; - toolBar->AddTool(1, *bitmaps[1], wxNullBitmap, false, currentX, wxDefaultPosition.y, (wxObject *) NULL, _T("Open file")); + toolBar->AddTool(1, *bitmaps[1], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, _T("Open file")); currentX += width + 5; - toolBar->AddTool(2, *bitmaps[2], wxNullBitmap, false, currentX, wxDefaultPosition.y, (wxObject *) NULL, _T("Save file")); + toolBar->AddTool(2, *bitmaps[2], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, _T("Save file")); currentX += width + 5; toolBar->AddSeparator(); - toolBar->AddTool(3, *bitmaps[3], wxNullBitmap, false, currentX, wxDefaultPosition.y, (wxObject *) NULL, _T("Copy")); + toolBar->AddTool(3, *bitmaps[3], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, _T("Copy")); currentX += width + 5; - toolBar->AddTool(4, *bitmaps[4], wxNullBitmap, false, currentX, wxDefaultPosition.y, (wxObject *) NULL, _T("Cut")); + toolBar->AddTool(4, *bitmaps[4], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, _T("Cut")); currentX += width + 5; - toolBar->AddTool(5, *bitmaps[5], wxNullBitmap, false, currentX, wxDefaultPosition.y, (wxObject *) NULL, _T("Paste")); + toolBar->AddTool(5, *bitmaps[5], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, _T("Paste")); currentX += width + 5; toolBar->AddSeparator(); - toolBar->AddTool(6, *bitmaps[6], wxNullBitmap, false, currentX, wxDefaultPosition.y, (wxObject *) NULL, _T("Print")); + toolBar->AddTool(6, *bitmaps[6], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, _T("Print")); currentX += width + 5; toolBar->AddSeparator(); - toolBar->AddTool( MDI_ABOUT, *bitmaps[7], wxNullBitmap, true, currentX, wxDefaultPosition.y, (wxObject *) NULL, _T("Help")); + toolBar->AddTool( MDI_ABOUT, *bitmaps[7], wxNullBitmap, true, currentX, wxDefaultCoord, (wxObject *) NULL, _T("Help")); toolBar->Realize();