X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f16170b09fc2ea9c51a793d3703e3af22872c7d3..47e175a24f862aa8b7ca7dd4a2bb5957991e7f2d:/src/osx/core/printmac.cpp?ds=sidebyside diff --git a/src/osx/core/printmac.cpp b/src/osx/core/printmac.cpp index c47ec2e9cf..5722b09456 100644 --- a/src/osx/core/printmac.cpp +++ b/src/osx/core/printmac.cpp @@ -549,24 +549,6 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) return false; } - printout->OnPreparePrinting(); - - // Get some parameters from the printout, if defined - int fromPage, toPage; - int minPage, maxPage; - printout->GetPageInfo(&minPage, &maxPage, &fromPage, &toPage); - - if (maxPage == 0) - { - sm_lastError = wxPRINTER_ERROR; - return false; - } - - // Only set min and max, because from and to will be - // set by the user - m_printDialogData.SetMinPage(minPage); - m_printDialogData.SetMaxPage(maxPage); - if (m_printDialogData.GetMinPage() < 1) m_printDialogData.SetMinPage(1); if (m_printDialogData.GetMaxPage() < 1) @@ -629,8 +611,27 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) dc->GetSizeMM(&mw, &mh); printout->SetPageSizeMM((int)mw, (int)mh); + // Create an abort window wxBeginBusyCursor(); + printout->OnPreparePrinting(); + + // Get some parameters from the printout, if defined + int fromPage, toPage; + int minPage, maxPage; + printout->GetPageInfo(&minPage, &maxPage, &fromPage, &toPage); + + if (maxPage == 0) + { + sm_lastError = wxPRINTER_ERROR; + return false; + } + + // Only set min and max, because from and to will be + // set by the user + m_printDialogData.SetMinPage(minPage); + m_printDialogData.SetMaxPage(maxPage); + printout->OnBeginPrinting(); bool keepGoing = true;