]>
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) | |
d6b9496a | 10 | // Licence: wxWindows licence |
c801d85f KB |
11 | ///////////////////////////////////////////////////////////////////////////// |
12 | ||
13 | #ifndef __PRINTDLGH_G_ | |
14 | #define __PRINTDLGH_G_ | |
15 | ||
af49c4b8 | 16 | #if defined(__GNUG__) && !defined(__APPLE__) |
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" |
bf38cbff JS |
26 | |
27 | #if wxUSE_POSTSCRIPT | |
d6b9496a | 28 | #include "wx/dcps.h" |
bf38cbff | 29 | #endif |
c801d85f KB |
30 | |
31 | class WXDLLEXPORT wxTextCtrl; | |
32 | class WXDLLEXPORT wxButton; | |
33 | class WXDLLEXPORT wxCheckBox; | |
fa12f7e6 | 34 | class WXDLLEXPORT wxComboBox; |
c801d85f KB |
35 | class WXDLLEXPORT wxStaticText; |
36 | class WXDLLEXPORT wxRadioBox; | |
5e9f4026 | 37 | class WXDLLEXPORT wxPrintSetupData; |
43330cc9 | 38 | class WXDLLEXPORT wxPageSetupData; |
d6b9496a VZ |
39 | // ---------------------------------------------------------------------------- |
40 | // constants | |
41 | // ---------------------------------------------------------------------------- | |
c801d85f | 42 | |
d6b9496a | 43 | // FIXME why all these enums start with 10 or 30? |
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, | |
70 | wxPRINTID_PAPERSIZE | |
71 | }; | |
72 | ||
73 | // ---------------------------------------------------------------------------- | |
74 | // Simulated Print and Print Setup dialogs for non-Windows platforms (and | |
75 | // Windows using PostScript print/preview) | |
76 | // ---------------------------------------------------------------------------- | |
77 | ||
25889d3c | 78 | #if wxUSE_POSTSCRIPT |
d6b9496a | 79 | class WXDLLEXPORT wxGenericPrintDialog : public wxDialog |
c801d85f | 80 | { |
7bcb11d3 | 81 | public: |
d6b9496a VZ |
82 | wxGenericPrintDialog(wxWindow *parent, |
83 | wxPrintDialogData* data = (wxPrintDialogData*)NULL); | |
84 | wxGenericPrintDialog(wxWindow *parent, wxPrintData* data); | |
85 | ||
86 | virtual ~wxGenericPrintDialog(); | |
7bcb11d3 JS |
87 | |
88 | void OnSetup(wxCommandEvent& event); | |
89 | void OnRange(wxCommandEvent& event); | |
90 | void OnOK(wxCommandEvent& event); | |
d6b9496a | 91 | |
7bcb11d3 JS |
92 | virtual bool TransferDataFromWindow(); |
93 | virtual bool TransferDataToWindow(); | |
94 | ||
95 | virtual int ShowModal(); | |
96 | ||
d6b9496a VZ |
97 | #if wxUSE_POSTSCRIPT |
98 | wxPrintData& GetPrintData() | |
99 | { return m_printDialogData.GetPrintData(); } | |
100 | #endif // wxUSE_POSTSCRIPT | |
101 | ||
102 | wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; } | |
7bcb11d3 JS |
103 | wxDC *GetPrintDC(); |
104 | ||
105 | public: | |
58a33cb4 | 106 | // wxStaticText* m_printerMessage; |
7bcb11d3 | 107 | wxButton* m_setupButton; |
58a33cb4 | 108 | // wxButton* m_helpButton; |
7bcb11d3 JS |
109 | wxRadioBox* m_rangeRadioBox; |
110 | wxTextCtrl* m_fromText; | |
111 | wxTextCtrl* m_toText; | |
112 | wxTextCtrl* m_noCopiesText; | |
113 | wxCheckBox* m_printToFileCheckBox; | |
58a33cb4 | 114 | // wxCheckBox* m_collateCopiesCheckBox; |
d6b9496a | 115 | |
7bcb11d3 | 116 | wxPrintDialogData m_printDialogData; |
d6b9496a VZ |
117 | |
118 | protected: | |
119 | void Init(wxWindow *parent); | |
120 | ||
121 | private: | |
7bcb11d3 | 122 | DECLARE_EVENT_TABLE() |
47dc9f78 | 123 | DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog) |
c801d85f KB |
124 | }; |
125 | ||
d6b9496a | 126 | class WXDLLEXPORT wxGenericPrintSetupDialog : public wxDialog |
c801d85f | 127 | { |
7bcb11d3 JS |
128 | public: |
129 | // There are no configuration options for the dialog, so we | |
130 | // just pass the wxPrintData object (no wxPrintSetupDialogData class needed) | |
131 | wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data); | |
132 | wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data); | |
d6b9496a | 133 | virtual ~wxGenericPrintSetupDialog(); |
7bcb11d3 JS |
134 | |
135 | void Init(wxPrintData* data); | |
136 | ||
137 | virtual bool TransferDataFromWindow(); | |
138 | virtual bool TransferDataToWindow(); | |
139 | ||
fa12f7e6 | 140 | wxComboBox *CreatePaperTypeChoice(int* x, int* y); |
d6b9496a | 141 | |
7bcb11d3 JS |
142 | public: |
143 | wxRadioBox* m_orientationRadioBox; | |
144 | wxTextCtrl* m_printerCommandText; | |
145 | wxTextCtrl* m_printerOptionsText; | |
146 | wxCheckBox* m_colourCheckBox; | |
fa12f7e6 | 147 | wxComboBox* m_paperTypeChoice; |
d6b9496a | 148 | |
5e9f4026 | 149 | #if wxUSE_POSTSCRIPT |
7bcb11d3 | 150 | wxPrintData m_printData; |
d6b9496a VZ |
151 | wxPrintData& GetPrintData() { return m_printData; } |
152 | #endif // wxUSE_POSTSCRIPT | |
47dc9f78 RR |
153 | |
154 | private: | |
155 | DECLARE_CLASS(wxGenericPrintSetupDialog) | |
c801d85f | 156 | }; |
25889d3c JS |
157 | #endif |
158 | // wxUSE_POSTSCRIPT | |
c801d85f | 159 | |
d6b9496a | 160 | class WXDLLEXPORT wxGenericPageSetupDialog : public wxDialog |
c801d85f | 161 | { |
7bcb11d3 | 162 | public: |
47494677 VZ |
163 | wxGenericPageSetupDialog(wxWindow *parent = NULL, |
164 | wxPageSetupData* data = NULL); | |
d6b9496a | 165 | virtual ~wxGenericPageSetupDialog(); |
7bcb11d3 JS |
166 | |
167 | virtual bool TransferDataFromWindow(); | |
168 | virtual bool TransferDataToWindow(); | |
169 | ||
170 | void OnPrinter(wxCommandEvent& event); | |
d6b9496a | 171 | |
fa12f7e6 | 172 | wxComboBox *CreatePaperTypeChoice(int* x, int* y); |
d6b9496a | 173 | wxPageSetupData& GetPageSetupData() { return m_pageData; } |
7bcb11d3 JS |
174 | |
175 | public: | |
176 | wxButton* m_printerButton; | |
177 | wxRadioBox* m_orientationRadioBox; | |
178 | wxTextCtrl* m_marginLeftText; | |
179 | wxTextCtrl* m_marginTopText; | |
180 | wxTextCtrl* m_marginRightText; | |
181 | wxTextCtrl* m_marginBottomText; | |
fa12f7e6 | 182 | wxComboBox* m_paperTypeChoice; |
d6b9496a | 183 | |
7bcb11d3 | 184 | static bool m_pageSetupDialogCancelled; |
d6b9496a | 185 | |
7bcb11d3 | 186 | wxPageSetupData m_pageData; |
d6b9496a VZ |
187 | |
188 | private: | |
7bcb11d3 | 189 | DECLARE_EVENT_TABLE() |
47494677 | 190 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericPageSetupDialog) |
c801d85f KB |
191 | }; |
192 | ||
ce4169a4 RR |
193 | #endif |
194 | ||
c801d85f | 195 | #endif |
7bcb11d3 | 196 | // __PRINTDLGH_G__ |