]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/prntdlgg.h
use common code to determine best notebook size instaed of Mac-specific which mistake...
[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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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/cmndata.h"
26 #include "wx/printdlg.h"
27
28 #if wxUSE_POSTSCRIPT
29 #include "wx/dcps.h"
30 #endif
31
32 class WXDLLEXPORT wxTextCtrl;
33 class WXDLLEXPORT wxButton;
34 class WXDLLEXPORT wxCheckBox;
35 class WXDLLEXPORT wxComboBox;
36 class WXDLLEXPORT wxStaticText;
37 class WXDLLEXPORT wxRadioBox;
38 class WXDLLEXPORT wxPrintSetupData;
39 class WXDLLEXPORT wxPageSetupData;
40 // ----------------------------------------------------------------------------
41 // constants
42 // ----------------------------------------------------------------------------
43
44 // FIXME why all these enums start with 10 or 30?
45
46 enum
47 {
48 wxPRINTID_STATIC = 10,
49 wxPRINTID_RANGE,
50 wxPRINTID_FROM,
51 wxPRINTID_TO,
52 wxPRINTID_COPIES,
53 wxPRINTID_PRINTTOFILE,
54 wxPRINTID_SETUP
55 };
56
57 enum
58 {
59 wxPRINTID_LEFTMARGIN = 30,
60 wxPRINTID_RIGHTMARGIN,
61 wxPRINTID_TOPMARGIN,
62 wxPRINTID_BOTTOMMARGIN
63 };
64
65 enum
66 {
67 wxPRINTID_PRINTCOLOUR = 10,
68 wxPRINTID_ORIENTATION,
69 wxPRINTID_COMMAND,
70 wxPRINTID_OPTIONS,
71 wxPRINTID_PAPERSIZE
72 };
73
74 // ----------------------------------------------------------------------------
75 // Simulated Print and Print Setup dialogs for non-Windows platforms (and
76 // Windows using PostScript print/preview)
77 // ----------------------------------------------------------------------------
78
79 #if wxUSE_POSTSCRIPT
80 class WXDLLEXPORT wxGenericPrintDialog : public wxPrintDialogBase
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 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
125 };
126
127 class WXDLLEXPORT wxGenericPrintSetupDialog : public wxDialog
128 {
129 public:
130 // There are no configuration options for the dialog, so we
131 // just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
132 wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data);
133 wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data);
134 virtual ~wxGenericPrintSetupDialog();
135
136 void Init(wxPrintData* data);
137
138 virtual bool TransferDataFromWindow();
139 virtual bool TransferDataToWindow();
140
141 wxComboBox *CreatePaperTypeChoice(int* x, int* y);
142
143 public:
144 wxRadioBox* m_orientationRadioBox;
145 wxTextCtrl* m_printerCommandText;
146 wxTextCtrl* m_printerOptionsText;
147 wxCheckBox* m_colourCheckBox;
148 wxComboBox* m_paperTypeChoice;
149
150 #if wxUSE_POSTSCRIPT
151 wxPrintData m_printData;
152 wxPrintData& GetPrintData() { return m_printData; }
153 #endif // wxUSE_POSTSCRIPT
154
155 private:
156 DECLARE_CLASS(wxGenericPrintSetupDialog)
157 };
158 #endif
159 // wxUSE_POSTSCRIPT
160
161 class WXDLLEXPORT wxGenericPageSetupDialog : public wxDialog
162 {
163 public:
164 wxGenericPageSetupDialog(wxWindow *parent = NULL,
165 wxPageSetupData* data = 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 DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericPageSetupDialog)
192 };
193
194 #endif
195
196 #endif
197 // __PRINTDLGH_G__