X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c52d95b412d81372e2705d5e1c03a0417af79ade..d6d26e0414f6d4930ccc186db2ff994f83aff853:/samples/mdi/mdi.cpp diff --git a/samples/mdi/mdi.cpp b/samples/mdi/mdi.cpp index ebcd2cc977..892bdd5537 100644 --- a/samples/mdi/mdi.cpp +++ b/samples/mdi/mdi.cpp @@ -104,6 +104,14 @@ bool MyApp::OnInit() frame = new MyFrame((wxFrame *)NULL, -1, "MDI Demo", wxPoint(-1, -1), wxSize(500, 400), wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL); +#ifdef __WXMSW__ +#if 0 + // Experimental: change the window menu + wxMenu* windowMenu = new wxMenu; + windowMenu->Append(5000, "My menu item!"); + frame->SetWindowMenu(windowMenu); +#endif +#endif // Give it an icon #ifdef __WXMSW__ @@ -172,7 +180,7 @@ void MyFrame::OnClose(wxCloseEvent& event) if ( event.CanVeto() && (gs_nFrames > 0) ) { wxString msg; - msg.Printf("%d windows still open, close anyhow?", gs_nFrames); + msg.Printf(_T("%d windows still open, close anyhow?"), gs_nFrames); if ( wxMessageBox(msg, "Please confirm", wxICON_QUESTION | wxYES_NO) != wxYES ) { @@ -205,7 +213,7 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event) ) wxDEFAULT_FRAME_STYLE); wxString title; - title.Printf("Canvas Frame %d", ++gs_nFrames); + title.Printf(_T("Canvas Frame %d"), ++gs_nFrames); subframe->SetTitle(title); @@ -240,6 +248,9 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event) ) // Associate the menu bar with the frame subframe->SetMenuBar(menu_bar); + subframe->CreateStatusBar(); + subframe->SetStatusText(title); + int width, height; subframe->GetClientSize(&width, &height); MyCanvas *canvas = new MyCanvas(subframe, wxPoint(0, 0), wxSize(width, height)); @@ -249,13 +260,10 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event) ) // Give it scrollbars canvas->SetScrollbars(20, 20, 50, 50); - subframe->CreateStatusBar(); - subframe->SetStatusText(title); - subframe->Show(TRUE); } -void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event) ) +void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event)) { int w, h; GetClientSize(&w, &h); @@ -349,7 +357,9 @@ void MyCanvas::OnDraw(wxDC& dc) dc.DrawRoundedRectangle(150, 150, 100, 50, 20); dc.DrawEllipse(250, 250, 100, 50); +#if wxUSE_SPLINES dc.DrawSpline(50, 200, 50, 100, 200, 10); +#endif // wxUSE_SPLINES dc.DrawLine(50, 230, 200, 230); dc.DrawText("This is a test string", 50, 230);