]>
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/mac/printdlg.h"
19 #include "wx/dcprint.h"
20 #include "wx/msgdlg.h"
21 #include "wx/mac/private/print.h"
23 // Use generic page setup dialog: use your own native one if one exists.
25 IMPLEMENT_DYNAMIC_CLASS(wxMacPrintDialog
, wxPrintDialogBase
)
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() ) ;
84 * wxMacPageSetupDialog
87 IMPLEMENT_CLASS(wxMacPageSetupDialog
, wxPageSetupDialogBase
)
89 wxMacPageSetupDialog::wxMacPageSetupDialog(wxWindow
*p
, wxPageSetupDialogData
*data
) :
90 wxPageSetupDialogBase()
95 bool wxMacPageSetupDialog::Create(wxWindow
*p
, wxPageSetupDialogData
*data
)
100 m_pageSetupData
= (*data
);
105 wxMacPageSetupDialog::~wxMacPageSetupDialog()
109 wxPageSetupData
& wxMacPageSetupDialog::GetPageSetupDialogData()
111 return m_pageSetupData
;
114 int wxMacPageSetupDialog::ShowModal()
116 m_pageSetupData
.ConvertToNative();
118 int result
= m_pageSetupData
.GetPrintData().m_nativePrintData
->ShowPageSetupDialog();
120 if (result
== wxID_OK
)
121 m_pageSetupData
.ConvertFromNative();