]>
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 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "printdlg.h"
16 #include "wx/object.h"
17 #include "wx/printdlg.h"
18 #include "wx/dcprint.h"
19 #include "wx/msgdlg.h"
20 #include "wx/mac/private/print.h"
22 // Use generic page setup dialog: use your own native one if one exists.
24 #if !USE_SHARED_LIBRARY
25 IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog
, wxDialog
)
26 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() ;