From 67df97839655a9388d4339a8872b71671889f4f9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karsten=20Ball=C3=BCder?= Date: Thu, 13 May 1999 15:52:20 +0000 Subject: [PATCH] ProgressDialog now handles multiple copies and shows total number of pages. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/printps.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/generic/printps.cpp b/src/generic/printps.cpp index cc301b7aae..599715179f 100644 --- a/src/generic/printps.cpp +++ b/src/generic/printps.cpp @@ -167,11 +167,15 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro // Create an abort window wxBeginBusyCursor(); + int + pagesPerCopy = maxPage-minPage+1, + totalPages = pagesPerCopy * m_printDialogData.GetNoCopies(), + printedPages = 0; // Open the progress bar dialog wxProgressDialog *progressDialog = new wxProgressDialog ( printout->GetTitle(), _("Printing..."), - maxPage-minPage+1, + totalPages, parent, /* disable parent only */ true, /* show abort button */ true); @@ -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(); -- 2.45.2