]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/prntdlgg.h
Added wxPROPSHEET_TREEBOOK option
[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$
99d80019 9// Copyright: (c) Julian Smart
65571936 10// Licence: wxWindows licence
c801d85f
KB
11/////////////////////////////////////////////////////////////////////////////
12
13#ifndef __PRINTDLGH_G_
14#define __PRINTDLGH_G_
15
c801d85f 16#include "wx/defs.h"
ce4169a4
RR
17
18#if wxUSE_PRINTING_ARCHITECTURE
19
bf38cbff 20#include "wx/dialog.h"
d7a7bd6d 21#include "wx/cmndata.h"
8850cbd3 22#include "wx/prntbase.h"
c061373d 23#include "wx/printdlg.h"
2c84e0c2 24#include "wx/listctrl.h"
bf38cbff
JS
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;
43330cc9 36class WXDLLEXPORT wxPageSetupData;
8850cbd3 37
d6b9496a
VZ
38// ----------------------------------------------------------------------------
39// constants
40// ----------------------------------------------------------------------------
c801d85f 41
5c750f94
WS
42// This is not clear why all these enums start with 10 or 30 but do not change it
43// without good reason to avoid some subtle backwards compatibility breakage
c801d85f 44
d6b9496a
VZ
45enum
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
56enum
57{
58 wxPRINTID_LEFTMARGIN = 30,
59 wxPRINTID_RIGHTMARGIN,
60 wxPRINTID_TOPMARGIN,
61 wxPRINTID_BOTTOMMARGIN
62};
63
64enum
65{
66 wxPRINTID_PRINTCOLOUR = 10,
67 wxPRINTID_ORIENTATION,
68 wxPRINTID_COMMAND,
69 wxPRINTID_OPTIONS,
2c84e0c2
RR
70 wxPRINTID_PAPERSIZE,
71 wxPRINTID_PRINTER
d6b9496a
VZ
72};
73
8850cbd3
RR
74#if wxUSE_POSTSCRIPT
75
76//----------------------------------------------------------------------------
77// wxPostScriptNativeData
78//----------------------------------------------------------------------------
79
80class WXDLLEXPORT wxPostScriptPrintNativeData: public wxPrintNativeDataBase
81{
82public:
83 wxPostScriptPrintNativeData();
84 virtual ~wxPostScriptPrintNativeData();
5c750f94 85
fd64de59
RR
86 virtual bool TransferTo( wxPrintData &data );
87 virtual bool TransferFrom( const wxPrintData &data );
5c750f94 88
8850cbd3 89 virtual bool Ok() const { return true; }
5c750f94 90
8850cbd3
RR
91 const wxString& GetPrinterCommand() const { return m_printerCommand; }
92 const wxString& GetPrinterOptions() const { return m_printerOptions; }
93 const wxString& GetPreviewCommand() const { return m_previewCommand; }
94 const wxString& GetFontMetricPath() const { return m_afmPath; }
95 double GetPrinterScaleX() const { return m_printerScaleX; }
96 double GetPrinterScaleY() const { return m_printerScaleY; }
97 long GetPrinterTranslateX() const { return m_printerTranslateX; }
98 long GetPrinterTranslateY() const { return m_printerTranslateY; }
8850cbd3
RR
99
100 void SetPrinterCommand(const wxString& command) { m_printerCommand = command; }
101 void SetPrinterOptions(const wxString& options) { m_printerOptions = options; }
102 void SetPreviewCommand(const wxString& command) { m_previewCommand = command; }
103 void SetFontMetricPath(const wxString& path) { m_afmPath = path; }
104 void SetPrinterScaleX(double x) { m_printerScaleX = x; }
105 void SetPrinterScaleY(double y) { m_printerScaleY = y; }
106 void SetPrinterScaling(double x, double y) { m_printerScaleX = x; m_printerScaleY = y; }
107 void SetPrinterTranslateX(long x) { m_printerTranslateX = x; }
108 void SetPrinterTranslateY(long y) { m_printerTranslateY = y; }
109 void SetPrinterTranslation(long x, long y) { m_printerTranslateX = x; m_printerTranslateY = y; }
8850cbd3
RR
110
111#if wxUSE_STREAMS
112 wxOutputStream *GetOutputStream() { return m_outputStream; }
113 void SetOutputStream( wxOutputStream *output ) { m_outputStream = output; }
114#endif
115
116private:
117 wxString m_printerCommand;
118 wxString m_previewCommand;
119 wxString m_printerOptions;
120 wxString m_afmPath;
121 double m_printerScaleX;
122 double m_printerScaleY;
123 long m_printerTranslateX;
124 long m_printerTranslateY;
8850cbd3
RR
125#if wxUSE_STREAMS
126 wxOutputStream *m_outputStream;
127#endif
5c750f94 128
8850cbd3
RR
129private:
130 DECLARE_DYNAMIC_CLASS(wxPostScriptPrintNativeData)
131};
5c750f94 132
d6b9496a
VZ
133// ----------------------------------------------------------------------------
134// Simulated Print and Print Setup dialogs for non-Windows platforms (and
135// Windows using PostScript print/preview)
136// ----------------------------------------------------------------------------
137
c061373d 138class WXDLLEXPORT wxGenericPrintDialog : public wxPrintDialogBase
c801d85f 139{
7bcb11d3 140public:
d6b9496a
VZ
141 wxGenericPrintDialog(wxWindow *parent,
142 wxPrintDialogData* data = (wxPrintDialogData*)NULL);
143 wxGenericPrintDialog(wxWindow *parent, wxPrintData* data);
144
145 virtual ~wxGenericPrintDialog();
7bcb11d3
JS
146
147 void OnSetup(wxCommandEvent& event);
148 void OnRange(wxCommandEvent& event);
149 void OnOK(wxCommandEvent& event);
d6b9496a 150
7bcb11d3
JS
151 virtual bool TransferDataFromWindow();
152 virtual bool TransferDataToWindow();
153
154 virtual int ShowModal();
155
d6b9496a
VZ
156 wxPrintData& GetPrintData()
157 { return m_printDialogData.GetPrintData(); }
d6b9496a
VZ
158
159 wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
7bcb11d3
JS
160 wxDC *GetPrintDC();
161
162public:
58a33cb4 163// wxStaticText* m_printerMessage;
7bcb11d3 164 wxButton* m_setupButton;
58a33cb4 165// wxButton* m_helpButton;
7bcb11d3
JS
166 wxRadioBox* m_rangeRadioBox;
167 wxTextCtrl* m_fromText;
168 wxTextCtrl* m_toText;
169 wxTextCtrl* m_noCopiesText;
170 wxCheckBox* m_printToFileCheckBox;
58a33cb4 171// wxCheckBox* m_collateCopiesCheckBox;
d6b9496a 172
7bcb11d3 173 wxPrintDialogData m_printDialogData;
d6b9496a
VZ
174
175protected:
176 void Init(wxWindow *parent);
177
178private:
7bcb11d3 179 DECLARE_EVENT_TABLE()
47dc9f78 180 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
c801d85f
KB
181};
182
d6b9496a 183class WXDLLEXPORT wxGenericPrintSetupDialog : public wxDialog
c801d85f 184{
7bcb11d3
JS
185public:
186 // There are no configuration options for the dialog, so we
187 // just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
188 wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data);
d6b9496a 189 virtual ~wxGenericPrintSetupDialog();
7bcb11d3
JS
190
191 void Init(wxPrintData* data);
192
2c84e0c2 193 void OnPrinter(wxListEvent& event);
5c750f94 194
7bcb11d3
JS
195 virtual bool TransferDataFromWindow();
196 virtual bool TransferDataToWindow();
197
6038ec8e 198 virtual wxComboBox *CreatePaperTypeChoice();
d6b9496a 199
7bcb11d3 200public:
2c84e0c2 201 wxListCtrl* m_printerListCtrl;
7bcb11d3
JS
202 wxRadioBox* m_orientationRadioBox;
203 wxTextCtrl* m_printerCommandText;
204 wxTextCtrl* m_printerOptionsText;
205 wxCheckBox* m_colourCheckBox;
2c84e0c2 206 wxComboBox* m_paperTypeChoice;
d6b9496a 207
7bcb11d3 208 wxPrintData m_printData;
d6b9496a 209 wxPrintData& GetPrintData() { return m_printData; }
5c750f94 210
2c84e0c2
RR
211 // After pressing OK, write data here.
212 wxPrintData* m_targetData;
47dc9f78
RR
213
214private:
2c84e0c2 215 DECLARE_EVENT_TABLE()
47dc9f78 216 DECLARE_CLASS(wxGenericPrintSetupDialog)
c801d85f 217};
25889d3c
JS
218#endif
219 // wxUSE_POSTSCRIPT
c801d85f 220
08680429 221class WXDLLEXPORT wxGenericPageSetupDialog : public wxPageSetupDialogBase
c801d85f 222{
7bcb11d3 223public:
47494677 224 wxGenericPageSetupDialog(wxWindow *parent = NULL,
08680429 225 wxPageSetupDialogData* data = NULL);
d6b9496a 226 virtual ~wxGenericPageSetupDialog();
7bcb11d3
JS
227
228 virtual bool TransferDataFromWindow();
229 virtual bool TransferDataToWindow();
230
08680429 231 virtual wxPageSetupDialogData& GetPageSetupDialogData();
d6b9496a 232
08680429 233 void OnPrinter(wxCommandEvent& event);
fa12f7e6 234 wxComboBox *CreatePaperTypeChoice(int* x, int* y);
7bcb11d3
JS
235
236public:
237 wxButton* m_printerButton;
238 wxRadioBox* m_orientationRadioBox;
239 wxTextCtrl* m_marginLeftText;
240 wxTextCtrl* m_marginTopText;
241 wxTextCtrl* m_marginRightText;
242 wxTextCtrl* m_marginBottomText;
fa12f7e6 243 wxComboBox* m_paperTypeChoice;
d6b9496a 244
08680429 245 wxPageSetupDialogData m_pageData;
d6b9496a
VZ
246
247private:
7bcb11d3 248 DECLARE_EVENT_TABLE()
47494677 249 DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericPageSetupDialog)
c801d85f
KB
250};
251
ce4169a4
RR
252#endif
253
c801d85f 254#endif
28181831 255// __PRINTDLGH_G_