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
; }
101 wxPrintMode
GetPrintMode() const { return m_printMode
; }
103 void SetPrinterCommand(const wxString
& command
) { m_printerCommand
= command
; }
104 void SetPrinterOptions(const wxString
& options
) { m_printerOptions
= options
; }
105 void SetPreviewCommand(const wxString
& command
) { m_previewCommand
= command
; }
106 void SetFontMetricPath(const wxString
& path
) { m_afmPath
= path
; }
107 void SetPrinterScaleX(double x
) { m_printerScaleX
= x
; }
108 void SetPrinterScaleY(double y
) { m_printerScaleY
= y
; }
109 void SetPrinterScaling(double x
, double y
) { m_printerScaleX
= x
; m_printerScaleY
= y
; }
110 void SetPrinterTranslateX(long x
) { m_printerTranslateX
= x
; }
111 void SetPrinterTranslateY(long y
) { m_printerTranslateY
= y
; }
112 void SetPrinterTranslation(long x
, long y
) { m_printerTranslateX
= x
; m_printerTranslateY
= y
; }
113 void SetPrintMode(wxPrintMode printMode
) { m_printMode
= printMode
; }
116 wxOutputStream
*GetOutputStream() { return m_outputStream
; }
117 void SetOutputStream( wxOutputStream
*output
) { m_outputStream
= output
; }
121 wxString m_printerCommand
;
122 wxString m_previewCommand
;
123 wxString m_printerOptions
;
125 double m_printerScaleX
;
126 double m_printerScaleY
;
127 long m_printerTranslateX
;
128 long m_printerTranslateY
;
129 wxPrintMode m_printMode
;
131 wxOutputStream
*m_outputStream
;
135 DECLARE_DYNAMIC_CLASS(wxPostScriptPrintNativeData
)
138 // ----------------------------------------------------------------------------
139 // Simulated Print and Print Setup dialogs for non-Windows platforms (and
140 // Windows using PostScript print/preview)
141 // ----------------------------------------------------------------------------
143 class WXDLLEXPORT wxGenericPrintDialog
: public wxPrintDialogBase
146 wxGenericPrintDialog(wxWindow
*parent
,
147 wxPrintDialogData
* data
= (wxPrintDialogData
*)NULL
);
148 wxGenericPrintDialog(wxWindow
*parent
, wxPrintData
* data
);
150 virtual ~wxGenericPrintDialog();
152 void OnSetup(wxCommandEvent
& event
);
153 void OnRange(wxCommandEvent
& event
);
154 void OnOK(wxCommandEvent
& event
);
156 virtual bool TransferDataFromWindow();
157 virtual bool TransferDataToWindow();
159 virtual int ShowModal();
162 wxPrintData
& GetPrintData()
163 { return m_printDialogData
.GetPrintData(); }
164 #endif // wxUSE_POSTSCRIPT
166 wxPrintDialogData
& GetPrintDialogData() { return m_printDialogData
; }
170 // wxStaticText* m_printerMessage;
171 wxButton
* m_setupButton
;
172 // wxButton* m_helpButton;
173 wxRadioBox
* m_rangeRadioBox
;
174 wxTextCtrl
* m_fromText
;
175 wxTextCtrl
* m_toText
;
176 wxTextCtrl
* m_noCopiesText
;
177 wxCheckBox
* m_printToFileCheckBox
;
178 // wxCheckBox* m_collateCopiesCheckBox;
180 wxPrintDialogData m_printDialogData
;
183 void Init(wxWindow
*parent
);
186 DECLARE_EVENT_TABLE()
187 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog
)
190 class WXDLLEXPORT wxGenericPrintSetupDialog
: public wxDialog
193 // There are no configuration options for the dialog, so we
194 // just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
195 wxGenericPrintSetupDialog(wxWindow
*parent
, wxPrintData
* data
);
196 wxGenericPrintSetupDialog(wxWindow
*parent
, wxPrintSetupData
* data
);
197 virtual ~wxGenericPrintSetupDialog();
199 void Init(wxPrintData
* data
);
201 virtual bool TransferDataFromWindow();
202 virtual bool TransferDataToWindow();
204 wxComboBox
*CreatePaperTypeChoice(int* x
, int* y
);
207 wxRadioBox
* m_orientationRadioBox
;
208 wxTextCtrl
* m_printerCommandText
;
209 wxTextCtrl
* m_printerOptionsText
;
210 wxCheckBox
* m_colourCheckBox
;
211 wxComboBox
* m_paperTypeChoice
;
214 wxPrintData m_printData
;
215 wxPrintData
& GetPrintData() { return m_printData
; }
216 #endif // wxUSE_POSTSCRIPT
219 DECLARE_CLASS(wxGenericPrintSetupDialog
)
224 class WXDLLEXPORT wxGenericPageSetupDialog
: public wxDialog
227 wxGenericPageSetupDialog(wxWindow
*parent
= NULL
,
228 wxPageSetupData
* data
= NULL
);
229 virtual ~wxGenericPageSetupDialog();
231 virtual bool TransferDataFromWindow();
232 virtual bool TransferDataToWindow();
234 void OnPrinter(wxCommandEvent
& event
);
236 wxComboBox
*CreatePaperTypeChoice(int* x
, int* y
);
237 wxPageSetupData
& GetPageSetupData() { return m_pageData
; }
240 wxButton
* m_printerButton
;
241 wxRadioBox
* m_orientationRadioBox
;
242 wxTextCtrl
* m_marginLeftText
;
243 wxTextCtrl
* m_marginTopText
;
244 wxTextCtrl
* m_marginRightText
;
245 wxTextCtrl
* m_marginBottomText
;
246 wxComboBox
* m_paperTypeChoice
;
248 static bool m_pageSetupDialogCancelled
;
250 wxPageSetupData m_pageData
;
253 DECLARE_EVENT_TABLE()
254 DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericPageSetupDialog
)