]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/printdlg.cpp
18c7a8427e244c53973cb4c1a70e6d3882ec41ba
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxPrintDialog, wxPageSetupDialog
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "printdlg.h"
16 #include "wx/object.h"
17 #include "wx/mac/printdlg.h"
18 #include "wx/dcprint.h"
20 // Use generic page setup dialog: use your own native one if one exists.
22 #if !USE_SHARED_LIBRARY
23 IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog
, wxDialog
)
24 IMPLEMENT_CLASS(wxPageSetupDialog
, wxDialog
)
27 wxPrintDialog::wxPrintDialog():
30 m_dialogParent
= NULL
;
33 wxPrintDialog::wxPrintDialog(wxWindow
*p
, wxPrintData
* data
):
39 bool wxPrintDialog::Create(wxWindow
*p
, wxPrintData
* data
)
49 wxPrintDialog::~wxPrintDialog()
53 int wxPrintDialog::ShowModal()
55 int result
= wxID_CANCEL
;
63 m_printData
.ConvertToNative() ;
64 if ( m_printData
.macPrintInfo
&& ::PrJobDialog( m_printData
.macPrintInfo
) )
66 m_printData
.ConvertFromNative() ;
73 message
.Printf( "Print Error %d", err
) ;
74 wxMessageDialog
dialog( NULL
, message
, "", wxICON_HAND
| wxOK
) ;
81 wxDC
*wxPrintDialog::GetPrintDC()
83 return new wxPrinterDC( m_printData
) ;
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 int result
= wxID_CANCEL
;
126 m_pageSetupData
.ConvertToNative() ;
127 if ( m_pageSetupData
.m_macPageSetupInfo
&& ::PrStlDialog( m_pageSetupData
.m_macPageSetupInfo
) )
129 m_pageSetupData
.ConvertFromNative() ;
136 message
.Printf( "Print Error %d", err
) ;
137 wxMessageDialog
dialog( NULL
, message
, "", wxICON_HAND
| wxOK
) ;