1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGenericPrintDialog, wxGenericPrintSetupDialog,
4 // wxGenericPageSetupDialog
5 // Author: Julian Smart
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef __PRINTDLGH_G_
14 #define __PRINTDLGH_G_
16 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
17 #pragma interface "prntdlgg.h"
22 #if wxUSE_PRINTING_ARCHITECTURE
24 #include "wx/dialog.h"
25 #include "wx/cmndata.h"
26 #include "wx/prntbase.h"
27 #include "wx/printdlg.h"
33 class WXDLLEXPORT wxTextCtrl
;
34 class WXDLLEXPORT wxButton
;
35 class WXDLLEXPORT wxCheckBox
;
36 class WXDLLEXPORT wxComboBox
;
37 class WXDLLEXPORT wxStaticText
;
38 class WXDLLEXPORT wxRadioBox
;
39 class WXDLLEXPORT wxPrintSetupData
;
40 class WXDLLEXPORT wxPageSetupData
;
42 // ----------------------------------------------------------------------------
44 // ----------------------------------------------------------------------------
46 // FIXME why all these enums start with 10 or 30?
50 wxPRINTID_STATIC
= 10,
55 wxPRINTID_PRINTTOFILE
,
61 wxPRINTID_LEFTMARGIN
= 30,
62 wxPRINTID_RIGHTMARGIN
,
64 wxPRINTID_BOTTOMMARGIN
69 wxPRINTID_PRINTCOLOUR
= 10,
70 wxPRINTID_ORIENTATION
,
78 //----------------------------------------------------------------------------
79 // wxPostScriptNativeData
80 //----------------------------------------------------------------------------
82 class WXDLLEXPORT wxPostScriptPrintNativeData
: public wxPrintNativeDataBase
85 wxPostScriptPrintNativeData();
86 virtual ~wxPostScriptPrintNativeData();
88 virtual bool TransferTo( wxPrintData
&data
);
89 virtual bool TransferFrom( const wxPrintData
&data
);
91 virtual bool Ok() const { return true; }
93 const wxString
& GetPrinterCommand() const { return m_printerCommand
; }
94 const wxString
& GetPrinterOptions() const { return m_printerOptions
; }
95 const wxString
& GetPreviewCommand() const { return m_previewCommand
; }
96 const wxString
& GetFontMetricPath() const { return m_afmPath
; }
97 double GetPrinterScaleX() const { return m_printerScaleX
; }
98 double GetPrinterScaleY() const { return m_printerScaleY
; }
99 long GetPrinterTranslateX() const { return m_printerTranslateX
; }
100 long GetPrinterTranslateY() const { return m_printerTranslateY
; }
102 void SetPrinterCommand(const wxString
& command
) { m_printerCommand
= command
; }
103 void SetPrinterOptions(const wxString
& options
) { m_printerOptions
= options
; }
104 void SetPreviewCommand(const wxString
& command
) { m_previewCommand
= command
; }
105 void SetFontMetricPath(const wxString
& path
) { m_afmPath
= path
; }
106 void SetPrinterScaleX(double x
) { m_printerScaleX
= x
; }
107 void SetPrinterScaleY(double y
) { m_printerScaleY
= y
; }
108 void SetPrinterScaling(double x
, double y
) { m_printerScaleX
= x
; m_printerScaleY
= y
; }
109 void SetPrinterTranslateX(long x
) { m_printerTranslateX
= x
; }
110 void SetPrinterTranslateY(long y
) { m_printerTranslateY
= y
; }
111 void SetPrinterTranslation(long x
, long y
) { m_printerTranslateX
= x
; m_printerTranslateY
= y
; }
114 wxOutputStream
*GetOutputStream() { return m_outputStream
; }
115 void SetOutputStream( wxOutputStream
*output
) { m_outputStream
= output
; }
119 wxString m_printerCommand
;
120 wxString m_previewCommand
;
121 wxString m_printerOptions
;
123 double m_printerScaleX
;
124 double m_printerScaleY
;
125 long m_printerTranslateX
;
126 long m_printerTranslateY
;
128 wxOutputStream
*m_outputStream
;
132 DECLARE_DYNAMIC_CLASS(wxPostScriptPrintNativeData
)
135 // ----------------------------------------------------------------------------
136 // Simulated Print and Print Setup dialogs for non-Windows platforms (and
137 // Windows using PostScript print/preview)
138 // ----------------------------------------------------------------------------
140 class WXDLLEXPORT wxGenericPrintDialog
: public wxPrintDialogBase
143 wxGenericPrintDialog(wxWindow
*parent
,
144 wxPrintDialogData
* data
= (wxPrintDialogData
*)NULL
);
145 wxGenericPrintDialog(wxWindow
*parent
, wxPrintData
* data
);
147 virtual ~wxGenericPrintDialog();
149 void OnSetup(wxCommandEvent
& event
);
150 void OnRange(wxCommandEvent
& event
);
151 void OnOK(wxCommandEvent
& event
);
153 virtual bool TransferDataFromWindow();
154 virtual bool TransferDataToWindow();
156 virtual int ShowModal();
159 wxPrintData
& GetPrintData()
160 { return m_printDialogData
.GetPrintData(); }
161 #endif // wxUSE_POSTSCRIPT
163 wxPrintDialogData
& GetPrintDialogData() { return m_printDialogData
; }
167 // wxStaticText* m_printerMessage;
168 wxButton
* m_setupButton
;
169 // wxButton* m_helpButton;
170 wxRadioBox
* m_rangeRadioBox
;
171 wxTextCtrl
* m_fromText
;
172 wxTextCtrl
* m_toText
;
173 wxTextCtrl
* m_noCopiesText
;
174 wxCheckBox
* m_printToFileCheckBox
;
175 // wxCheckBox* m_collateCopiesCheckBox;
177 wxPrintDialogData m_printDialogData
;
180 void Init(wxWindow
*parent
);
183 DECLARE_EVENT_TABLE()
184 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog
)
187 class WXDLLEXPORT wxGenericPrintSetupDialog
: public wxDialog
190 // There are no configuration options for the dialog, so we
191 // just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
192 wxGenericPrintSetupDialog(wxWindow
*parent
, wxPrintData
* data
);
193 wxGenericPrintSetupDialog(wxWindow
*parent
, wxPrintSetupData
* data
);
194 virtual ~wxGenericPrintSetupDialog();
196 void Init(wxPrintData
* data
);
198 virtual bool TransferDataFromWindow();
199 virtual bool TransferDataToWindow();
201 virtual wxComboBox
*CreatePaperTypeChoice();
204 wxRadioBox
* m_orientationRadioBox
;
205 wxTextCtrl
* m_printerCommandText
;
206 wxTextCtrl
* m_printerOptionsText
;
207 wxCheckBox
* m_colourCheckBox
;
208 wxComboBox
* m_paperTypeChoice
;
211 wxPrintData m_printData
;
212 wxPrintData
& GetPrintData() { return m_printData
; }
213 #endif // wxUSE_POSTSCRIPT
216 DECLARE_CLASS(wxGenericPrintSetupDialog
)
221 class WXDLLEXPORT wxGenericPageSetupDialog
: public wxDialog
224 wxGenericPageSetupDialog(wxWindow
*parent
= NULL
,
225 wxPageSetupData
* data
= NULL
);
226 virtual ~wxGenericPageSetupDialog();
228 virtual bool TransferDataFromWindow();
229 virtual bool TransferDataToWindow();
231 void OnPrinter(wxCommandEvent
& event
);
233 wxComboBox
*CreatePaperTypeChoice(int* x
, int* y
);
234 wxPageSetupData
& GetPageSetupData() { return m_pageData
; }
237 wxButton
* m_printerButton
;
238 wxRadioBox
* m_orientationRadioBox
;
239 wxTextCtrl
* m_marginLeftText
;
240 wxTextCtrl
* m_marginTopText
;
241 wxTextCtrl
* m_marginRightText
;
242 wxTextCtrl
* m_marginBottomText
;
243 wxComboBox
* m_paperTypeChoice
;
245 static bool m_pageSetupDialogCancelled
;
247 wxPageSetupData m_pageData
;
250 DECLARE_EVENT_TABLE()
251 DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericPageSetupDialog
)