#include "bitmaps/new.xpm"
#include "bitmaps/save.xpm"
#include "bitmaps/help.xpm"
#include "SVGlogo24.xpm"
#include "bitmaps/new.xpm"
#include "bitmaps/save.xpm"
#include "bitmaps/help.xpm"
#include "SVGlogo24.xpm"
MyChild * m_child ;
MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size);
virtual void OnDraw(wxDC& dc);
MyChild * m_child ;
MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size);
virtual void OnDraw(wxDC& dc);
frame = new MyFrame((wxFrame *)NULL, -1, wxT("SVG Demo"),
wxPoint(-1, -1), wxSize(500, 400),
wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL);
frame = new MyFrame((wxFrame *)NULL, -1, wxT("SVG Demo"),
wxPoint(-1, -1), wxSize(500, 400),
wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL);
- (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"));
wxPoint(-1, -1), wxSize(-1, -1),
wxDEFAULT_FRAME_STYLE ) ) ;
wxPoint(-1, -1), wxSize(-1, -1),
wxDEFAULT_FRAME_STYLE ) ) ;
wxString title;
title.Printf(wxT("SVG Test Window %d"), nWinCreated );
// counts number of children previously, even if now closed
wxString title;
title.Printf(wxT("SVG Test Window %d"), nWinCreated );
// counts number of children previously, even if now closed
{
int w, h;
GetClientSize(&w, &h);
GetClientWindow()->SetSize(0, 0, w, h);
{
int w, h;
GetClientSize(&w, &h);
GetClientWindow()->SetSize(0, 0, w, h);
- toolBar->AddTool( MDI_NEW_WINDOW, *(bitmaps[0]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, wxT("New SVG test window"));
+ toolBar->AddTool( MDI_NEW_WINDOW, *(bitmaps[0]), wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("New SVG test window"));
- toolBar->AddTool( MDI_SAVE, *bitmaps[1], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, wxT("Save test in SVG format"));
+ toolBar->AddTool( MDI_SAVE, *bitmaps[1], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("Save test in SVG format"));
- toolBar->AddSeparator();
- toolBar->AddTool(MDI_ABOUT, *bitmaps[2], wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, wxT("Help"));
+ toolBar->AddSeparator();
+ toolBar->AddTool(MDI_ABOUT, *bitmaps[2], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("Help"));
{
return ;
}
wxFileDialog dialog(this, wxT("Save Picture as"), wxEmptyString, pChild->GetTitle(),
wxT("SVG vector picture files (*.svg)|*.svg"),
{
return ;
}
wxFileDialog dialog(this, wxT("Save Picture as"), wxEmptyString, pChild->GetTitle(),
wxT("SVG vector picture files (*.svg)|*.svg"),
dc.DrawPoint (25,15) ;
dc.DrawLine(50, 30, 200, 30);
dc.DrawSpline(50, 200, 50, 100, 200, 10);
dc.DrawPoint (25,15) ;
dc.DrawLine(50, 30, 200, 30);
dc.DrawSpline(50, 200, 50, 100, 200, 10);
dc.DrawPolygon(5, points);
dc.DrawLines (6, points, 160);
dc.DrawPolygon(5, points);
dc.DrawLines (6, points, 160);
s = wxT("Blue rectangle, red edge, clear rounded rectangle, gold ellipse, gold and clear stars");
s = wxT("Blue rectangle, red edge, clear rounded rectangle, gold ellipse, gold and clear stars");
dc.DrawText(wxT("This is a Swiss-style string"), 50, 30);
wC = dc.GetTextForeground() ;
dc.SetTextForeground (_T("FIREBRICK"));
dc.DrawText(wxT("This is a Swiss-style string"), 50, 30);
wC = dc.GetTextForeground() ;
dc.SetTextForeground (_T("FIREBRICK"));
// no effect in msw ??
dc.SetTextBackground (_T("WHEAT"));
dc.DrawText(wxT("This is a Red string"), 50, 200);
dc.DrawRotatedText(wxT("This is a 45 deg string"), 50, 200, 45);
dc.DrawRotatedText(wxT("This is a 90 deg string"), 50, 200, 90);
// no effect in msw ??
dc.SetTextBackground (_T("WHEAT"));
dc.DrawText(wxT("This is a Red string"), 50, 200);
dc.DrawRotatedText(wxT("This is a 45 deg string"), 50, 200, 45);
dc.DrawRotatedText(wxT("This is a 90 deg string"), 50, 200, 90);
- wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD, FALSE, wxT("Times New Roman"));
+ wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD, false, wxT("Times New Roman"));
dc.SetFont(wF);
dc.SetTextForeground (wC) ;
dc.DrawText(wxT("This is a Times-style string"), 50, 60);
dc.SetFont(wF);
dc.SetTextForeground (wC) ;
dc.DrawText(wxT("This is a Times-style string"), 50, 60);
break ;
case 3 :
// four arcs start and end points, center
dc.SetBrush(*wxGREEN_BRUSH);
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.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.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.DrawArc ( 75,125, 110, 40, 75.0, 75.0 );
+ dc.DrawArc ( 75,125, 110, 40, 75, 75 );
dc.DrawEllipticArc(300, 50,200,100,90.0,145.0) ;
dc.DrawEllipticArc(300,100,200,100,90.0,345.0) ;
dc.DrawEllipticArc(300, 50,200,100,90.0,145.0) ;
dc.DrawEllipticArc(300,100,200,100,90.0,345.0) ;
dc.SetBrush (wxBrush (_T("SALMON"),wxTRANSPARENT));
dc.DrawCheckMark ( 80,50,75,75);
dc.DrawRectangle ( 80,50,75,75);
dc.SetBrush (wxBrush (_T("SALMON"),wxTRANSPARENT));
dc.DrawCheckMark ( 80,50,75,75);
dc.DrawRectangle ( 80,50,75,75);
- wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD, FALSE, wxT("Times New Roman"));
+ wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD, false, wxT("Times New Roman"));
dc.SetFont(wF);
dc.DrawLine(0, 0, 200, 200);
dc.DrawLine(200, 0, 0, 200);
dc.SetFont(wF);
dc.DrawLine(0, 0, 200, 200);
dc.DrawLine(200, 0, 0, 200);
dc.SetMapMode (wxMM_METRIC) ; //svg ignores this
dc.DrawLine(0, 0, 200, 200);
dc.DrawLine(200, 0, 0, 200);
dc.SetMapMode (wxMM_METRIC) ; //svg ignores this
dc.DrawLine(0, 0, 200, 200);
dc.DrawLine(200, 0, 0, 200);
- 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