canvas = NULL;
}
-void MyFrame::OnExit(wxCommandEvent& event)
+void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event))
{
Close(TRUE);
}
-void MyFrame::OnPrint(wxCommandEvent& event)
+void MyFrame::OnPrint(wxCommandEvent& WXUNUSED(event))
{
#ifdef __WXMSW__
wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
wxMessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wxOK);
}
-void MyFrame::OnPrintPS(wxCommandEvent& event)
+void MyFrame::OnPrintPS(wxCommandEvent& WXUNUSED(event))
{
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
printer.Print(this, &printout, TRUE);
}
-void MyFrame::OnPrintPreview(wxCommandEvent& event)
+void MyFrame::OnPrintPreview(wxCommandEvent& WXUNUSED(event))
{
#ifdef __WXMSW__
wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
frame->Show(TRUE);
}
-void MyFrame::OnPrintPreviewPS(wxCommandEvent& event)
+void MyFrame::OnPrintPreviewPS(wxCommandEvent& WXUNUSED(event))
{
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
frame->Show(TRUE);
}
-void MyFrame::OnPrintSetup(wxCommandEvent& event)
+void MyFrame::OnPrintSetup(wxCommandEvent& WXUNUSED(event))
{
#ifdef __WXMSW__
wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
orientation = printerDialog.GetPrintData().GetOrientation();
}
-void MyFrame::OnPageSetup(wxCommandEvent& event)
+void MyFrame::OnPageSetup(wxCommandEvent& WXUNUSED(event))
{
#ifdef __WXMSW__
wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
orientation = data.GetOrientation();
}
-void MyFrame::OnPrintSetupPS(wxCommandEvent& event)
+void MyFrame::OnPrintSetupPS(wxCommandEvent& WXUNUSED(event))
{
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
orientation = printerDialog.GetPrintData().GetOrientation();
}
-void MyFrame::OnPageSetupPS(wxCommandEvent& event)
+void MyFrame::OnPageSetupPS(wxCommandEvent& WXUNUSED(event))
{
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
orientation = pageSetupDialog.GetPageSetupData().GetOrientation();
}
-void MyFrame::OnPrintAbout(wxCommandEvent& event)
+void MyFrame::OnPrintAbout(wxCommandEvent& WXUNUSED(event))
{
(void)wxMessageBox("wxWindows printing demo\nAuthor: Julian Smart julian.smart@ukonline.co.uk",
"About wxWindows printing demo", wxOK|wxCENTRE);
dc.SetBrush(wxCYAN_BRUSH);
dc.SetPen(wxRED_PEN);
- dc.DrawRectangle(0.0, 30.0, 200.0, 100.0);
- dc.DrawText("Rectangle 200 by 100", 40.0, 40.0);
+ dc.DrawRectangle(0, 30, 200, 100);
+ dc.DrawText("Rectangle 200 by 100", 40, 40);
- dc.DrawEllipse(50.0, 140.0, 100.0, 50.0);
+ dc.DrawEllipse(50, 140, 100, 50);
- dc.DrawText("Test message: this is in 11 point text", 10.0, 180.0);
+ dc.DrawText("Test message: this is in 11 point text", 10, 180);
dc.SetPen(wxBLACK_PEN);
- dc.DrawLine(0.0, 0.0, 200.0, 200.0);
- dc.DrawLine(200.0, 0.0, 0.0, 200.0);
+ dc.DrawLine(0, 0, 200, 200);
+ dc.DrawLine(200, 0, 0, 200);
}
-void MyFrame::OnSize(wxSizeEvent& event)
+void MyFrame::OnSize(wxSizeEvent& event )
{
wxFrame::OnSize(event);
}
frame->Draw(dc);
}
-void MyCanvas::OnEvent(wxMouseEvent& event)
+void MyCanvas::OnEvent(wxMouseEvent& WXUNUSED(event))
{
}
char buf[200];
sprintf(buf, "PAGE %d", page);
- dc->DrawText(buf, 10.0, 10.0);
+ dc->DrawText(buf, 10, 10);
return TRUE;
}
// Set the scale and origin
dc->SetUserScale(actualScale, actualScale);
- dc->SetDeviceOrigin(posX, posY);
+ dc->SetDeviceOrigin( (long)posX, (long)posY );
frame->Draw(*dc);
}
float logUnitsFactor = (float)(ppiPrinterX/(scale*25.1));
float logUnits = (float)(50*logUnitsFactor);
dc->SetPen(wxBLACK_PEN);
- dc->DrawLine(50.0, 50.0, (float)(50.0 + logUnits), 50.0);
- dc->DrawLine(50.0, 50.0, 50.0, (float)(50.0 + logUnits));
+ dc->DrawLine(50, 50, (long)(50.0 + logUnits), 50);
+ dc->DrawLine(50, 50, 50, (long)(50.0 + logUnits));
dc->SetFont(itemFont);
dc->SetBackgroundMode(wxTRANSPARENT);
- dc->DrawText("Some test text", 200.0, 200.0);
+ dc->DrawText("Some test text", 200, 200 );
// TESTING
float rightMarginLogical = (float)(logUnitsFactor*(pageWidthMM - rightMargin));
dc->SetPen(wxBLACK_PEN);
- dc->DrawLine(leftMarginLogical, topMarginLogical, rightMarginLogical, topMarginLogical);
- dc->DrawLine(leftMarginLogical, bottomMarginLogical, rightMarginLogical, bottomMarginLogical);
+ dc->DrawLine( (long)leftMarginLogical, (long)topMarginLogical,
+ (long)rightMarginLogical, (long)topMarginLogical);
+ dc->DrawLine( (long)leftMarginLogical, (long)bottomMarginLogical,
+ (long)rightMarginLogical, (long)bottomMarginLogical);
WritePageHeader(this, dc, "A header", logUnitsFactor);
}
long xExtent, yExtent;
dc->GetTextExtent(text, &xExtent, &yExtent);
float xPos = (float)(((((pageWidthMM - leftMargin - rightMargin)/2.0)+leftMargin)*mmToLogical) - (xExtent/2.0));
- dc->DrawText(text, (long)xPos, topMarginLogical);
+ dc->DrawText(text, (long)xPos, (long)topMarginLogical);
dc->SetPen(wxBLACK_PEN);
- dc->DrawLine(leftMarginLogical, topMarginLogical+yExtent, rightMarginLogical, topMarginLogical+yExtent);
+ dc->DrawLine( (long)leftMarginLogical, (long)(topMarginLogical+yExtent),
+ (long)rightMarginLogical, (long)topMarginLogical+yExtent );
return TRUE;
}