projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added wxGetMultiChoice() (which refuses to work for some reason - will fix
[wxWidgets.git]
/
src
/
mac
/
printdlg.cpp
diff --git
a/src/mac/printdlg.cpp
b/src/mac/printdlg.cpp
index 18c7a8427e244c53973cb4c1a70e6d3882ec41ba..a5c41e0737c7f70706688537975e782ce4109a90 100644
(file)
--- a/
src/mac/printdlg.cpp
+++ b/
src/mac/printdlg.cpp
@@
-14,8
+14,9
@@
#endif
#include "wx/object.h"
#endif
#include "wx/object.h"
-#include "wx/
mac/
printdlg.h"
+#include "wx/printdlg.h"
#include "wx/dcprint.h"
#include "wx/dcprint.h"
+#include "wx/mac/uma.h"
// Use generic page setup dialog: use your own native one if one exists.
// Use generic page setup dialog: use your own native one if one exists.
@@
-24,46
+25,61
@@
IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog)
IMPLEMENT_CLASS(wxPageSetupDialog, wxDialog)
#endif
IMPLEMENT_CLASS(wxPageSetupDialog, wxDialog)
#endif
-wxPrintDialog::wxPrintDialog():
- wxDialog()
+wxPrintDialog::wxPrintDialog()
{
m_dialogParent = NULL;
{
m_dialogParent = NULL;
+ m_printerDC = NULL;
+ m_destroyDC = TRUE;
}
}
-wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintData* data):
- wxDialog()
+wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintDialogData* data)
{
Create(p, data);
}
{
Create(p, data);
}
-bool wxPrintDialog::Create(wxWindow *p, wxPrintData* data)
+wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintData* data)
+{
+ wxPrintDialogData data2;
+ if ( data )
+ data2 = *data;
+
+ Create(p, &data2);
+}
+
+bool wxPrintDialog::Create(wxWindow *p, wxPrintDialogData* data)
{
m_dialogParent = p;
{
m_dialogParent = p;
+ m_printerDC = NULL;
+ m_destroyDC = TRUE;
if ( data )
if ( data )
- m_printData = *data;
+ m_printD
ialogD
ata = *data;
return TRUE;
}
wxPrintDialog::~wxPrintDialog()
{
return TRUE;
}
wxPrintDialog::~wxPrintDialog()
{
+ if (m_destroyDC && m_printerDC)
+ delete m_printerDC;
}
int wxPrintDialog::ShowModal()
{
int result = wxID_CANCEL ;
}
int wxPrintDialog::ShowModal()
{
int result = wxID_CANCEL ;
+ #if !TARGET_CARBON
+
OSErr err ;
wxString message ;
OSErr err ;
wxString message ;
- ::PrOpen() ;
+ ::
UMA
PrOpen() ;
err = PrError() ;
if ( !err )
{
err = PrError() ;
if ( !err )
{
- m_printData.ConvertToNative() ;
- if (
m_printData.macPrintInfo && ::PrJobDialog( m_printData.
macPrintInfo ) )
+ m_printD
ialogD
ata.ConvertToNative() ;
+ if (
::PrJobDialog( m_printDialogData.GetPrintData().m_
macPrintInfo ) )
{
{
- m_printData.ConvertFromNative() ;
+ m_printD
ialogD
ata.ConvertFromNative() ;
result = wxID_OK ;
}
result = wxID_OK ;
}
@@
-73,14
+89,16
@@
int wxPrintDialog::ShowModal()
message.Printf( "Print Error %d", err ) ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
}
message.Printf( "Print Error %d", err ) ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
}
- ::PrClose() ;
-
+ ::UMAPrClose() ;
+ #else
+ #pragma warning "TODO:Printing for carbon"
+ #endif
return result ;
}
wxDC *wxPrintDialog::GetPrintDC()
{
return result ;
}
wxDC *wxPrintDialog::GetPrintDC()
{
- return new wxPrinterDC( m_printD
ata
) ;
+ return new wxPrinterDC( m_printD
ialogData.GetPrintData()
) ;
}
/*
}
/*
@@
-116,15
+134,17
@@
wxPageSetupDialog::~wxPageSetupDialog()
int wxPageSetupDialog::ShowModal()
{
int result = wxID_CANCEL ;
int wxPageSetupDialog::ShowModal()
{
int result = wxID_CANCEL ;
+#if !TARGET_CARBON
+
OSErr err ;
wxString message ;
OSErr err ;
wxString message ;
- ::PrOpen() ;
+ ::
UMA
PrOpen() ;
err = PrError() ;
if ( !err )
{
m_pageSetupData.ConvertToNative() ;
err = PrError() ;
if ( !err )
{
m_pageSetupData.ConvertToNative() ;
- if (
m_pageSetupData.m_macPageSetupInfo && ::PrStlDialog( m_pageSetupData.m_macPageSetup
Info ) )
+ if (
::PrStlDialog( m_pageSetupData.GetPrintData().m_macPrint
Info ) )
{
m_pageSetupData.ConvertFromNative() ;
result = wxID_OK ;
{
m_pageSetupData.ConvertFromNative() ;
result = wxID_OK ;
@@
-136,8
+156,10
@@
int wxPageSetupDialog::ShowModal()
message.Printf( "Print Error %d", err ) ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
}
message.Printf( "Print Error %d", err ) ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
}
- ::PrClose() ;
-
+ ::UMAPrClose() ;
+#else
+#pragma warning "TODO:printing for carbon"
+#endif
return result ;
}
return result ;
}