#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>
// ---------------------------------------------------------------------------
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 (m_printDialogData.GetMinPage() < 1)
- m_printDialogData.SetMinPage(1);
- if (m_printDialogData.GetMaxPage() < 1)
- m_printDialogData.SetMaxPage(9999);
+ 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);
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;
if (sm_abortWindow)
{
sm_abortWindow->Show(false);
- delete sm_abortWindow;
- sm_abortWindow = NULL;
+ wxDELETE(sm_abortWindow);
}
delete dc;
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
return true;
}
-
+#endif // wxUSE_ENH_METAFILE
BOOL CALLBACK wxAbortProc(HDC WXUNUSED(hdc), int WXUNUSED(error))
{