X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d5eaa19fdf914e144a1c6c4ccbdcd36ccd0dee12..0d0b1695e01f1572540e79cbb7bd360c1f2d5979:/src/msw/printdlg.cpp diff --git a/src/msw/printdlg.cpp b/src/msw/printdlg.cpp index c8586ab3e0..575fb82ffd 100644 --- a/src/msw/printdlg.cpp +++ b/src/msw/printdlg.cpp @@ -37,6 +37,7 @@ #include "wx/printdlg.h" #include "wx/msw/printdlg.h" +#include "wx/msw/dcprint.h" #include "wx/paper.h" #include @@ -638,7 +639,7 @@ int wxWindowsPrintDialog::ShowModal() 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; @@ -753,10 +754,6 @@ bool wxWindowsPrintDialog::ConvertToNative( wxPrintDialogData &data ) pd->Flags |= PD_PAGENUMS; if ( data.GetEnableHelp() ) pd->Flags |= PD_SHOWHELP; -#if WXWIN_COMPATIBILITY_2_4 - if ( data.GetSetupDialog() ) - pd->Flags |= PD_PRINTSETUP; -#endif return true; } @@ -812,9 +809,7 @@ bool wxWindowsPrintDialog::ConvertFromNative( wxPrintDialogData &data ) data.EnableSelection( ((pd->Flags & PD_NOSELECTION) != PD_NOSELECTION) ); data.EnablePageNumbers( ((pd->Flags & PD_NOPAGENUMS) != PD_NOPAGENUMS) ); data.EnableHelp( ((pd->Flags & PD_SHOWHELP) == PD_SHOWHELP) ); -#if WXWIN_COMPATIBILITY_2_4 - data.SetSetupDialog( ((pd->Flags & PD_PRINTSETUP) == PD_PRINTSETUP) ); -#endif + return true; } @@ -1032,7 +1027,10 @@ bool wxWindowsPageSetupDialog::ConvertFromNative( wxPageSetupDialogData &data ) 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) );