]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/prntdlgg.h
fix for wxFrame parent which somehow wasn't committed yesterday
[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
22 #if wxUSE_PRINTING_ARCHITECTURE
23
24 #include "wx/dialog.h"
25 #include "wx/dialog.h"
26
27 #if wxUSE_POSTSCRIPT
28 #include "wx/dcps.h"
29 #endif
30
31 class WXDLLEXPORT wxTextCtrl;
32 class WXDLLEXPORT wxButton;
33 class WXDLLEXPORT wxCheckBox;
34 class WXDLLEXPORT wxComboBox;
35 class WXDLLEXPORT wxStaticText;
36 class WXDLLEXPORT wxRadioBox;
37 class WXDLLEXPORT wxPrintSetupData;
38
39 // ----------------------------------------------------------------------------
40 // constants
41 // ----------------------------------------------------------------------------
42
43 // FIXME why all these enums start with 10 or 30?
44
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
78 #if wxUSE_POSTSCRIPT
79 class WXDLLEXPORT wxGenericPrintDialog : public wxDialog
80 {
81 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
82
83 public:
84 wxGenericPrintDialog(wxWindow *parent,
85 wxPrintDialogData* data = (wxPrintDialogData*)NULL);
86 wxGenericPrintDialog(wxWindow *parent, wxPrintData* data);
87
88 virtual ~wxGenericPrintDialog();
89
90 void OnSetup(wxCommandEvent& event);
91 void OnRange(wxCommandEvent& event);
92 void OnOK(wxCommandEvent& event);
93
94 virtual bool TransferDataFromWindow();
95 virtual bool TransferDataToWindow();
96
97 virtual int ShowModal();
98
99 #if wxUSE_POSTSCRIPT
100 wxPrintData& GetPrintData()
101 { return m_printDialogData.GetPrintData(); }
102 #endif // wxUSE_POSTSCRIPT
103
104 wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
105 wxDC *GetPrintDC();
106
107 public:
108 // wxStaticText* m_printerMessage;
109 wxButton* m_setupButton;
110 // wxButton* m_helpButton;
111 wxRadioBox* m_rangeRadioBox;
112 wxTextCtrl* m_fromText;
113 wxTextCtrl* m_toText;
114 wxTextCtrl* m_noCopiesText;
115 wxCheckBox* m_printToFileCheckBox;
116 // wxCheckBox* m_collateCopiesCheckBox;
117
118 wxPrintDialogData m_printDialogData;
119
120 protected:
121 void Init(wxWindow *parent);
122
123 private:
124 DECLARE_EVENT_TABLE()
125 };
126
127 class WXDLLEXPORT wxGenericPrintSetupDialog : public wxDialog
128 {
129 DECLARE_CLASS(wxGenericPrintSetupDialog)
130
131 public:
132 // There are no configuration options for the dialog, so we
133 // just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
134 wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data);
135 wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data);
136 virtual ~wxGenericPrintSetupDialog();
137
138 void Init(wxPrintData* data);
139
140 virtual bool TransferDataFromWindow();
141 virtual bool TransferDataToWindow();
142
143 wxComboBox *CreatePaperTypeChoice(int* x, int* y);
144
145 public:
146 wxRadioBox* m_orientationRadioBox;
147 wxTextCtrl* m_printerCommandText;
148 wxTextCtrl* m_printerOptionsText;
149 wxCheckBox* m_colourCheckBox;
150 wxComboBox* m_paperTypeChoice;
151
152 #if wxUSE_POSTSCRIPT
153 wxPrintData m_printData;
154 wxPrintData& GetPrintData() { return m_printData; }
155 #endif // wxUSE_POSTSCRIPT
156 };
157 #endif
158 // wxUSE_POSTSCRIPT
159
160 class WXDLLEXPORT wxGenericPageSetupDialog : public wxDialog
161 {
162 DECLARE_CLASS(wxGenericPageSetupDialog)
163
164 public:
165 wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data = (wxPageSetupData*) NULL);
166 virtual ~wxGenericPageSetupDialog();
167
168 virtual bool TransferDataFromWindow();
169 virtual bool TransferDataToWindow();
170
171 void OnPrinter(wxCommandEvent& event);
172
173 wxComboBox *CreatePaperTypeChoice(int* x, int* y);
174 wxPageSetupData& GetPageSetupData() { return m_pageData; }
175
176 public:
177 wxButton* m_printerButton;
178 wxRadioBox* m_orientationRadioBox;
179 wxTextCtrl* m_marginLeftText;
180 wxTextCtrl* m_marginTopText;
181 wxTextCtrl* m_marginRightText;
182 wxTextCtrl* m_marginBottomText;
183 wxComboBox* m_paperTypeChoice;
184
185 static bool m_pageSetupDialogCancelled;
186
187 wxPageSetupData m_pageData;
188
189 private:
190 DECLARE_EVENT_TABLE()
191 };
192
193 #endif
194
195 #endif
196 // __PRINTDLGH_G__