X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/87728739f23c6fcc737614e2e726f68778f9415b..c0b0635cf69537ca32377bad5650b39402cb21b6:/contrib/samples/svg/svgtest.cpp diff --git a/contrib/samples/svg/svgtest.cpp b/contrib/samples/svg/svgtest.cpp index b16331b2a7..96ba193cf8 100644 --- a/contrib/samples/svg/svgtest.cpp +++ b/contrib/samples/svg/svgtest.cpp @@ -39,9 +39,8 @@ USERC("svg.rc"); #include #include -#ifndef __WXMSW__ #include "mondrian.xpm" -#endif + #include "bitmaps/new.xpm" #include "bitmaps/save.xpm" #include "bitmaps/help.xpm" @@ -180,9 +179,11 @@ 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); + frame->Show(true); SetTopWindow(frame); @@ -217,22 +218,22 @@ void MyFrame::OnClose(wxCloseEvent& event) event.Skip(); return ; } - if ( m_children.Number () < 1 ) + if ( m_children.GetCount () < 1 ) { event.Skip(); return ; } // now try the children - wxNode * pNode = m_children.GetFirst (); - wxNode * pNext ; + wxObjectList::compatibility_iterator pNode = m_children.GetFirst (); + wxObjectList::compatibility_iterator pNext ; MyChild * pChild ; while ( pNode ) { pNext = pNode -> GetNext (); - pChild = (MyChild*) pNode -> Data (); + pChild = (MyChild*) pNode -> GetData (); if (pChild -> Close ()) { - delete pNode ; + m_children.Erase(pNode) ; } else { @@ -253,9 +254,9 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) ) { - (void)wxMessageBox(wxT("wxWindows 2.0 SVG 1.0 Test\n" - "Author: Chris Elliott (c) 2002\n" - "Usage: svg.exe \nClick File | New to show tests\n\n"), wxT("About SVG Test")); + (void)wxMessageBox(wxT("wxWidgets 2.0 SVG 1.0 Test\n") + wxT("Author: Chris Elliott (c) 2002\n") + wxT("Usage: svg.exe \nClick File | New to show tests\n\n"), wxT("About SVG Test")); } @@ -268,7 +269,7 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event) ) wxPoint(-1, -1), wxSize(-1, -1), wxDEFAULT_FRAME_STYLE ) ) ; - subframe = (MyChild *) m_children.GetLast() -> Data (); + subframe = (MyChild *) m_children.GetLast() -> GetData (); wxString title; title.Printf(wxT("SVG Test Window %d"), nWinCreated ); // counts number of children previously, even if now closed @@ -301,12 +302,13 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event) ) } -void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event)) +void MyFrame::OnSize(wxSizeEvent& event) { int w, h; GetClientSize(&w, &h); GetClientWindow()->SetSize(0, 0, w, h); + event.Skip(); } @@ -391,7 +393,9 @@ wxSUNKEN_BORDER|wxVSCROLL|wxHSCROLL) void MyCanvas::OnDraw(wxDC& dc) { // vars to use ... +#if wxUSE_STATUSBAR wxString s ; +#endif // wxUSE_STATUSBAR wxPen wP ; wxBrush wB ; wxPoint points[6]; @@ -417,7 +421,9 @@ void MyCanvas::OnDraw(wxDC& dc) dc.DrawPoint (25,15) ; dc.DrawLine(50, 30, 200, 30); dc.DrawSpline(50, 200, 50, 100, 200, 10); +#if wxUSE_STATUSBAR s = wxT("Green Cross, Cyan Line and spline"); +#endif // wxUSE_STATUSBAR break ; case 1: @@ -440,7 +446,9 @@ void MyCanvas::OnDraw(wxDC& dc) dc.DrawPolygon(5, points); dc.DrawLines (6, points, 160); +#if wxUSE_STATUSBAR s = wxT("Blue rectangle, red edge, clear rounded rectangle, gold ellipse, gold and clear stars"); +#endif // wxUSE_STATUSBAR break ; case 2: @@ -460,22 +468,24 @@ void MyCanvas::OnDraw(wxDC& dc) dc.SetFont(wF); dc.SetTextForeground (wC) ; dc.DrawText(wxT("This is a Times-style string"), 50, 60); +#if wxUSE_STATUSBAR s = wxT("Swiss, Times text; red text, rotated and colored orange"); +#endif // wxUSE_STATUSBAR break ; case 3 : // four arcs start and end points, center dc.SetBrush(*wxGREEN_BRUSH); - dc.DrawArc ( 200,300, 370,230, 300.0,300.0 ); + dc.DrawArc ( 200,300, 370,230, 300,300 ); dc.SetBrush(*wxBLUE_BRUSH); - dc.DrawArc ( 270-50, 270-86, 270-86, 270-50, 270.0,270.0 ); + dc.DrawArc ( 270-50, 270-86, 270-86, 270-50, 270,270 ); dc.SetDeviceOrigin(-10,-10); - dc.DrawArc ( 270-50, 270-86, 270-86, 270-50, 270.0,270.0 ); + dc.DrawArc ( 270-50, 270-86, 270-86, 270-50, 270,270 ); dc.SetDeviceOrigin(0,0); wP.SetColour (_T("CADET BLUE")); dc.SetPen(wP); - dc.DrawArc ( 75,125, 110, 40, 75.0, 75.0 ); + dc.DrawArc ( 75,125, 110, 40, 75, 75 ); wP.SetColour (_T("SALMON")); dc.SetPen(wP); @@ -494,7 +504,9 @@ void MyCanvas::OnDraw(wxDC& dc) dc.DrawEllipticArc(300, 50,200,100,90.0,145.0) ; dc.DrawEllipticArc(300,100,200,100,90.0,345.0) ; +#if wxUSE_STATUSBAR s = wxT("This is an arc test page"); +#endif // wxUSE_STATUSBAR break ; case 4: @@ -502,7 +514,9 @@ void MyCanvas::OnDraw(wxDC& dc) dc.SetBrush (wxBrush (_T("SALMON"),wxTRANSPARENT)); dc.DrawCheckMark ( 80,50,75,75); dc.DrawRectangle ( 80,50,75,75); +#if wxUSE_STATUSBAR s = wxT("Two check marks"); +#endif // wxUSE_STATUSBAR break ; case 5: @@ -532,17 +546,23 @@ void MyCanvas::OnDraw(wxDC& dc) dc.DrawLine(0, 0, 200, 200); dc.DrawLine(200, 0, 0, 200); dc.DrawText(wxT("This is an 18pt string in MapMode"), 50, 60); +#if wxUSE_STATUSBAR s = wxT("Scaling test page"); +#endif // wxUSE_STATUSBAR break ; case 6: - dc.DrawIcon( wxICON(mondrian), 10, 10 ); - dc.DrawBitmap ( wxBITMAP (svgbitmap), 50,15); + dc.DrawIcon( wxIcon(mondrian_xpm), 10, 10 ); + dc.DrawBitmap ( wxBitmap(svgbitmap_xpm), 50,15); +#if wxUSE_STATUSBAR s = wxT("Icon and Bitmap "); +#endif // wxUSE_STATUSBAR break ; } +#if wxUSE_STATUSBAR m_child->SetStatusText(s); +#endif // wxUSE_STATUSBAR } @@ -559,8 +579,10 @@ const long style) { m_frame = (MyFrame *) parent ; +#if wxUSE_STATUSBAR CreateStatusBar(); SetStatusText(title); +#endif // wxUSE_STATUSBAR int w, h ; GetClientSize ( &w, &h );