]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/printmac.cpp
Patch by David Brinegar to fix menubar updating after modal dialog shown
[wxWidgets.git] / src / mac / carbon / printmac.cpp
index 487123bad05789946a2f38482297635d1bf4b00a..834d523ccf5616e65210ae22c0d328d13e2d213a 100644 (file)
@@ -9,7 +9,7 @@
 // Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "printwin.h"
 #endif
 
@@ -20,8 +20,6 @@
 #pragma hdrstop
 #endif
 
-#include "wx/defs.h"
-
 #ifndef WX_PRECOMP
 #include "wx/utils.h"
 #include "wx/dc.h"
 #include "wx/msgdlg.h"
 #endif
 
+#include "wx/math.h"
 #include "wx/mac/uma.h"
 
 #include "wx/mac/printmac.h"
 #include "wx/mac/private/print.h"
 
-#define mm2pt            2.83464566929
-#define pt2mm            0.352777777778
-
 #include "wx/dcprint.h"
 #include "wx/printdlg.h"
+#include "wx/mac/printdlg.h"
 
 #include <stdlib.h>
 
@@ -144,7 +141,7 @@ void wxMacCarbonPrintData::TransferFrom( wxPrintData* data )
     // collate cannot be set
 #if 0 // not yet tested
     if ( m_printerName.Length() > 0 )
-        PMSessionSetCurrentPrinter( (PMPrintSession) m_macPrintSession , wxMacCFStringHolder( m_printerName ) ) ;
+        PMSessionSetCurrentPrinter( (PMPrintSession) m_macPrintSession , wxMacCFStringHolder( m_printerName , wxFont::GetDefaultEncoding() ) ) ;
 #endif
     PMColorMode color ;
     PMGetColorMode(  (PMPrintSettings) m_macPrintSettings, &color ) ;
@@ -555,7 +552,7 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
         if (dialog.ShowModal() == wxID_OK)
         {
             dc = dialog.GetPrintDC();
-            m_printDialogData = dialog.GetPrintData();
+            m_printDialogData = dialog.GetPrintDialogData();
         }
     }
     else
@@ -648,12 +645,15 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
             }
             else
             {
-// #if !TARGET_CARBON
-                GrafPtr thePort ;
-                GetPort( &thePort ) ;
-                wxSafeYield(win,true);
-                SetPort( thePort ) ;
-// #endif                
+#if TARGET_CARBON
+                if ( UMAGetSystemVersion() >= 0x1000 )
+#endif
+                {
+                    GrafPtr thePort ;
+                    GetPort( &thePort ) ;
+                    wxSafeYield(win,true);
+                    SetPort( thePort ) ;
+                }
                 dc->StartPage();
                 keepGoing = printout->OnPrintPage(pn);
                 dc->EndPage();
@@ -696,6 +696,7 @@ wxDC* wxMacPrinter::PrintDialog(wxWindow *parent)
 
 bool wxMacPrinter::Setup(wxWindow *parent)
 {
+#if 0
     wxPrintDialog dialog(parent, & m_printDialogData);
     dialog.GetPrintDialogData().SetSetupDialog(TRUE);
     
@@ -707,6 +708,8 @@ bool wxMacPrinter::Setup(wxWindow *parent)
     }
     
     return (ret == wxID_OK);
+#endif
+    return wxID_CANCEL;
 }
 
 /*