]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/printwin.cpp
adding constructor from CGImageRef
[wxWidgets.git] / src / msw / printwin.cpp
index 5dba0607ba10a0b252b2f5b3e0d779643066a950..dd8c25b4204c349e8416a4710aa5f74f8831ff2e 100644 (file)
@@ -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 <stdlib.h>
 
 // ---------------------------------------------------------------------------
@@ -90,10 +91,16 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt
         return false;
     }
 
-    if (m_printDialogData.GetMinPage() < 1)
-        m_printDialogData.SetMinPage(1);
-    if (m_printDialogData.GetMaxPage() < 1)
-        m_printDialogData.SetMaxPage(9999);
+    // Get some parameters from the printout, if defined
+    int fromPage, toPage;
+    int minPage, maxPage;
+    printout->GetPageInfo(&minPage, &maxPage, &fromPage, &toPage);
+
+    m_printDialogData.SetFromPage(fromPage);
+    m_printDialogData.SetToPage(toPage);
+    m_printDialogData.SetMinPage(minPage);
+    m_printDialogData.SetMaxPage(maxPage);
+    m_printDialogData.SetAllPages((fromPage == minPage) && (toPage == maxPage));
 
     // Create a suitable device context
     wxPrinterDC *dc wxDUMMY_INITIALIZE(NULL);
@@ -150,11 +157,6 @@ bool wxWindowsPrinter::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)
     {
         sm_lastError = wxPRINTER_ERROR;
@@ -390,6 +392,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 +438,7 @@ bool wxWindowsPrintPreview::RenderPageIntoBitmap(wxBitmap& bmp, int pageNum)
 
     return true;
 }
-
+#endif // wxUSE_ENH_METAFILE
 
 BOOL CALLBACK wxAbortProc(HDC WXUNUSED(hdc), int WXUNUSED(error))
 {