#include "wx/mdi.h"
#endif
-#include <wx/toolbar.h>
-#include <wx/svg/dcsvg.h>
+#include "wx/toolbar.h"
+#include "wx/svg/dcsvg.h"
-#include "mondrian.xpm"
+#include "mondrian.xpm"
#include "bitmaps/new.xpm"
#include "bitmaps/save.xpm"
#include "bitmaps/help.xpm"
#include "SVGlogo24.xpm"
-
+
class MyChild;
// Define a new application
{
public:
int m_index ;
-
+
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);
-
+
// Make a menubar
wxMenu *file_menu = new wxMenu;
SetTopWindow(frame);
- return TRUE;
+ return true;
}
// Associate the menu bar with the frame
subframe->SetMenuBar(menu_bar);
- subframe->Show(TRUE);
+ subframe->Show(true);
}
int width = 16;
int currentX = 5;
- 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"));
currentX += width + 5;
- 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"));
currentX += width + 5;
- 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"));
toolBar->Realize();
void MyFrame::FileSavePicture (wxCommandEvent & WXUNUSED(event) )
{
+#if wxUSE_FILEDLG
MyChild * pChild = (MyChild *)GetActiveChild ();
- if (pChild == NULL)
+ if (pChild == NULL)
{
return ;
}
}
}
return ;
+#endif // wxUSE_FILEDLG
}
dc.SetFont(*wxSWISS_FONT);
dc.SetPen(*wxGREEN_PEN);
-
+
switch (m_index)
{
default:
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);
- 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);
break ;
case 5:
- 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.SetMapMode (wxMM_METRIC) ; //svg ignores this
dc.DrawLine(0, 0, 200, 200);
dc.DrawLine(200, 0, 0, 200);
- dc.DrawText(wxT("This is an 18pt string in MapMode"), 50, 60);
+ dc.DrawText(wxT("This is an 18pt string in MapMode"), 50, 60);
#if wxUSE_STATUSBAR
s = wxT("Scaling test page");
#endif // wxUSE_STATUSBAR
m_frame = (MyFrame *) parent ;
#if wxUSE_STATUSBAR
CreateStatusBar();
- SetStatusText(title);
+ SetStatusText(title);
#endif // wxUSE_STATUSBAR
int w, h ;
void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event))
{
- Close(TRUE);
+ Close(true);
}