]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/printing/printing.cpp
Added a few files; fixed some warnings and wxMotif compile problems
[wxWidgets.git] / samples / printing / printing.cpp
index ae9b4126bb67f62cbe13835a67bbceafefd91975..89743d913bc95f54fbcf5cc6a6ada660fde75f8d 100644 (file)
@@ -22,7 +22,6 @@
 
 #ifndef WX_PRECOMP
 #include "wx/wx.h"
-#include "wx/postscrp.h"
 #endif
 
 #if !wxUSE_PRINTING_ARCHITECTURE
@@ -161,11 +160,6 @@ void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnPrint(wxCommandEvent& WXUNUSED(event))
 {
-#ifdef __WXMSW__
-      wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
-#else
-      wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-#endif
       wxPrinter printer;
       MyPrintout printout("My printout");
       if (!printer.Print(this, &printout, TRUE))
@@ -174,11 +168,6 @@ void MyFrame::OnPrint(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnPrintPreview(wxCommandEvent& WXUNUSED(event))
 {
-#ifdef __WXMSW__
-      wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
-#else
-      wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-#endif
       wxPrintData printData;
       printData.SetOrientation(orientation);
 
@@ -199,19 +188,11 @@ void MyFrame::OnPrintPreview(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnPrintSetup(wxCommandEvent& WXUNUSED(event))
 {
-#ifdef __WXMSW__
-      wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
-#else
-      wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-#endif
       wxPrintData data;
       data.SetOrientation(orientation);
 
-#ifdef __WXMSW__
       wxPrintDialog printerDialog(this, & data);
-#else
-      wxGenericPrintDialog printerDialog(this, & data);
-#endif
+
       printerDialog.GetPrintData().SetSetupDialog(TRUE);
       printerDialog.ShowModal();
 
@@ -220,19 +201,10 @@ void MyFrame::OnPrintSetup(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnPageSetup(wxCommandEvent& WXUNUSED(event))
 {
-#ifdef __WXMSW__
-      wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
-#else
-      wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-#endif
       wxPageSetupData data;
       data.SetOrientation(orientation);
 
-#ifdef __WXMSW__
       wxPageSetupDialog pageSetupDialog(this, & data);
-#else
-      wxGenericPageSetupDialog pageSetupDialog(this, & data);
-#endif
       pageSetupDialog.ShowModal();
 
       data = pageSetupDialog.GetPageSetupData();
@@ -242,8 +214,6 @@ void MyFrame::OnPageSetup(wxCommandEvent& WXUNUSED(event))
 #if defined(__WXMSW__) && wxTEST_POSTSCRIPT_IN_MSW
 void MyFrame::OnPrintPS(wxCommandEvent& WXUNUSED(event))
 {
-      wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-
       wxPostScriptPrinter printer;
       MyPrintout printout("My printout");
       printer.Print(this, &printout, TRUE);
@@ -251,8 +221,6 @@ void MyFrame::OnPrintPS(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnPrintPreviewPS(wxCommandEvent& WXUNUSED(event))
 {
-      wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-
       wxPrintData printData;
       printData.SetOrientation(orientation);
 
@@ -266,8 +234,6 @@ void MyFrame::OnPrintPreviewPS(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnPrintSetupPS(wxCommandEvent& WXUNUSED(event))
 {
-      wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-
       wxPrintData data;
       data.SetOrientation(orientation);
 
@@ -280,8 +246,6 @@ void MyFrame::OnPrintSetupPS(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnPageSetupPS(wxCommandEvent& WXUNUSED(event))
 {
-      wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
-
       wxPageSetupData data;
       data.SetOrientation(orientation);
 
@@ -319,7 +283,7 @@ void MyFrame::Draw(wxDC& dc)
   dc.DrawLine(0, 0, 200, 200);
   dc.DrawLine(200, 0, 0, 200);
   
-  wxIcon my_icon( wxICON(mondrian) );
+  wxIcon my_icon = wxICON(mondrian) ;
 
   dc.DrawIcon( my_icon, 100, 100);
 }