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