#include "wx/printdlg.h"
#include "wx/msw/printdlg.h"
+#include "wx/msw/dcprint.h"
#include "wx/paper.h"
#include <stdlib.h>
if ( ret && (pd->hDC) )
{
- wxPrinterDC *pdc = new wxPrinterDC( (WXHDC) pd->hDC );
+ wxPrinterDC *pdc = new wxPrinterDCFromHDC( (WXHDC) pd->hDC );
m_printerDC = pdc;
ConvertFromNative( m_printDialogData );
return wxID_OK;
data.EnableHelp( ((pd->Flags & PSD_SHOWHELP) == PSD_SHOWHELP) );
// PAGESETUPDLG is in hundreds of a mm
- data.SetPaperSize( wxSize(pd->ptPaperSize.x / 100, pd->ptPaperSize.y / 100) );
+ if (data.GetPrintData().GetOrientation() == wxLANDSCAPE)
+ data.SetPaperSize( wxSize(pd->ptPaperSize.y / 100, pd->ptPaperSize.x / 100) );
+ else
+ data.SetPaperSize( wxSize(pd->ptPaperSize.x / 100, pd->ptPaperSize.y / 100) );
data.SetMinMarginTopLeft( wxPoint(pd->rtMinMargin.left / 100, pd->rtMinMargin.top / 100) );
data.SetMinMarginBottomRight( wxPoint(pd->rtMinMargin.right / 100, pd->rtMinMargin.bottom / 100) );