]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/printing/printing.cpp
Daniel Gehriger <dgehrige@dmtsun.epfl.ch> patch for default extension filter
[wxWidgets.git] / samples / printing / printing.cpp
index 782e17de3d9c99ff72ebcedc37d99052d7535fd1..3106790de3150f86cd1a8bf4c0a08de89b44add5 100644 (file)
@@ -22,7 +22,6 @@
 
 #ifndef WX_PRECOMP
 #include "wx/wx.h"
-#include "wx/postscrp.h"
 #endif
 
 #if !wxUSE_PRINTING_ARCHITECTURE
 
 #include "printing.h"
 
+#ifndef __WXMSW__
+#include "mondrian.xpm"
+#endif
+
 // Declare a frame
 MyFrame   *frame = (MyFrame *) NULL;
 int orientation = wxPORTRAIT;
@@ -54,10 +57,6 @@ int orientation = wxPORTRAIT;
 // Main proc
 IMPLEMENT_APP(MyApp)
 
-#if defined(__WXGTK__) || defined(__WXMOTIF__)
-#include "folder.xpm"
-#endif
-
 // Writes a header on a page. Margin units are in millimetres.
 bool WritePageHeader(wxPrintout *printout, wxDC *dc, char *text, float mmToLogical);
 
@@ -78,12 +77,7 @@ bool MyApp::OnInit(void)
   frame->CreateStatusBar(2);
 
   // Load icon and bitmap
-#ifdef __WXMSW__
-  frame->SetIcon(wxIcon("mondrian"));
-#endif
-#ifdef __X__
-//  frame->SetIcon(wxIcon(mondrian_bits, mondrian_width, mondrian_height));
-#endif
+  frame->SetIcon( wxICON( mondrian) );
 
   // Make a menubar
   wxMenu *file_menu = new wxMenu;
@@ -324,13 +318,7 @@ void MyFrame::Draw(wxDC& dc)
   dc.DrawLine(0, 0, 200, 200);
   dc.DrawLine(200, 0, 0, 200);
   
-#if defined(__WXGTK__) || defined(__WXMOTIF__)
-  wxIcon my_icon( folder_xpm );
-#elif defined(__WXMSW__)
-  wxIcon my_icon( "mondrian" );
-#elif
-#error "Platform not supported."
-#endif
+  wxIcon my_icon = wxICON(mondrian) ;
 
   dc.DrawIcon( my_icon, 100, 100);
 }
@@ -523,7 +511,7 @@ void MyPrintout::DrawPageTwo(wxDC *dc)
   float bottomMarginLogical = (float)(logUnitsFactor*(pageHeightMM - bottomMargin));
   float rightMarginLogical = (float)(logUnitsFactor*(pageWidthMM - rightMargin));
 
-  dc->SetPen(wxRED_PEN);
+  dc->SetPen(wxRED_PEN);
   dc->DrawLine( (long)leftMarginLogical, (long)topMarginLogical, 
                 (long)rightMarginLogical, (long)topMarginLogical);
   dc->DrawLine( (long)leftMarginLogical, (long)bottomMarginLogical,