]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/printps.cpp
Changed default cursor to be an arrow rather than the ugly X.
[wxWidgets.git] / src / generic / printps.cpp
index 053b00b275444c7b096a1bd6db2d3f95ffd2234f..5cb8272a26cdaf93ecb255ae51abb6a2e08d5391 100644 (file)
@@ -30,6 +30,8 @@
 
 #include "wx/defs.h"
 
+#if wxUSE_PRINTING_ARCHITECTURE
+
 #ifndef WX_PRECOMP
     #include "wx/utils.h"
     #include "wx/dc.h"
@@ -167,14 +169,16 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro
     // Create an abort window
     wxBeginBusyCursor();
 
+    int
+       pagesPerCopy = m_printDialogData.GetToPage()-m_printDialogData.GetFromPage()+1,
+       totalPages = pagesPerCopy * m_printDialogData.GetNoCopies(),
+       printedPages = 0;
     // Open the progress bar dialog
     wxProgressDialog *progressDialog = new wxProgressDialog (
        printout->GetTitle(),
        _("Printing..."),
-       maxPage-minPage,
-       parent,
-       /* disable parent only */ true,
-       /* show abort button */ true);
+       totalPages,
+       parent );
     
     printout->OnBeginPrinting();
 
@@ -204,8 +208,8 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro
             else
             {
                wxString msg;
-               msg.Printf(_("Printing page %d..."), pn);
-               if(progressDialog->Update(pn-minPage, msg))
+               msg.Printf(_("Printing page %d..."), printedPages+1);
+               if(progressDialog->Update(printedPages++, msg))
                {
                   dc->StartPage();
                   printout->OnPrintPage(pn);
@@ -214,15 +218,15 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro
                else
                {
                   sm_abortIt = true;
-                  keepGoing = false; //FIXME: do we need both?
+                  keepGoing = false;
                }
             }
         }
-        delete progressDialog;
         printout->OnEndDocument();
     }
 
     printout->OnEndPrinting();
+    delete progressDialog;
 
     wxEndBusyCursor();
 
@@ -343,3 +347,4 @@ void wxPostScriptPrintPreview::DetermineScaling()
     }
 }
 
+#endif