X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c4208367a13a54e71916800eea48bdbe3f5497d5..9841339c74917270e36def49a00a0415efe3683e:/src/generic/printps.cpp?ds=sidebyside diff --git a/src/generic/printps.cpp b/src/generic/printps.cpp index e9b819b6fc..bab3bf9a56 100644 --- a/src/generic/printps.cpp +++ b/src/generic/printps.cpp @@ -30,6 +30,8 @@ #include "wx/defs.h" +#if wxUSE_PRINTING_ARCHITECTURE + #ifndef WX_PRECOMP #include "wx/utils.h" #include "wx/dc.h" @@ -43,6 +45,7 @@ #include "wx/dcprint.h" #include "wx/printdlg.h" #include "wx/generic/prntdlgg.h" +#include "wx/generic/progdlgg.h" #include "wx/paper.h" #include @@ -82,7 +85,12 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro return FALSE; printout->SetIsPreview(FALSE); - printout->OnPreparePrinting(); + + // 4/9/99, JACS: this is a silly place to allow preparation, considering + // the DC and no parameters have been set in the printout object. + // Moved further down. + + // printout->OnPreparePrinting(); // Get some parameters from the printout, if defined int fromPage, toPage; @@ -167,6 +175,8 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro // Create an abort window wxBeginBusyCursor(); + printout->OnPreparePrinting(); + int pagesPerCopy = m_printDialogData.GetToPage()-m_printDialogData.GetFromPage()+1, totalPages = pagesPerCopy * m_printDialogData.GetNoCopies(), @@ -176,8 +186,9 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro printout->GetTitle(), _("Printing..."), totalPages, - parent ); - + parent, + wxPD_CAN_ABORT|wxPD_AUTO_HIDE|wxPD_APP_MODAL); + printout->OnBeginPrinting(); bool keepGoing = TRUE; @@ -215,10 +226,11 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro } else { - sm_abortIt = true; - keepGoing = false; + sm_abortIt = TRUE; + keepGoing = FALSE; } } + wxYield(); } printout->OnEndDocument(); } @@ -345,3 +357,4 @@ void wxPostScriptPrintPreview::DetermineScaling() } } +#endif