]>
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 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13 #pragma implementation "printdlg.h"
16 #include "wx/wxprec.h"
18 #if wxUSE_PRINTING_ARCHITECTURE
20 #include "wx/object.h"
21 #include "wx/printdlg.h"
22 #include "wx/mac/printdlg.h"
23 #include "wx/dcprint.h"
24 #include "wx/msgdlg.h"
25 #include "wx/mac/private/print.h"
27 // Use generic page setup dialog: use your own native one if one exists.
29 IMPLEMENT_DYNAMIC_CLASS(wxMacPrintDialog
, wxPrintDialogBase
)
31 wxMacPrintDialog::wxMacPrintDialog()
33 m_dialogParent
= NULL
;
38 wxMacPrintDialog::wxMacPrintDialog(wxWindow
*p
, wxPrintDialogData
* data
)
43 wxMacPrintDialog::wxMacPrintDialog(wxWindow
*p
, wxPrintData
* data
)
45 wxPrintDialogData data2
;
52 bool wxMacPrintDialog::Create(wxWindow
*p
, wxPrintDialogData
* data
)
59 m_printDialogData
= *data
;
64 wxMacPrintDialog::~wxMacPrintDialog()
66 if (m_destroyDC
&& m_printerDC
) {
72 int wxMacPrintDialog::ShowModal()
74 m_printDialogData
.ConvertToNative() ;
75 int result
= m_printDialogData
.GetPrintData().m_nativePrintData
->ShowPrintDialog() ;
76 if ( result
== wxID_OK
)
77 m_printDialogData
.ConvertFromNative() ;
82 wxDC
*wxMacPrintDialog::GetPrintDC()
84 return new wxPrinterDC( m_printDialogData
.GetPrintData() ) ;
88 * wxMacPageSetupDialog
91 IMPLEMENT_CLASS(wxMacPageSetupDialog
, wxPageSetupDialogBase
)
93 wxMacPageSetupDialog::wxMacPageSetupDialog(wxWindow
*p
, wxPageSetupDialogData
*data
) :
94 wxPageSetupDialogBase()
99 bool wxMacPageSetupDialog::Create(wxWindow
*p
, wxPageSetupDialogData
*data
)
104 m_pageSetupData
= (*data
);
109 wxMacPageSetupDialog::~wxMacPageSetupDialog()
113 wxPageSetupData
& wxMacPageSetupDialog::GetPageSetupDialogData()
115 return m_pageSetupData
;
118 int wxMacPageSetupDialog::ShowModal()
120 m_pageSetupData
.ConvertToNative();
122 int result
= m_pageSetupData
.GetPrintData().m_nativePrintData
->ShowPageSetupDialog();
124 if (result
== wxID_OK
)
125 m_pageSetupData
.ConvertFromNative();