]>
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 #include "wx/object.h"
19 #include "wx/printdlg.h"
20 #include "wx/mac/printdlg.h"
21 #include "wx/dcprint.h"
22 #include "wx/msgdlg.h"
23 #include "wx/mac/private/print.h"
25 // Use generic page setup dialog: use your own native one if one exists.
27 IMPLEMENT_DYNAMIC_CLASS(wxMacPrintDialog
, wxPrintDialogBase
)
29 wxMacPrintDialog::wxMacPrintDialog()
31 m_dialogParent
= NULL
;
36 wxMacPrintDialog::wxMacPrintDialog(wxWindow
*p
, wxPrintDialogData
* data
)
41 wxMacPrintDialog::wxMacPrintDialog(wxWindow
*p
, wxPrintData
* data
)
43 wxPrintDialogData data2
;
50 bool wxMacPrintDialog::Create(wxWindow
*p
, wxPrintDialogData
* data
)
57 m_printDialogData
= *data
;
62 wxMacPrintDialog::~wxMacPrintDialog()
64 if (m_destroyDC
&& m_printerDC
) {
70 int wxMacPrintDialog::ShowModal()
72 m_printDialogData
.ConvertToNative() ;
73 int result
= m_printDialogData
.GetPrintData().m_nativePrintData
->ShowPrintDialog() ;
74 if ( result
== wxID_OK
)
75 m_printDialogData
.ConvertFromNative() ;
80 wxDC
*wxMacPrintDialog::GetPrintDC()
82 return new wxPrinterDC( m_printDialogData
.GetPrintData() ) ;
86 * wxMacPageSetupDialog
89 IMPLEMENT_CLASS(wxMacPageSetupDialog
, wxPageSetupDialogBase
)
91 wxMacPageSetupDialog::wxMacPageSetupDialog(wxWindow
*p
, wxPageSetupDialogData
*data
) :
92 wxPageSetupDialogBase()
97 bool wxMacPageSetupDialog::Create(wxWindow
*p
, wxPageSetupDialogData
*data
)
102 m_pageSetupData
= (*data
);
107 wxMacPageSetupDialog::~wxMacPageSetupDialog()
111 wxPageSetupData
& wxMacPageSetupDialog::GetPageSetupDialogData()
113 return m_pageSetupData
;
116 int wxMacPageSetupDialog::ShowModal()
118 m_pageSetupData
.ConvertToNative();
120 int result
= m_pageSetupData
.GetPrintData().m_nativePrintData
->ShowPageSetupDialog();
122 if (result
== wxID_OK
)
123 m_pageSetupData
.ConvertFromNative();