]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/printdlg.cpp
render scrollbar's thumb as stippled bar to distinguish it from controls
[wxWidgets.git] / src / msw / printdlg.cpp
index 33e9028994c5f783b0fdbabe4e85b822e39cbfbf..e692c3104b0aa7c8f8cbeb2194f232b1515d568d 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        printdlg.cpp
+// Name:        src/msw/printdlg.cpp
 // Purpose:     wxPrintDialog, wxPageSetupDialog
 // Author:      Julian Smart
 // Modified by:
 #if wxUSE_PRINTING_ARCHITECTURE && (!defined(__WXUNIVERSAL__) || !wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
 
 #ifndef WX_PRECOMP
+    #include "wx/msw/wrapcdlg.h"
     #include "wx/app.h"
+    #include "wx/dcprint.h"
+    #include "wx/cmndata.h"
 #endif
 
-#include "wx/cmndata.h"
 #include "wx/printdlg.h"
 #include "wx/msw/printdlg.h"
-#include "wx/dcprint.h"
 #include "wx/paper.h"
 
 #include <stdlib.h>
 
-#include "wx/msw/wrapcdlg.h"
-
 #ifndef __WIN32__
     #include <print.h>
 #endif
@@ -95,19 +94,19 @@ static HGLOBAL wxCreateDevNames(const wxString& driverName, const wxString& prin
     else
     {
         hDev = GlobalAlloc(GPTR, 4*sizeof(WORD)+
-                           ( driverName.Length() + 1 +
-            printerName.Length() + 1 +
-                             portName.Length()+1 ) * sizeof(wxChar) );
+                           ( driverName.length() + 1 +
+            printerName.length() + 1 +
+                             portName.length()+1 ) * sizeof(wxChar) );
         LPDEVNAMES lpDev = (LPDEVNAMES)GlobalLock(hDev);
         lpDev->wDriverOffset = sizeof(WORD) * 4 / sizeof(wxChar);
         wxStrcpy((wxChar*)lpDev + lpDev->wDriverOffset, driverName);
 
         lpDev->wDeviceOffset = (WORD)( lpDev->wDriverOffset +
-                                       driverName.Length() + 1 );
+                                       driverName.length() + 1 );
         wxStrcpy((wxChar*)lpDev + lpDev->wDeviceOffset, printerName);
 
         lpDev->wOutputOffset = (WORD)( lpDev->wDeviceOffset +
-                                       printerName.Length() + 1 );
+                                       printerName.length() + 1 );
         wxStrcpy((wxChar*)lpDev + lpDev->wOutputOffset, portName);
 
         lpDev->wDefault = 0;
@@ -137,7 +136,7 @@ wxWindowsPrintNativeData::~wxWindowsPrintNativeData()
         GlobalFree(hDevNames);
 }
 
-bool wxWindowsPrintNativeData::Ok() const
+bool wxWindowsPrintNativeData::IsOk() const
 {
     return (m_devMode != NULL) ;
 }
@@ -199,7 +198,11 @@ bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data )
         } 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
@@ -548,7 +551,11 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data )
 
             devMode->dmFields |= DM_DEFAULTSOURCE;
         }
-
+        if (data.GetMedia() != wxPRINTMEDIA_DEFAULT)
+        {
+            devMode->dmMediaType = data.GetMedia();
+            devMode->dmFields |= DM_MEDIATYPE;
+        }
         GlobalUnlock(hDevMode);
     }
 
@@ -648,7 +655,7 @@ wxDC *wxWindowsPrintDialog::GetPrintDC()
         return m_printerDC;
     }
     else
-        return (wxDC*) NULL;
+        return (wxPrinterDC*) NULL;
 }
 
 bool wxWindowsPrintDialog::ConvertToNative( wxPrintDialogData &data )