X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c54e5eb0f6888c627547f882388df3cd86354a2f..2bd56258555dda8637c4ffa950a17259210e903e:/samples/svg/svgtest.cpp diff --git a/samples/svg/svgtest.cpp b/samples/svg/svgtest.cpp index 0f362ca893..2d20ab1368 100644 --- a/samples/svg/svgtest.cpp +++ b/samples/svg/svgtest.cpp @@ -1,12 +1,3 @@ -// biol75@york.ac.uk (Chris Elliott) March 2000 - -#ifdef __BIDE__ -#define _NO_VCL -#include "condefs.h" -USERC("svg.rc"); -//--------------------------------------------------------------------------- -#define WinMain WinMain -#endif ///////////////////////////////////////////////////////////////////////////// // Name: svgtest.cpp // Purpose: SVG sample @@ -36,8 +27,8 @@ USERC("svg.rc"); #include "wx/mdi.h" #endif -#include -#include +#include "wx/toolbar.h" +#include "wx/dcsvg.h" #include "mondrian.xpm" @@ -321,15 +312,10 @@ void MyFrame::InitToolBar(wxToolBar* toolBar) bitmaps[1] = new wxBitmap( save_xpm ); bitmaps[2] = new wxBitmap( help_xpm ); - int width = 16; - int currentX = 5; - - toolBar->AddTool( MDI_NEW_WINDOW, *(bitmaps[0]), wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("New SVG test window")); - currentX += width + 5; - toolBar->AddTool( MDI_SAVE, *bitmaps[1], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("Save test in SVG format")); - currentX += width + 5; + toolBar->AddTool(MDI_NEW_WINDOW, wxEmptyString, *(bitmaps[0]), wxS("New SVG test window")); + toolBar->AddTool(MDI_SAVE, wxEmptyString, *bitmaps[1], wxS("Save test in SVG format")); toolBar->AddSeparator(); - toolBar->AddTool(MDI_ABOUT, *bitmaps[2], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("Help")); + toolBar->AddTool(MDI_ABOUT, wxEmptyString, *bitmaps[2], wxS("Help")); toolBar->Realize(); @@ -350,7 +336,7 @@ void MyFrame::FileSavePicture (wxCommandEvent & WXUNUSED(event) ) wxFileDialog dialog(this, wxT("Save Picture as"), wxEmptyString, pChild->GetTitle(), wxT("SVG vector picture files (*.svg)|*.svg"), - wxSAVE|wxOVERWRITE_PROMPT); + wxFD_SAVE|wxFD_OVERWRITE_PROMPT); if (dialog.ShowModal() == wxID_OK) { @@ -433,10 +419,10 @@ void MyCanvas::OnDraw(wxDC& dc) dc.SetBrush(*wxCYAN_BRUSH); dc.SetPen(*wxRED_PEN); dc.DrawRectangle(10, 10, 100, 70); - wB = wxBrush (_T("DARK ORCHID"), wxTRANSPARENT); + wB = wxBrush (_T("DARK ORCHID"), wxBRUSHSTYLE_TRANSPARENT); dc.SetBrush (wB); dc.DrawRoundedRectangle(50, 50, 100, 70, 20); - dc.SetBrush (wxBrush(_T("GOLDENROD"), wxSOLID) ); + dc.SetBrush (wxBrush(_T("GOLDENROD")) ); dc.DrawEllipse(100, 100, 100, 50); points[0].x = 100; points[0].y = 200; @@ -500,7 +486,7 @@ void MyCanvas::OnDraw(wxDC& dc) wP.SetWidth(3); dc.SetPen(wP); //wxTRANSPARENT)); - dc.SetBrush (wxBrush (_T("SALMON"),wxSOLID)) ; + dc.SetBrush (wxBrush (_T("SALMON"))) ; dc.DrawEllipticArc(300, 0,200,100, 0.0,145.0) ; //same end point dc.DrawEllipticArc(300, 50,200,100,90.0,145.0) ; @@ -513,7 +499,7 @@ void MyCanvas::OnDraw(wxDC& dc) case 4: dc.DrawCheckMark ( 30,30,25,25); - dc.SetBrush (wxBrush (_T("SALMON"),wxTRANSPARENT)); + dc.SetBrush (wxBrush (_T("SALMON"),wxBRUSHSTYLE_TRANSPARENT)); dc.DrawCheckMark ( 80,50,75,75); dc.DrawRectangle ( 80,50,75,75); #if wxUSE_STATUSBAR @@ -611,7 +597,7 @@ bool MyChild::OnSave(wxString filename) { wxSVGFileDC svgDC (filename, 600, 650) ; m_canvas->OnDraw (svgDC); - return svgDC.Ok(); + return svgDC.IsOk(); }