]>
Commit | Line | Data |
---|---|---|
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) | |
10 | // Licence: wxWindows licence | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | #ifndef __PRINTDLGH_G_ | |
14 | #define __PRINTDLGH_G_ | |
15 | ||
16 | #ifdef __GNUG__ | |
17 | #pragma interface "prntdlgg.h" | |
18 | #endif | |
19 | ||
20 | #include "wx/defs.h" | |
21 | ||
22 | #if wxUSE_PRINTING_ARCHITECTURE | |
23 | ||
24 | #include "wx/dialog.h" | |
25 | ||
26 | #if wxUSE_POSTSCRIPT | |
27 | #include "wx/dcps.h" | |
28 | #endif | |
29 | ||
30 | class WXDLLEXPORT wxTextCtrl; | |
31 | class WXDLLEXPORT wxButton; | |
32 | class WXDLLEXPORT wxCheckBox; | |
33 | class WXDLLEXPORT wxComboBox; | |
34 | class WXDLLEXPORT wxStaticText; | |
35 | class WXDLLEXPORT wxRadioBox; | |
36 | class WXDLLEXPORT wxPrintSetupData; | |
37 | ||
38 | // ---------------------------------------------------------------------------- | |
39 | // constants | |
40 | // ---------------------------------------------------------------------------- | |
41 | ||
42 | // FIXME why all these enums start with 10 or 30? | |
43 | ||
44 | enum | |
45 | { | |
46 | wxPRINTID_STATIC = 10, | |
47 | wxPRINTID_RANGE, | |
48 | wxPRINTID_FROM, | |
49 | wxPRINTID_TO, | |
50 | wxPRINTID_COPIES, | |
51 | wxPRINTID_PRINTTOFILE, | |
52 | wxPRINTID_SETUP | |
53 | }; | |
54 | ||
55 | enum | |
56 | { | |
57 | wxPRINTID_LEFTMARGIN = 30, | |
58 | wxPRINTID_RIGHTMARGIN, | |
59 | wxPRINTID_TOPMARGIN, | |
60 | wxPRINTID_BOTTOMMARGIN | |
61 | }; | |
62 | ||
63 | enum | |
64 | { | |
65 | wxPRINTID_PRINTCOLOUR = 10, | |
66 | wxPRINTID_ORIENTATION, | |
67 | wxPRINTID_COMMAND, | |
68 | wxPRINTID_OPTIONS, | |
69 | wxPRINTID_PAPERSIZE | |
70 | }; | |
71 | ||
72 | // ---------------------------------------------------------------------------- | |
73 | // Simulated Print and Print Setup dialogs for non-Windows platforms (and | |
74 | // Windows using PostScript print/preview) | |
75 | // ---------------------------------------------------------------------------- | |
76 | ||
77 | #if wxUSE_POSTSCRIPT | |
78 | class WXDLLEXPORT wxGenericPrintDialog : public wxDialog | |
79 | { | |
80 | DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog) | |
81 | ||
82 | public: | |
83 | wxGenericPrintDialog(wxWindow *parent, | |
84 | wxPrintDialogData* data = (wxPrintDialogData*)NULL); | |
85 | wxGenericPrintDialog(wxWindow *parent, wxPrintData* data); | |
86 | ||
87 | virtual ~wxGenericPrintDialog(); | |
88 | ||
89 | void OnSetup(wxCommandEvent& event); | |
90 | void OnRange(wxCommandEvent& event); | |
91 | void OnOK(wxCommandEvent& event); | |
92 | ||
93 | virtual bool TransferDataFromWindow(); | |
94 | virtual bool TransferDataToWindow(); | |
95 | ||
96 | virtual int ShowModal(); | |
97 | ||
98 | #if wxUSE_POSTSCRIPT | |
99 | wxPrintData& GetPrintData() | |
100 | { return m_printDialogData.GetPrintData(); } | |
101 | #endif // wxUSE_POSTSCRIPT | |
102 | ||
103 | wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; } | |
104 | wxDC *GetPrintDC(); | |
105 | ||
106 | public: | |
107 | // wxStaticText* m_printerMessage; | |
108 | wxButton* m_setupButton; | |
109 | // wxButton* m_helpButton; | |
110 | wxRadioBox* m_rangeRadioBox; | |
111 | wxTextCtrl* m_fromText; | |
112 | wxTextCtrl* m_toText; | |
113 | wxTextCtrl* m_noCopiesText; | |
114 | wxCheckBox* m_printToFileCheckBox; | |
115 | // wxCheckBox* m_collateCopiesCheckBox; | |
116 | ||
117 | wxPrintDialogData m_printDialogData; | |
118 | ||
119 | protected: | |
120 | void Init(wxWindow *parent); | |
121 | ||
122 | private: | |
123 | DECLARE_EVENT_TABLE() | |
124 | }; | |
125 | ||
126 | class WXDLLEXPORT wxGenericPrintSetupDialog : public wxDialog | |
127 | { | |
128 | DECLARE_CLASS(wxGenericPrintSetupDialog) | |
129 | ||
130 | public: | |
131 | // There are no configuration options for the dialog, so we | |
132 | // just pass the wxPrintData object (no wxPrintSetupDialogData class needed) | |
133 | wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data); | |
134 | wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data); | |
135 | virtual ~wxGenericPrintSetupDialog(); | |
136 | ||
137 | void Init(wxPrintData* data); | |
138 | ||
139 | virtual bool TransferDataFromWindow(); | |
140 | virtual bool TransferDataToWindow(); | |
141 | ||
142 | wxComboBox *CreatePaperTypeChoice(int* x, int* y); | |
143 | ||
144 | public: | |
145 | wxRadioBox* m_orientationRadioBox; | |
146 | wxTextCtrl* m_printerCommandText; | |
147 | wxTextCtrl* m_printerOptionsText; | |
148 | wxCheckBox* m_colourCheckBox; | |
149 | wxComboBox* m_paperTypeChoice; | |
150 | ||
151 | #if wxUSE_POSTSCRIPT | |
152 | wxPrintData m_printData; | |
153 | wxPrintData& GetPrintData() { return m_printData; } | |
154 | #endif // wxUSE_POSTSCRIPT | |
155 | }; | |
156 | #endif | |
157 | // wxUSE_POSTSCRIPT | |
158 | ||
159 | class WXDLLEXPORT wxGenericPageSetupDialog : public wxDialog | |
160 | { | |
161 | DECLARE_CLASS(wxGenericPageSetupDialog) | |
162 | ||
163 | public: | |
164 | wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data = (wxPageSetupData*) NULL); | |
165 | virtual ~wxGenericPageSetupDialog(); | |
166 | ||
167 | virtual bool TransferDataFromWindow(); | |
168 | virtual bool TransferDataToWindow(); | |
169 | ||
170 | void OnPrinter(wxCommandEvent& event); | |
171 | ||
172 | wxComboBox *CreatePaperTypeChoice(int* x, int* y); | |
173 | wxPageSetupData& GetPageSetupData() { return m_pageData; } | |
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; | |
182 | wxComboBox* m_paperTypeChoice; | |
183 | ||
184 | static bool m_pageSetupDialogCancelled; | |
185 | ||
186 | wxPageSetupData m_pageData; | |
187 | ||
188 | private: | |
189 | DECLARE_EVENT_TABLE() | |
190 | }; | |
191 | ||
192 | #endif | |
193 | ||
194 | #endif | |
195 | // __PRINTDLGH_G__ |