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