]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/prntdlgg.h
Implemented ListCtrl::SetColumnWidth() wxLIST_AUTOSIZE
[wxWidgets.git] / include / wx / generic / prntdlgg.h
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 #include "wx/dialog.h"
22 #include "wx/dialog.h"
23
24 #if wxUSE_POSTSCRIPT
25 #include "wx/dcps.h"
26 #endif
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;
34 class WXDLLEXPORT wxPrintSetupData;
35
36 // ----------------------------------------------------------------------------
37 // constants
38 // ----------------------------------------------------------------------------
39
40 // FIXME why all these enums start with 10 or 30?
41
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
75 #if wxUSE_POSTSCRIPT
76 class WXDLLEXPORT wxGenericPrintDialog : public wxDialog
77 {
78 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
79
80 public:
81 wxGenericPrintDialog(wxWindow *parent,
82 wxPrintDialogData* data = (wxPrintDialogData*)NULL);
83 wxGenericPrintDialog(wxWindow *parent, wxPrintData* data);
84
85 virtual ~wxGenericPrintDialog();
86
87 void OnSetup(wxCommandEvent& event);
88 void OnRange(wxCommandEvent& event);
89 void OnOK(wxCommandEvent& event);
90
91 virtual bool TransferDataFromWindow();
92 virtual bool TransferDataToWindow();
93
94 virtual int ShowModal();
95
96 #if wxUSE_POSTSCRIPT
97 wxPrintData& GetPrintData()
98 { return m_printDialogData.GetPrintData(); }
99 #endif // wxUSE_POSTSCRIPT
100
101 wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
102 wxDC *GetPrintDC();
103
104 public:
105 // wxStaticText* m_printerMessage;
106 wxButton* m_setupButton;
107 // wxButton* m_helpButton;
108 wxRadioBox* m_rangeRadioBox;
109 wxTextCtrl* m_fromText;
110 wxTextCtrl* m_toText;
111 wxTextCtrl* m_noCopiesText;
112 wxCheckBox* m_printToFileCheckBox;
113 // wxCheckBox* m_collateCopiesCheckBox;
114
115 wxPrintDialogData m_printDialogData;
116
117 protected:
118 void Init(wxWindow *parent);
119
120 private:
121 DECLARE_EVENT_TABLE()
122 };
123
124 class WXDLLEXPORT wxGenericPrintSetupDialog : public wxDialog
125 {
126 DECLARE_CLASS(wxGenericPrintSetupDialog)
127
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);
133 virtual ~wxGenericPrintSetupDialog();
134
135 void Init(wxPrintData* data);
136
137 virtual bool TransferDataFromWindow();
138 virtual bool TransferDataToWindow();
139
140 wxChoice *CreatePaperTypeChoice(int* x, int* y);
141
142 public:
143 wxRadioBox* m_orientationRadioBox;
144 wxTextCtrl* m_printerCommandText;
145 wxTextCtrl* m_printerOptionsText;
146 wxCheckBox* m_colourCheckBox;
147 wxChoice* m_paperTypeChoice;
148
149 #if wxUSE_POSTSCRIPT
150 wxPrintData m_printData;
151 wxPrintData& GetPrintData() { return m_printData; }
152 #endif // wxUSE_POSTSCRIPT
153 };
154 #endif
155 // wxUSE_POSTSCRIPT
156
157 class WXDLLEXPORT wxGenericPageSetupDialog : public wxDialog
158 {
159 DECLARE_CLASS(wxGenericPageSetupDialog)
160
161 public:
162 wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data = (wxPageSetupData*) NULL);
163 virtual ~wxGenericPageSetupDialog();
164
165 virtual bool TransferDataFromWindow();
166 virtual bool TransferDataToWindow();
167
168 void OnPrinter(wxCommandEvent& event);
169
170 wxChoice *CreatePaperTypeChoice(int* x, int* y);
171 wxPageSetupData& GetPageSetupData() { return m_pageData; }
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;
181
182 static bool m_pageSetupDialogCancelled;
183
184 wxPageSetupData m_pageData;
185
186 private:
187 DECLARE_EVENT_TABLE()
188 };
189
190 #endif
191 // __PRINTDLGH_G__