]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: prntdlgg.h | |
3 | // Purpose: wxGenericPrintDialog, wxGenericPrintSetupDialog, | |
4 | // wxGenericPageSetupDialog | |
5 | // Author: Julian Smart | |
6 | // Modified by: | |
7 | // Created: 01/02/97 | |
8 | // RCS-ID: $Id$ | |
99d80019 | 9 | // Copyright: (c) Julian Smart |
65571936 | 10 | // Licence: wxWindows licence |
c801d85f KB |
11 | ///////////////////////////////////////////////////////////////////////////// |
12 | ||
13 | #ifndef __PRINTDLGH_G_ | |
14 | #define __PRINTDLGH_G_ | |
15 | ||
c801d85f | 16 | #include "wx/defs.h" |
ce4169a4 RR |
17 | |
18 | #if wxUSE_PRINTING_ARCHITECTURE | |
19 | ||
bf38cbff | 20 | #include "wx/dialog.h" |
d7a7bd6d | 21 | #include "wx/cmndata.h" |
8850cbd3 | 22 | #include "wx/prntbase.h" |
c061373d | 23 | #include "wx/printdlg.h" |
2c84e0c2 | 24 | #include "wx/listctrl.h" |
bf38cbff | 25 | |
888dde65 | 26 | #include "wx/dc.h" |
bf38cbff | 27 | #if wxUSE_POSTSCRIPT |
d6b9496a | 28 | #include "wx/dcps.h" |
bf38cbff | 29 | #endif |
c801d85f | 30 | |
b5dbe15d VS |
31 | class WXDLLIMPEXP_FWD_CORE wxTextCtrl; |
32 | class WXDLLIMPEXP_FWD_CORE wxButton; | |
33 | class WXDLLIMPEXP_FWD_CORE wxCheckBox; | |
34 | class WXDLLIMPEXP_FWD_CORE wxComboBox; | |
35 | class WXDLLIMPEXP_FWD_CORE wxStaticText; | |
36 | class WXDLLIMPEXP_FWD_CORE wxRadioBox; | |
37 | class WXDLLIMPEXP_FWD_CORE wxPageSetupData; | |
8850cbd3 | 38 | |
d6b9496a VZ |
39 | // ---------------------------------------------------------------------------- |
40 | // constants | |
41 | // ---------------------------------------------------------------------------- | |
c801d85f | 42 | |
5c750f94 WS |
43 | // This is not clear why all these enums start with 10 or 30 but do not change it |
44 | // without good reason to avoid some subtle backwards compatibility breakage | |
c801d85f | 45 | |
d6b9496a VZ |
46 | enum |
47 | { | |
48 | wxPRINTID_STATIC = 10, | |
49 | wxPRINTID_RANGE, | |
50 | wxPRINTID_FROM, | |
51 | wxPRINTID_TO, | |
52 | wxPRINTID_COPIES, | |
53 | wxPRINTID_PRINTTOFILE, | |
54 | wxPRINTID_SETUP | |
55 | }; | |
56 | ||
57 | enum | |
58 | { | |
59 | wxPRINTID_LEFTMARGIN = 30, | |
60 | wxPRINTID_RIGHTMARGIN, | |
61 | wxPRINTID_TOPMARGIN, | |
62 | wxPRINTID_BOTTOMMARGIN | |
63 | }; | |
64 | ||
65 | enum | |
66 | { | |
67 | wxPRINTID_PRINTCOLOUR = 10, | |
68 | wxPRINTID_ORIENTATION, | |
69 | wxPRINTID_COMMAND, | |
70 | wxPRINTID_OPTIONS, | |
2c84e0c2 RR |
71 | wxPRINTID_PAPERSIZE, |
72 | wxPRINTID_PRINTER | |
d6b9496a VZ |
73 | }; |
74 | ||
8850cbd3 RR |
75 | #if wxUSE_POSTSCRIPT |
76 | ||
77 | //---------------------------------------------------------------------------- | |
78 | // wxPostScriptNativeData | |
79 | //---------------------------------------------------------------------------- | |
80 | ||
53a2db12 | 81 | class WXDLLIMPEXP_CORE wxPostScriptPrintNativeData: public wxPrintNativeDataBase |
8850cbd3 RR |
82 | { |
83 | public: | |
84 | wxPostScriptPrintNativeData(); | |
85 | virtual ~wxPostScriptPrintNativeData(); | |
5c750f94 | 86 | |
fd64de59 RR |
87 | virtual bool TransferTo( wxPrintData &data ); |
88 | virtual bool TransferFrom( const wxPrintData &data ); | |
5c750f94 | 89 | |
b7cacb43 VZ |
90 | virtual bool Ok() const { return IsOk(); } |
91 | virtual bool IsOk() const { return true; } | |
5c750f94 | 92 | |
8850cbd3 RR |
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; } | |
8850cbd3 RR |
101 | |
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; } | |
8850cbd3 RR |
112 | |
113 | #if wxUSE_STREAMS | |
114 | wxOutputStream *GetOutputStream() { return m_outputStream; } | |
115 | void SetOutputStream( wxOutputStream *output ) { m_outputStream = output; } | |
116 | #endif | |
117 | ||
118 | private: | |
119 | wxString m_printerCommand; | |
120 | wxString m_previewCommand; | |
121 | wxString m_printerOptions; | |
122 | wxString m_afmPath; | |
123 | double m_printerScaleX; | |
124 | double m_printerScaleY; | |
125 | long m_printerTranslateX; | |
126 | long m_printerTranslateY; | |
8850cbd3 RR |
127 | #if wxUSE_STREAMS |
128 | wxOutputStream *m_outputStream; | |
129 | #endif | |
5c750f94 | 130 | |
8850cbd3 RR |
131 | private: |
132 | DECLARE_DYNAMIC_CLASS(wxPostScriptPrintNativeData) | |
133 | }; | |
5c750f94 | 134 | |
d6b9496a VZ |
135 | // ---------------------------------------------------------------------------- |
136 | // Simulated Print and Print Setup dialogs for non-Windows platforms (and | |
137 | // Windows using PostScript print/preview) | |
138 | // ---------------------------------------------------------------------------- | |
139 | ||
53a2db12 | 140 | class WXDLLIMPEXP_CORE wxGenericPrintDialog : public wxPrintDialogBase |
c801d85f | 141 | { |
7bcb11d3 | 142 | public: |
d6b9496a VZ |
143 | wxGenericPrintDialog(wxWindow *parent, |
144 | wxPrintDialogData* data = (wxPrintDialogData*)NULL); | |
145 | wxGenericPrintDialog(wxWindow *parent, wxPrintData* data); | |
146 | ||
147 | virtual ~wxGenericPrintDialog(); | |
7bcb11d3 JS |
148 | |
149 | void OnSetup(wxCommandEvent& event); | |
150 | void OnRange(wxCommandEvent& event); | |
151 | void OnOK(wxCommandEvent& event); | |
d6b9496a | 152 | |
7bcb11d3 JS |
153 | virtual bool TransferDataFromWindow(); |
154 | virtual bool TransferDataToWindow(); | |
155 | ||
156 | virtual int ShowModal(); | |
157 | ||
d6b9496a VZ |
158 | wxPrintData& GetPrintData() |
159 | { return m_printDialogData.GetPrintData(); } | |
d6b9496a VZ |
160 | |
161 | wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; } | |
7bcb11d3 JS |
162 | wxDC *GetPrintDC(); |
163 | ||
164 | public: | |
58a33cb4 | 165 | // wxStaticText* m_printerMessage; |
7bcb11d3 | 166 | wxButton* m_setupButton; |
58a33cb4 | 167 | // wxButton* m_helpButton; |
7bcb11d3 JS |
168 | wxRadioBox* m_rangeRadioBox; |
169 | wxTextCtrl* m_fromText; | |
170 | wxTextCtrl* m_toText; | |
171 | wxTextCtrl* m_noCopiesText; | |
172 | wxCheckBox* m_printToFileCheckBox; | |
58a33cb4 | 173 | // wxCheckBox* m_collateCopiesCheckBox; |
d6b9496a | 174 | |
7bcb11d3 | 175 | wxPrintDialogData m_printDialogData; |
d6b9496a VZ |
176 | |
177 | protected: | |
178 | void Init(wxWindow *parent); | |
179 | ||
180 | private: | |
7bcb11d3 | 181 | DECLARE_EVENT_TABLE() |
47dc9f78 | 182 | DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog) |
c801d85f KB |
183 | }; |
184 | ||
53a2db12 | 185 | class WXDLLIMPEXP_CORE wxGenericPrintSetupDialog : public wxDialog |
c801d85f | 186 | { |
7bcb11d3 JS |
187 | public: |
188 | // There are no configuration options for the dialog, so we | |
189 | // just pass the wxPrintData object (no wxPrintSetupDialogData class needed) | |
190 | wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data); | |
d6b9496a | 191 | virtual ~wxGenericPrintSetupDialog(); |
7bcb11d3 JS |
192 | |
193 | void Init(wxPrintData* data); | |
194 | ||
2c84e0c2 | 195 | void OnPrinter(wxListEvent& event); |
5c750f94 | 196 | |
7bcb11d3 JS |
197 | virtual bool TransferDataFromWindow(); |
198 | virtual bool TransferDataToWindow(); | |
199 | ||
6038ec8e | 200 | virtual wxComboBox *CreatePaperTypeChoice(); |
d6b9496a | 201 | |
7bcb11d3 | 202 | public: |
2c84e0c2 | 203 | wxListCtrl* m_printerListCtrl; |
7bcb11d3 JS |
204 | wxRadioBox* m_orientationRadioBox; |
205 | wxTextCtrl* m_printerCommandText; | |
206 | wxTextCtrl* m_printerOptionsText; | |
207 | wxCheckBox* m_colourCheckBox; | |
2c84e0c2 | 208 | wxComboBox* m_paperTypeChoice; |
d6b9496a | 209 | |
7bcb11d3 | 210 | wxPrintData m_printData; |
d6b9496a | 211 | wxPrintData& GetPrintData() { return m_printData; } |
5c750f94 | 212 | |
2c84e0c2 RR |
213 | // After pressing OK, write data here. |
214 | wxPrintData* m_targetData; | |
47dc9f78 RR |
215 | |
216 | private: | |
2c84e0c2 | 217 | DECLARE_EVENT_TABLE() |
47dc9f78 | 218 | DECLARE_CLASS(wxGenericPrintSetupDialog) |
c801d85f | 219 | }; |
25889d3c JS |
220 | #endif |
221 | // wxUSE_POSTSCRIPT | |
c801d85f | 222 | |
53a2db12 | 223 | class WXDLLIMPEXP_CORE wxGenericPageSetupDialog : public wxPageSetupDialogBase |
c801d85f | 224 | { |
7bcb11d3 | 225 | public: |
47494677 | 226 | wxGenericPageSetupDialog(wxWindow *parent = NULL, |
08680429 | 227 | wxPageSetupDialogData* data = NULL); |
d6b9496a | 228 | virtual ~wxGenericPageSetupDialog(); |
7bcb11d3 JS |
229 | |
230 | virtual bool TransferDataFromWindow(); | |
231 | virtual bool TransferDataToWindow(); | |
232 | ||
08680429 | 233 | virtual wxPageSetupDialogData& GetPageSetupDialogData(); |
d6b9496a | 234 | |
08680429 | 235 | void OnPrinter(wxCommandEvent& event); |
fa12f7e6 | 236 | wxComboBox *CreatePaperTypeChoice(int* x, int* y); |
7bcb11d3 JS |
237 | |
238 | public: | |
239 | wxButton* m_printerButton; | |
240 | wxRadioBox* m_orientationRadioBox; | |
241 | wxTextCtrl* m_marginLeftText; | |
242 | wxTextCtrl* m_marginTopText; | |
243 | wxTextCtrl* m_marginRightText; | |
244 | wxTextCtrl* m_marginBottomText; | |
fa12f7e6 | 245 | wxComboBox* m_paperTypeChoice; |
d6b9496a | 246 | |
08680429 | 247 | wxPageSetupDialogData m_pageData; |
d6b9496a VZ |
248 | |
249 | private: | |
7bcb11d3 | 250 | DECLARE_EVENT_TABLE() |
47494677 | 251 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericPageSetupDialog) |
c801d85f KB |
252 | }; |
253 | ||
ce4169a4 RR |
254 | #endif |
255 | ||
c801d85f | 256 | #endif |
28181831 | 257 | // __PRINTDLGH_G_ |