#include "wx/dcprint.h"
#include "wx/msgdlg.h"
#include "wx/mac/uma.h"
+#ifndef __DARWIN__
+ #include "Printing.h"
+#endif
+
+#if defined(TARGET_CARBON) && !defined(__DARWIN__)
+# if PM_USE_SESSION_APIS
+# include <PMCore.h>
+# endif
+# include <PMApplication.h>
+#endif
// Use generic page setup dialog: use your own native one if one exists.
wxPrintDialog::~wxPrintDialog()
{
- if (m_destroyDC && m_printerDC)
+ if (m_destroyDC && m_printerDC) {
delete m_printerDC;
+ m_printerDC = NULL;
+ }
}
int wxPrintDialog::ShowModal()
wxString message ;
#if !TARGET_CARBON
- err = ::UMAPrOpen() ;
+ err = ::UMAPrOpen(NULL) ;
if ( err == noErr )
{
m_printDialogData.ConvertToNative() ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal();
}
- ::UMAPrClose() ;
+ ::UMAPrClose(NULL) ;
#else
#if PM_USE_SESSION_APIS
PMPrintSession macPrintSession = kPMNoReference;
wxString message ;
#if !TARGET_CARBON
- err = ::UMAPrOpen() ;
+ err = ::UMAPrOpen(NULL) ;
if ( err == noErr )
{
m_pageSetupData.ConvertToNative() ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal();
}
- ::UMAPrClose() ;
+ ::UMAPrClose(NULL) ;
#else
#if PM_USE_SESSION_APIS
PMPrintSession macPrintSession = kPMNoReference;