]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/classic/printdlg.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxPrintDialog, wxPageSetupDialog
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/object.h"
13 #include "wx/printdlg.h"
14 #include "wx/dcprint.h"
15 #include "wx/msgdlg.h"
16 #include "wx/mac/private/print.h"
18 // Use generic page setup dialog: use your own native one if one exists.
20 IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog
, wxDialog
)
21 IMPLEMENT_CLASS(wxPageSetupDialog
, wxDialog
)
23 wxPrintDialog::wxPrintDialog()
25 m_dialogParent
= NULL
;
30 wxPrintDialog::wxPrintDialog(wxWindow
*p
, wxPrintDialogData
* data
)
35 wxPrintDialog::wxPrintDialog(wxWindow
*p
, wxPrintData
* data
)
37 wxPrintDialogData data2
;
44 bool wxPrintDialog::Create(wxWindow
*p
, wxPrintDialogData
* data
)
51 m_printDialogData
= *data
;
56 wxPrintDialog::~wxPrintDialog()
58 if (m_destroyDC
&& m_printerDC
) {
64 int wxPrintDialog::ShowModal()
66 m_printDialogData
.ConvertToNative() ;
67 int result
= m_printDialogData
.GetPrintData().m_nativePrintData
->ShowPrintDialog() ;
68 if ( result
== wxID_OK
)
69 m_printDialogData
.ConvertFromNative() ;
74 wxDC
*wxPrintDialog::GetPrintDC()
76 return new wxPrinterDC( m_printDialogData
.GetPrintData() ) ;
83 wxPageSetupDialog::wxPageSetupDialog():
86 m_dialogParent
= NULL
;
89 wxPageSetupDialog::wxPageSetupDialog(wxWindow
*p
, wxPageSetupData
*data
):
95 bool wxPageSetupDialog::Create(wxWindow
*p
, wxPageSetupData
*data
)
100 m_pageSetupData
= (*data
);
105 wxPageSetupDialog::~wxPageSetupDialog()
109 int wxPageSetupDialog::ShowModal()
111 m_pageSetupData
.ConvertToNative() ;
112 int result
= m_pageSetupData
.GetPrintData().m_nativePrintData
->ShowPageSetupDialog() ;
113 if (result
== wxID_OK
)
114 m_pageSetupData
.ConvertFromNative() ;