]>
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 | ||
16 | #ifdef __GNUG__ | |
d6b9496a | 17 | #pragma interface "prntdlgg.h" |
c801d85f KB |
18 | #endif |
19 | ||
20 | #include "wx/defs.h" | |
21 | #include "wx/dialog.h" | |
bf38cbff JS |
22 | #include "wx/dialog.h" |
23 | ||
24 | #if wxUSE_POSTSCRIPT | |
d6b9496a | 25 | #include "wx/dcps.h" |
bf38cbff | 26 | #endif |
c801d85f KB |
27 | |
28 | class WXDLLEXPORT wxTextCtrl; | |
29 | class WXDLLEXPORT wxButton; | |
30 | class WXDLLEXPORT wxCheckBox; | |
31 | class WXDLLEXPORT wxChoice; | |
32 | class WXDLLEXPORT wxStaticText; | |
33 | class WXDLLEXPORT wxRadioBox; | |
5e9f4026 | 34 | class WXDLLEXPORT wxPrintSetupData; |
c801d85f | 35 | |
d6b9496a VZ |
36 | // ---------------------------------------------------------------------------- |
37 | // constants | |
38 | // ---------------------------------------------------------------------------- | |
c801d85f | 39 | |
d6b9496a | 40 | // FIXME why all these enums start with 10 or 30? |
c801d85f | 41 | |
d6b9496a VZ |
42 | enum |
43 | { | |
44 | wxPRINTID_STATIC = 10, | |
45 | wxPRINTID_RANGE, | |
46 | wxPRINTID_FROM, | |
47 | wxPRINTID_TO, | |
48 | wxPRINTID_COPIES, | |
49 | wxPRINTID_PRINTTOFILE, | |
50 | wxPRINTID_SETUP | |
51 | }; | |
52 | ||
53 | enum | |
54 | { | |
55 | wxPRINTID_LEFTMARGIN = 30, | |
56 | wxPRINTID_RIGHTMARGIN, | |
57 | wxPRINTID_TOPMARGIN, | |
58 | wxPRINTID_BOTTOMMARGIN | |
59 | }; | |
60 | ||
61 | enum | |
62 | { | |
63 | wxPRINTID_PRINTCOLOUR = 10, | |
64 | wxPRINTID_ORIENTATION, | |
65 | wxPRINTID_COMMAND, | |
66 | wxPRINTID_OPTIONS, | |
67 | wxPRINTID_PAPERSIZE | |
68 | }; | |
69 | ||
70 | // ---------------------------------------------------------------------------- | |
71 | // Simulated Print and Print Setup dialogs for non-Windows platforms (and | |
72 | // Windows using PostScript print/preview) | |
73 | // ---------------------------------------------------------------------------- | |
74 | ||
25889d3c | 75 | #if wxUSE_POSTSCRIPT |
d6b9496a | 76 | class WXDLLEXPORT wxGenericPrintDialog : public wxDialog |
c801d85f | 77 | { |
7bcb11d3 | 78 | DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog) |
d6b9496a | 79 | |
7bcb11d3 | 80 | public: |
d6b9496a VZ |
81 | wxGenericPrintDialog(wxWindow *parent, |
82 | wxPrintDialogData* data = (wxPrintDialogData*)NULL); | |
83 | wxGenericPrintDialog(wxWindow *parent, wxPrintData* data); | |
84 | ||
85 | virtual ~wxGenericPrintDialog(); | |
7bcb11d3 JS |
86 | |
87 | void OnSetup(wxCommandEvent& event); | |
88 | void OnRange(wxCommandEvent& event); | |
89 | void OnOK(wxCommandEvent& event); | |
d6b9496a | 90 | |
7bcb11d3 JS |
91 | virtual bool TransferDataFromWindow(); |
92 | virtual bool TransferDataToWindow(); | |
93 | ||
94 | virtual int ShowModal(); | |
95 | ||
d6b9496a VZ |
96 | #if wxUSE_POSTSCRIPT |
97 | wxPrintData& GetPrintData() | |
98 | { return m_printDialogData.GetPrintData(); } | |
99 | #endif // wxUSE_POSTSCRIPT | |
100 | ||
101 | wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; } | |
7bcb11d3 JS |
102 | wxDC *GetPrintDC(); |
103 | ||
104 | public: | |
58a33cb4 | 105 | // wxStaticText* m_printerMessage; |
7bcb11d3 | 106 | wxButton* m_setupButton; |
58a33cb4 | 107 | // wxButton* m_helpButton; |
7bcb11d3 JS |
108 | wxRadioBox* m_rangeRadioBox; |
109 | wxTextCtrl* m_fromText; | |
110 | wxTextCtrl* m_toText; | |
111 | wxTextCtrl* m_noCopiesText; | |
112 | wxCheckBox* m_printToFileCheckBox; | |
58a33cb4 | 113 | // wxCheckBox* m_collateCopiesCheckBox; |
d6b9496a | 114 | |
7bcb11d3 | 115 | wxPrintDialogData m_printDialogData; |
d6b9496a VZ |
116 | |
117 | protected: | |
118 | void Init(wxWindow *parent); | |
119 | ||
120 | private: | |
7bcb11d3 | 121 | DECLARE_EVENT_TABLE() |
c801d85f KB |
122 | }; |
123 | ||
d6b9496a | 124 | class WXDLLEXPORT wxGenericPrintSetupDialog : public wxDialog |
c801d85f | 125 | { |
7bcb11d3 | 126 | DECLARE_CLASS(wxGenericPrintSetupDialog) |
d6b9496a | 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 | ||
140 | wxChoice *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; | |
147 | wxChoice* 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 | |
c801d85f | 153 | }; |
25889d3c JS |
154 | #endif |
155 | // wxUSE_POSTSCRIPT | |
c801d85f | 156 | |
d6b9496a | 157 | class WXDLLEXPORT wxGenericPageSetupDialog : public wxDialog |
c801d85f | 158 | { |
7bcb11d3 | 159 | DECLARE_CLASS(wxGenericPageSetupDialog) |
d6b9496a | 160 | |
7bcb11d3 JS |
161 | public: |
162 | wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data = (wxPageSetupData*) NULL); | |
d6b9496a | 163 | virtual ~wxGenericPageSetupDialog(); |
7bcb11d3 JS |
164 | |
165 | virtual bool TransferDataFromWindow(); | |
166 | virtual bool TransferDataToWindow(); | |
167 | ||
168 | void OnPrinter(wxCommandEvent& event); | |
d6b9496a | 169 | |
7bcb11d3 | 170 | wxChoice *CreatePaperTypeChoice(int* x, int* y); |
d6b9496a | 171 | wxPageSetupData& GetPageSetupData() { return m_pageData; } |
7bcb11d3 JS |
172 | |
173 | public: | |
174 | wxButton* m_printerButton; | |
175 | wxRadioBox* m_orientationRadioBox; | |
176 | wxTextCtrl* m_marginLeftText; | |
177 | wxTextCtrl* m_marginTopText; | |
178 | wxTextCtrl* m_marginRightText; | |
179 | wxTextCtrl* m_marginBottomText; | |
180 | wxChoice* m_paperTypeChoice; | |
d6b9496a | 181 | |
7bcb11d3 | 182 | static bool m_pageSetupDialogCancelled; |
d6b9496a | 183 | |
7bcb11d3 | 184 | wxPageSetupData m_pageData; |
d6b9496a VZ |
185 | |
186 | private: | |
7bcb11d3 | 187 | DECLARE_EVENT_TABLE() |
c801d85f KB |
188 | }; |
189 | ||
190 | #endif | |
7bcb11d3 | 191 | // __PRINTDLGH_G__ |