]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/printdlg.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxPrintDialog, wxPageSetupDialog
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
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/msgdlg.h"
20 #include "wx/mac/private/print.h"
22 // Use generic page setup dialog: use your own native one if one exists.
24 IMPLEMENT_DYNAMIC_CLASS(wxMacPrintDialog
, wxPrintDialogBase
)
25 IMPLEMENT_CLASS(wxPageSetupDialog
, wxDialog
)
27 wxMacPrintDialog::wxMacPrintDialog()
29 m_dialogParent
= NULL
;
34 wxMacPrintDialog::wxMacPrintDialog(wxWindow
*p
, wxPrintDialogData
* data
)
39 wxMacPrintDialog::wxMacPrintDialog(wxWindow
*p
, wxPrintData
* data
)
41 wxPrintDialogData data2
;
48 bool wxMacPrintDialog::Create(wxWindow
*p
, wxPrintDialogData
* data
)
55 m_printDialogData
= *data
;
60 wxMacPrintDialog::~wxMacPrintDialog()
62 if (m_destroyDC
&& m_printerDC
) {
68 int wxMacPrintDialog::ShowModal()
70 m_printDialogData
.ConvertToNative() ;
71 int result
= m_printDialogData
.GetPrintData().m_nativePrintData
->ShowPrintDialog() ;
72 if ( result
== wxID_OK
)
73 m_printDialogData
.ConvertFromNative() ;
78 wxDC
*wxMacPrintDialog::GetPrintDC()
80 return new wxPrinterDC( m_printDialogData
.GetPrintData() ) ;
87 wxPageSetupDialog::wxPageSetupDialog():
90 m_dialogParent
= NULL
;
93 wxPageSetupDialog::wxPageSetupDialog(wxWindow
*p
, wxPageSetupData
*data
):
99 bool wxPageSetupDialog::Create(wxWindow
*p
, wxPageSetupData
*data
)
104 m_pageSetupData
= (*data
);
109 wxPageSetupDialog::~wxPageSetupDialog()
113 int wxPageSetupDialog::ShowModal()
115 m_pageSetupData
.ConvertToNative() ;
116 int result
= m_pageSetupData
.GetPrintData().m_nativePrintData
->ShowPageSetupDialog() ;
117 if (result
== wxID_OK
)
118 m_pageSetupData
.ConvertFromNative() ;