]> git.saurik.com Git - wxWidgets.git/commitdiff
Printing things.
authorRobert Roebling <robert@roebling.de>
Sat, 17 Aug 2002 17:04:06 +0000 (17:04 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 17 Aug 2002 17:04:06 +0000 (17:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/dcpsg.cpp
src/generic/prntdlgg.cpp

index 2189f60a82b20210cebca73153e8967603489d1f..bc7f35af6b18349619e6abf070f00e3c0a62d623 100644 (file)
@@ -1776,6 +1776,8 @@ bool wxPostScriptDC::StartDoc( const wxString& message )
     else
         fprintf( m_pstream, "%%%%Orientation: Portrait\n" );
     
+    // fprintf( m_pstream, "%%%%Pages: %d\n", (wxPageNumber - 1) );
+    
     // wxPaperSize ps = m_printData.GetPaperId();
     // if (ps == ...)
     fprintf( m_pstream, "%%%%DocumentPaperSizes: %s\n", "A4" );
@@ -1822,9 +1824,7 @@ void wxPostScriptDC::EndDoc ()
     m_pstream = (FILE *) NULL;
 
 #if 0    
-
     // THE FOLLOWING HAS BEEN CONTRIBUTED BY Andy Fyfe <andy@hyperparallel.com>
-
     wxCoord wx_printer_translate_x, wx_printer_translate_y;
     double wx_printer_scale_x, wx_printer_scale_y;
 
@@ -1876,7 +1876,6 @@ void wxPostScriptDC::EndDoc ()
             "%%%%BoundingBox: %d %d %d %d\n",
             (wxCoord)floor((double)llx), (wxCoord)floor((double)lly),
             (wxCoord)ceil((double)urx), (wxCoord)ceil((double)ury) );
-    fprintf( m_pstream, "%%%%Pages: %d\n", (wxPageNumber - 1) );
 
     // To check the correctness of the bounding box, postscript commands
     // to draw a box corresponding to the bounding box are generated below.
@@ -1889,59 +1888,20 @@ void wxPostScriptDC::EndDoc ()
     fprintf( m_pstream, "%% %d %d lineto\n", urx, lly );
     fprintf( m_pstream, "%% %d %d lineto\n", urx, ury );
     fprintf( m_pstream, "%% %d %d lineto closepath stroke\n", llx, ury );
+#endif
 
 #if defined(__X__) || defined(__WXGTK__)
     if (m_ok)
     {
-        wxString previewCommand(m_printData.GetPreviewCommand());
-        wxString printerCommand(m_printData.GetPrinterCommand());
-        wxString printerOptions(m_printData.GetPrinterOptions());
-        wxString filename(m_printData.GetFilename());
+        wxString command;
+        command += m_printData.GetPrinterCommand();
+        command += wxT(" ");
+        command += m_printData.GetFilename();
 
-        switch (m_printData.GetPrintMode())
-        {
-            case wxPRINT_MODE_PREVIEW:
-            {
-                wxChar *argv[3];
-                argv[0] = WXSTRINGCAST previewCommand;
-                argv[1] = WXSTRINGCAST filename;
-                argv[2] = (wxChar*) NULL;
-#if defined(__WXGTK20__) && wxUSE_UNICODE
-#else
-                wxExecute( argv, TRUE );
-#endif
-                wxRemoveFile( m_printData.GetFilename() );
-            }
-            break;
-            case wxPRINT_MODE_PRINTER:
-            {
-                wxChar *argv[4];
-                int argc = 0;
-                argv[argc++] = WXSTRINGCAST printerCommand;
-
-                // !SM! If we simply assign to argv[1] here, if printer options
-                // are blank, we get an annoying and confusing message from lpr.
-                wxChar *opts = WXSTRINGCAST printerOptions;
-                if (opts && *opts)
-                    argv[argc++] = opts;
-
-                argv[argc++] = WXSTRINGCAST filename;
-                argv[argc++] = (wxChar *) NULL;
-#if defined(__WXGTK20__) && wxUSE_UNICODE
-#else
-                wxExecute( argv, TRUE );
-#endif
-                wxRemoveFile( filename );
-            }
-            break;
-            case wxPRINT_MODE_FILE:
-            case wxPRINT_MODE_NONE:
-            break;
-        }
+        wxExecute( command, TRUE );
+        wxRemoveFile( m_printData.GetFilename() );
     }
 #endif
-
-#endif
 }
 
 void wxPostScriptDC::StartPage()
index 14162e2715d3494bd0e578a966fa54a02a4fcf4c..afc43e295155924ab46a8a1569c11679ff29862c 100644 (file)
@@ -455,8 +455,6 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
     okButton->SetDefault();
     okButton->SetFocus();
     
-    printf( "Hello generic\n" );
-
     Fit();
     Centre(wxBOTH);