]>
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
) ;
95 #warning "TODO:Printing for carbon"
97 #pragma warning "TODO:Printing for carbon"
103 wxDC
*wxPrintDialog::GetPrintDC()
105 return new wxPrinterDC( m_printDialogData
.GetPrintData() ) ;
112 wxPageSetupDialog::wxPageSetupDialog():
115 m_dialogParent
= NULL
;
118 wxPageSetupDialog::wxPageSetupDialog(wxWindow
*p
, wxPageSetupData
*data
):
124 bool wxPageSetupDialog::Create(wxWindow
*p
, wxPageSetupData
*data
)
129 m_pageSetupData
= (*data
);
134 wxPageSetupDialog::~wxPageSetupDialog()
138 int wxPageSetupDialog::ShowModal()
140 int result
= wxID_CANCEL
;
150 m_pageSetupData
.ConvertToNative() ;
151 if ( ::PrStlDialog( m_pageSetupData
.GetPrintData().m_macPrintInfo
) )
153 m_pageSetupData
.ConvertFromNative() ;
160 message
.Printf( "Print Error %d", err
) ;
161 wxMessageDialog
dialog( NULL
, message
, "", wxICON_HAND
| wxOK
) ;
166 #warning "TODO:Printing for carbon"
168 #pragma warning "TODO:Printing for carbon"