X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/67df97839655a9388d4339a8872b71671889f4f9..8b260fbe33b67311ab69043e8fb1bc4c4d7ac1f2:/src/generic/printps.cpp diff --git a/src/generic/printps.cpp b/src/generic/printps.cpp index 599715179f..0e994766b9 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 @@ -51,10 +54,8 @@ // wxWin macros // ---------------------------------------------------------------------------- -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxPostScriptPrinter, wxPrinterBase) IMPLEMENT_CLASS(wxPostScriptPrintPreview, wxPrintPreviewBase) -#endif // ============================================================================ // implementation @@ -82,7 +83,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,8 +173,10 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro // Create an abort window wxBeginBusyCursor(); + printout->OnPreparePrinting(); + int - pagesPerCopy = maxPage-minPage+1, + pagesPerCopy = m_printDialogData.GetToPage()-m_printDialogData.GetFromPage()+1, totalPages = pagesPerCopy * m_printDialogData.GetNoCopies(), printedPages = 0; // Open the progress bar dialog @@ -177,9 +185,8 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro _("Printing..."), totalPages, parent, - /* disable parent only */ true, - /* show abort button */ true); - + wxPD_CAN_ABORT|wxPD_AUTO_HIDE|wxPD_APP_MODAL); + printout->OnBeginPrinting(); bool keepGoing = TRUE; @@ -217,10 +224,11 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro } else { - sm_abortIt = true; - keepGoing = false; + sm_abortIt = TRUE; + keepGoing = FALSE; } } + wxYield(); } printout->OnEndDocument(); } @@ -347,3 +355,4 @@ void wxPostScriptPrintPreview::DetermineScaling() } } +#endif