]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/prntdlgg.h
reverted Julian's unintentional breakage of wxChoice
[wxWidgets.git] / include / wx / generic / prntdlgg.h
CommitLineData
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"
ce4169a4
RR
21
22#if wxUSE_PRINTING_ARCHITECTURE
23
bf38cbff
JS
24#include "wx/dialog.h"
25
26#if wxUSE_POSTSCRIPT
d6b9496a 27 #include "wx/dcps.h"
bf38cbff 28#endif
c801d85f
KB
29
30class WXDLLEXPORT wxTextCtrl;
31class WXDLLEXPORT wxButton;
32class WXDLLEXPORT wxCheckBox;
fa12f7e6 33class WXDLLEXPORT wxComboBox;
c801d85f
KB
34class WXDLLEXPORT wxStaticText;
35class WXDLLEXPORT wxRadioBox;
5e9f4026 36class WXDLLEXPORT wxPrintSetupData;
c801d85f 37
d6b9496a
VZ
38// ----------------------------------------------------------------------------
39// constants
40// ----------------------------------------------------------------------------
c801d85f 41
d6b9496a 42// FIXME why all these enums start with 10 or 30?
c801d85f 43
d6b9496a
VZ
44enum
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
55enum
56{
57 wxPRINTID_LEFTMARGIN = 30,
58 wxPRINTID_RIGHTMARGIN,
59 wxPRINTID_TOPMARGIN,
60 wxPRINTID_BOTTOMMARGIN
61};
62
63enum
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
25889d3c 77#if wxUSE_POSTSCRIPT
d6b9496a 78class WXDLLEXPORT wxGenericPrintDialog : public wxDialog
c801d85f 79{
7bcb11d3 80 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
d6b9496a 81
7bcb11d3 82public:
d6b9496a
VZ
83 wxGenericPrintDialog(wxWindow *parent,
84 wxPrintDialogData* data = (wxPrintDialogData*)NULL);
85 wxGenericPrintDialog(wxWindow *parent, wxPrintData* data);
86
87 virtual ~wxGenericPrintDialog();
7bcb11d3
JS
88
89 void OnSetup(wxCommandEvent& event);
90 void OnRange(wxCommandEvent& event);
91 void OnOK(wxCommandEvent& event);
d6b9496a 92
7bcb11d3
JS
93 virtual bool TransferDataFromWindow();
94 virtual bool TransferDataToWindow();
95
96 virtual int ShowModal();
97
d6b9496a
VZ
98#if wxUSE_POSTSCRIPT
99 wxPrintData& GetPrintData()
100 { return m_printDialogData.GetPrintData(); }
101#endif // wxUSE_POSTSCRIPT
102
103 wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
7bcb11d3
JS
104 wxDC *GetPrintDC();
105
106public:
58a33cb4 107// wxStaticText* m_printerMessage;
7bcb11d3 108 wxButton* m_setupButton;
58a33cb4 109// wxButton* m_helpButton;
7bcb11d3
JS
110 wxRadioBox* m_rangeRadioBox;
111 wxTextCtrl* m_fromText;
112 wxTextCtrl* m_toText;
113 wxTextCtrl* m_noCopiesText;
114 wxCheckBox* m_printToFileCheckBox;
58a33cb4 115// wxCheckBox* m_collateCopiesCheckBox;
d6b9496a 116
7bcb11d3 117 wxPrintDialogData m_printDialogData;
d6b9496a
VZ
118
119protected:
120 void Init(wxWindow *parent);
121
122private:
7bcb11d3 123 DECLARE_EVENT_TABLE()
c801d85f
KB
124};
125
d6b9496a 126class WXDLLEXPORT wxGenericPrintSetupDialog : public wxDialog
c801d85f 127{
7bcb11d3 128 DECLARE_CLASS(wxGenericPrintSetupDialog)
d6b9496a 129
7bcb11d3
JS
130public:
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);
d6b9496a 135 virtual ~wxGenericPrintSetupDialog();
7bcb11d3
JS
136
137 void Init(wxPrintData* data);
138
139 virtual bool TransferDataFromWindow();
140 virtual bool TransferDataToWindow();
141
fa12f7e6 142 wxComboBox *CreatePaperTypeChoice(int* x, int* y);
d6b9496a 143
7bcb11d3
JS
144public:
145 wxRadioBox* m_orientationRadioBox;
146 wxTextCtrl* m_printerCommandText;
147 wxTextCtrl* m_printerOptionsText;
148 wxCheckBox* m_colourCheckBox;
fa12f7e6 149 wxComboBox* m_paperTypeChoice;
d6b9496a 150
5e9f4026 151#if wxUSE_POSTSCRIPT
7bcb11d3 152 wxPrintData m_printData;
d6b9496a
VZ
153 wxPrintData& GetPrintData() { return m_printData; }
154#endif // wxUSE_POSTSCRIPT
c801d85f 155};
25889d3c
JS
156#endif
157 // wxUSE_POSTSCRIPT
c801d85f 158
d6b9496a 159class WXDLLEXPORT wxGenericPageSetupDialog : public wxDialog
c801d85f 160{
7bcb11d3 161 DECLARE_CLASS(wxGenericPageSetupDialog)
d6b9496a 162
7bcb11d3
JS
163public:
164 wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data = (wxPageSetupData*) NULL);
d6b9496a 165 virtual ~wxGenericPageSetupDialog();
7bcb11d3
JS
166
167 virtual bool TransferDataFromWindow();
168 virtual bool TransferDataToWindow();
169
170 void OnPrinter(wxCommandEvent& event);
d6b9496a 171
fa12f7e6 172 wxComboBox *CreatePaperTypeChoice(int* x, int* y);
d6b9496a 173 wxPageSetupData& GetPageSetupData() { return m_pageData; }
7bcb11d3
JS
174
175public:
176 wxButton* m_printerButton;
177 wxRadioBox* m_orientationRadioBox;
178 wxTextCtrl* m_marginLeftText;
179 wxTextCtrl* m_marginTopText;
180 wxTextCtrl* m_marginRightText;
181 wxTextCtrl* m_marginBottomText;
fa12f7e6 182 wxComboBox* m_paperTypeChoice;
d6b9496a 183
7bcb11d3 184 static bool m_pageSetupDialogCancelled;
d6b9496a 185
7bcb11d3 186 wxPageSetupData m_pageData;
d6b9496a
VZ
187
188private:
7bcb11d3 189 DECLARE_EVENT_TABLE()
c801d85f
KB
190};
191
ce4169a4
RR
192#endif
193
c801d85f 194#endif
7bcb11d3 195// __PRINTDLGH_G__