X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5276b0a53cef4815230e39b54d2ecda14f72cbd1..07aaf32633ecf18ec3edfbb41793a112914792d0:/src/msw/printwin.cpp diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index 5dba0607ba..0c8a2ed652 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -49,8 +49,9 @@ #include "wx/msw/printdlg.h" #include "wx/msw/private.h" #include "wx/msw/dcprint.h" -#include "wx/msw/enhmeta.h" - +#if wxUSE_ENH_METAFILE + #include "wx/msw/enhmeta.h" +#endif #include // --------------------------------------------------------------------------- @@ -166,7 +167,7 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt m_printDialogData.SetMinPage(minPage); m_printDialogData.SetMaxPage(maxPage); - wxWindow *win = CreateAbortWindow(parent, printout); + wxPrintAbortDialog *win = CreateAbortWindow(parent, printout); wxYield(); ::SetAbortProc(GetHdcOf(*impl), wxAbortProc); @@ -195,10 +196,8 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt maxPageNum = m_printDialogData.GetToPage(); } - int copyCount; - for ( copyCount = 1; - copyCount <= m_printDialogData.GetNoCopies(); - copyCount++ ) + const int maxCopyCount = m_printDialogData.GetNoCopies(); + for ( int copyCount = 1; copyCount <= maxCopyCount; copyCount++ ) { if ( !printout->OnBeginDocument(minPageNum, maxPageNum) ) { @@ -218,6 +217,10 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt pn <= maxPageNum && printout->HasPage(pn); pn++ ) { + win->SetProgress(pn - minPageNum + 1, + maxPageNum - minPageNum + 1, + copyCount, maxCopyCount); + if ( sm_abortIt ) { sm_lastError = wxPRINTER_CANCELLED; @@ -390,6 +393,7 @@ void wxWindowsPrintPreview::DetermineScaling() m_previewScaleY = float(logPPIScreenY) / logPPIPrinterY; } +#if wxUSE_ENH_METAFILE bool wxWindowsPrintPreview::RenderPageIntoBitmap(wxBitmap& bmp, int pageNum) { // The preview, as implemented in wxPrintPreviewBase (and as used prior to @@ -435,7 +439,7 @@ bool wxWindowsPrintPreview::RenderPageIntoBitmap(wxBitmap& bmp, int pageNum) return true; } - +#endif // wxUSE_ENH_METAFILE BOOL CALLBACK wxAbortProc(HDC WXUNUSED(hdc), int WXUNUSED(error)) {