]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/classic/printdlg.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/mac/classic/printdlg.cpp
3 // Purpose: wxPrintDialog, wxPageSetupDialog
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
15 #include "wx/printdlg.h"
18 #include "wx/object.h"
19 #include "wx/dcprint.h"
20 #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(wxPrintDialog
, wxDialog
)
28 IMPLEMENT_CLASS(wxPageSetupDialog
, wxDialog
)
30 wxPrintDialog::wxPrintDialog()
32 m_dialogParent
= NULL
;
37 wxPrintDialog::wxPrintDialog(wxWindow
*p
, wxPrintDialogData
* data
)
42 wxPrintDialog::wxPrintDialog(wxWindow
*p
, wxPrintData
* data
)
44 wxPrintDialogData data2
;
51 bool wxPrintDialog::Create(wxWindow
*p
, wxPrintDialogData
* data
)
58 m_printDialogData
= *data
;
63 wxPrintDialog::~wxPrintDialog()
65 if (m_destroyDC
&& m_printerDC
) {
71 int wxPrintDialog::ShowModal()
73 m_printDialogData
.ConvertToNative() ;
74 int result
= m_printDialogData
.GetPrintData().m_nativePrintData
->ShowPrintDialog() ;
75 if ( result
== wxID_OK
)
76 m_printDialogData
.ConvertFromNative() ;
81 wxDC
*wxPrintDialog::GetPrintDC()
83 return new wxPrinterDC( m_printDialogData
.GetPrintData() ) ;
90 wxPageSetupDialog::wxPageSetupDialog():
93 m_dialogParent
= NULL
;
96 wxPageSetupDialog::wxPageSetupDialog(wxWindow
*p
, wxPageSetupData
*data
):
102 bool wxPageSetupDialog::Create(wxWindow
*p
, wxPageSetupData
*data
)
107 m_pageSetupData
= (*data
);
112 wxPageSetupDialog::~wxPageSetupDialog()
116 int wxPageSetupDialog::ShowModal()
118 m_pageSetupData
.ConvertToNative() ;
119 int result
= m_pageSetupData
.GetPrintData().m_nativePrintData
->ShowPageSetupDialog() ;
120 if (result
== wxID_OK
)
121 m_pageSetupData
.ConvertFromNative() ;