]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/printdlg.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxPrintDialog, wxPageSetupDialog
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "printdlg.h"
16 #include "wx/object.h"
17 #include "wx/printdlg.h"
18 #include "wx/dcprint.h"
19 #include "wx/mac/uma.h"
21 // Use generic page setup dialog: use your own native one if one exists.
23 #if !USE_SHARED_LIBRARY
24 IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog
, wxDialog
)
25 IMPLEMENT_CLASS(wxPageSetupDialog
, wxDialog
)
28 wxPrintDialog::wxPrintDialog()
30 m_dialogParent
= NULL
;
35 wxPrintDialog::wxPrintDialog(wxWindow
*p
, wxPrintDialogData
* data
)
40 wxPrintDialog::wxPrintDialog(wxWindow
*p
, wxPrintData
* data
)
42 wxPrintDialogData data2
;
49 bool wxPrintDialog::Create(wxWindow
*p
, wxPrintDialogData
* data
)
56 m_printDialogData
= *data
;
61 wxPrintDialog::~wxPrintDialog()
63 if (m_destroyDC
&& m_printerDC
)
67 int wxPrintDialog::ShowModal()
69 int result
= wxID_CANCEL
;
79 m_printDialogData
.ConvertToNative() ;
80 if ( ::PrJobDialog( m_printDialogData
.GetPrintData().m_macPrintInfo
) )
82 m_printDialogData
.ConvertFromNative() ;
89 message
.Printf( "Print Error %d", err
) ;
90 wxMessageDialog
dialog( NULL
, message
, "", wxICON_HAND
| wxOK
) ;
94 #pragma warning "TODO:Printing for carbon"
99 wxDC
*wxPrintDialog::GetPrintDC()
101 return new wxPrinterDC( m_printDialogData
.GetPrintData() ) ;
108 wxPageSetupDialog::wxPageSetupDialog():
111 m_dialogParent
= NULL
;
114 wxPageSetupDialog::wxPageSetupDialog(wxWindow
*p
, wxPageSetupData
*data
):
120 bool wxPageSetupDialog::Create(wxWindow
*p
, wxPageSetupData
*data
)
125 m_pageSetupData
= (*data
);
130 wxPageSetupDialog::~wxPageSetupDialog()
134 int wxPageSetupDialog::ShowModal()
136 int result
= wxID_CANCEL
;
146 m_pageSetupData
.ConvertToNative() ;
147 if ( ::PrStlDialog( m_pageSetupData
.GetPrintData().m_macPrintInfo
) )
149 m_pageSetupData
.ConvertFromNative() ;
156 message
.Printf( "Print Error %d", err
) ;
157 wxMessageDialog
dialog( NULL
, message
, "", wxICON_HAND
| wxOK
) ;
161 #pragma warning "TODO:printing for carbon"