]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/printdlg.cpp
minimize overlay area to avoid eg scrolling artifacts when using a caret
[wxWidgets.git] / src / msw / printdlg.cpp
index 4fb94bd7993a25bde9e2b33129283e18ab98d696..e692c3104b0aa7c8f8cbeb2194f232b1515d568d 100644 (file)
@@ -136,7 +136,7 @@ wxWindowsPrintNativeData::~wxWindowsPrintNativeData()
         GlobalFree(hDevNames);
 }
 
         GlobalFree(hDevNames);
 }
 
-bool wxWindowsPrintNativeData::Ok() const
+bool wxWindowsPrintNativeData::IsOk() const
 {
     return (m_devMode != NULL) ;
 }
 {
     return (m_devMode != NULL) ;
 }
@@ -198,7 +198,11 @@ bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data )
         } else {
             data.SetBin(wxPRINTBIN_DEFAULT);
         }
         } else {
             data.SetBin(wxPRINTBIN_DEFAULT);
         }
-
+        if (devMode->dmFields & DM_MEDIATYPE)
+        {
+            wxASSERT(devMode->dmMediaType != wxPRINTMEDIA_DEFAULT);
+            data.SetMedia(devMode->dmMediaType);
+        }
         //// Printer name
         if (devMode->dmDeviceName[0] != 0)
             // This syntax fixes a crash when using VS 7.1
         //// Printer name
         if (devMode->dmDeviceName[0] != 0)
             // This syntax fixes a crash when using VS 7.1
@@ -547,7 +551,11 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data )
 
             devMode->dmFields |= DM_DEFAULTSOURCE;
         }
 
             devMode->dmFields |= DM_DEFAULTSOURCE;
         }
-
+        if (data.GetMedia() != wxPRINTMEDIA_DEFAULT)
+        {
+            devMode->dmMediaType = data.GetMedia();
+            devMode->dmFields |= DM_MEDIATYPE;
+        }
         GlobalUnlock(hDevMode);
     }
 
         GlobalUnlock(hDevMode);
     }
 
@@ -647,7 +655,7 @@ wxDC *wxWindowsPrintDialog::GetPrintDC()
         return m_printerDC;
     }
     else
         return m_printerDC;
     }
     else
-        return (wxDC*) NULL;
+        return (wxPrinterDC*) NULL;
 }
 
 bool wxWindowsPrintDialog::ConvertToNative( wxPrintDialogData &data )
 }
 
 bool wxWindowsPrintDialog::ConvertToNative( wxPrintDialogData &data )