]>
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"
16 #include "wx/object.h"
19 #include "wx/printdlg.h"
20 #include "wx/dcprint.h"
21 #include "wx/msgdlg.h"
22 #include "wx/mac/private/print.h"
24 // Use generic page setup dialog: use your own native one if one exists.
26 IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog
, wxDialog
)
27 IMPLEMENT_CLASS(wxPageSetupDialog
, wxDialog
)
29 wxPrintDialog::wxPrintDialog()
31 m_dialogParent
= NULL
;
36 wxPrintDialog::wxPrintDialog(wxWindow
*p
, wxPrintDialogData
* data
)
41 wxPrintDialog::wxPrintDialog(wxWindow
*p
, wxPrintData
* data
)
43 wxPrintDialogData data2
;
50 bool wxPrintDialog::Create(wxWindow
*p
, wxPrintDialogData
* data
)
57 m_printDialogData
= *data
;
62 wxPrintDialog::~wxPrintDialog()
64 if (m_destroyDC
&& m_printerDC
) {
70 int wxPrintDialog::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
*wxPrintDialog::GetPrintDC()
82 return new wxPrinterDC( m_printDialogData
.GetPrintData() ) ;
89 wxPageSetupDialog::wxPageSetupDialog():
92 m_dialogParent
= NULL
;
95 wxPageSetupDialog::wxPageSetupDialog(wxWindow
*p
, wxPageSetupData
*data
):
101 bool wxPageSetupDialog::Create(wxWindow
*p
, wxPageSetupData
*data
)
106 m_pageSetupData
= (*data
);
111 wxPageSetupDialog::~wxPageSetupDialog()
115 int wxPageSetupDialog::ShowModal()
117 m_pageSetupData
.ConvertToNative() ;
118 int result
= m_pageSetupData
.GetPrintData().m_nativePrintData
->ShowPageSetupDialog() ;
119 if (result
== wxID_OK
)
120 m_pageSetupData
.ConvertFromNative() ;