From: Vadim Zeitlin Date: Thu, 24 Sep 2009 00:21:49 +0000 (+0000) Subject: Display correct minimal and maximal pages numbers under OS X. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0661eb625efa701a8395777526f6b1371caeac46 Display correct minimal and maximal pages numbers under OS X. Set min and max page fields in m_printDialogData before showing the print dialog in the Mac version. Closes #8349. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/changes.txt b/docs/changes.txt index 1e45b1e7c7..166dfac4c1 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -436,6 +436,10 @@ GTK: - wxRadioBox constructor uses default consistent with other ports now. - Corrected themed border display. +Mac: + +- Correct min/max pages display in the print dialog (Auria). + MSW: - Translate wxMessageDialog labels to the language of the current locale. diff --git a/src/osx/core/printmac.cpp b/src/osx/core/printmac.cpp index 53cf637057..8d43808e5e 100644 --- a/src/osx/core/printmac.cpp +++ b/src/osx/core/printmac.cpp @@ -448,6 +448,19 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) return false; printout->SetIsPreview(false); + + // Get some parameters from the printout, if defined + int fromPage, toPage; + int minPage, maxPage; + printout->GetPageInfo(&minPage, &maxPage, &fromPage, &toPage); + + if (maxPage == 0) 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) @@ -502,22 +515,6 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) 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) - { - wxEndBusyCursor(); - return false; - } - - // Only set min and max, because from and to have been - // set by the user - m_printDialogData.SetMinPage(minPage); - m_printDialogData.SetMaxPage(maxPage); - printout->OnBeginPrinting(); bool keepGoing = true;