#include "wx/dc.h"
#include "wx/app.h"
#include "wx/msgdlg.h"
- #include <wx/intl.h>
+ #include "wx/intl.h"
+ #include "wx/progdlg.h"
#endif
#include "wx/generic/printps.h"
else
m_printDialogData.EnablePageNumbers(FALSE);
+
// Create a suitable device context
wxDC *dc = (wxDC *) NULL;
if (prompt)
// Create an abort window
wxBeginBusyCursor();
+ // Open the progress bar dialog
+ wxProgressDialog *progressDialog = new wxProgressDialog (
+ printout->GetTitle(),
+ _("Printing..."),
+ maxPage-minPage,
+ parent,
+ /* disable parent only */ true,
+ /* show abort button */ true);
+
printout->OnBeginPrinting();
bool keepGoing = TRUE;
}
else
{
- dc->StartPage();
- printout->OnPrintPage(pn);
- dc->EndPage();
+ wxString msg;
+ msg.Printf(_("Printing page %d..."), pn);
+ if(progressDialog->Update(pn-minPage, msg))
+ {
+ dc->StartPage();
+ printout->OnPrintPage(pn);
+ dc->EndPage();
+ }
+ else
+ {
+ sm_abortIt = true;
+ keepGoing = false; //FIXME: do we need both?
+ }
}
}
+ delete progressDialog;
printout->OnEndDocument();
}