]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/prntdlgg.h
wxBitmapButton doesn't need own DoGetBestSize, wxControl's one works (fixes sizing...
[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)
65571936 10// Licence: wxWindows licence
c801d85f
KB
11/////////////////////////////////////////////////////////////////////////////
12
13#ifndef __PRINTDLGH_G_
14#define __PRINTDLGH_G_
15
12028905 16#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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 24#include "wx/dialog.h"
d7a7bd6d 25#include "wx/cmndata.h"
8850cbd3 26#include "wx/prntbase.h"
c061373d 27#include "wx/printdlg.h"
bf38cbff
JS
28
29#if wxUSE_POSTSCRIPT
d6b9496a 30 #include "wx/dcps.h"
bf38cbff 31#endif
c801d85f
KB
32
33class WXDLLEXPORT wxTextCtrl;
34class WXDLLEXPORT wxButton;
35class WXDLLEXPORT wxCheckBox;
fa12f7e6 36class WXDLLEXPORT wxComboBox;
c801d85f
KB
37class WXDLLEXPORT wxStaticText;
38class WXDLLEXPORT wxRadioBox;
5e9f4026 39class WXDLLEXPORT wxPrintSetupData;
43330cc9 40class WXDLLEXPORT wxPageSetupData;
8850cbd3 41
d6b9496a
VZ
42// ----------------------------------------------------------------------------
43// constants
44// ----------------------------------------------------------------------------
c801d85f 45
d6b9496a 46// FIXME why all these enums start with 10 or 30?
c801d85f 47
d6b9496a
VZ
48enum
49{
50 wxPRINTID_STATIC = 10,
51 wxPRINTID_RANGE,
52 wxPRINTID_FROM,
53 wxPRINTID_TO,
54 wxPRINTID_COPIES,
55 wxPRINTID_PRINTTOFILE,
56 wxPRINTID_SETUP
57};
58
59enum
60{
61 wxPRINTID_LEFTMARGIN = 30,
62 wxPRINTID_RIGHTMARGIN,
63 wxPRINTID_TOPMARGIN,
64 wxPRINTID_BOTTOMMARGIN
65};
66
67enum
68{
69 wxPRINTID_PRINTCOLOUR = 10,
70 wxPRINTID_ORIENTATION,
71 wxPRINTID_COMMAND,
72 wxPRINTID_OPTIONS,
73 wxPRINTID_PAPERSIZE
74};
75
8850cbd3
RR
76#if wxUSE_POSTSCRIPT
77
78//----------------------------------------------------------------------------
79// wxPostScriptNativeData
80//----------------------------------------------------------------------------
81
82class WXDLLEXPORT wxPostScriptPrintNativeData: public wxPrintNativeDataBase
83{
84public:
85 wxPostScriptPrintNativeData();
86 virtual ~wxPostScriptPrintNativeData();
87
fd64de59
RR
88 virtual bool TransferTo( wxPrintData &data );
89 virtual bool TransferFrom( const wxPrintData &data );
8850cbd3
RR
90
91 virtual bool Ok() const { return true; }
92
93 const wxString& GetPrinterCommand() const { return m_printerCommand; }
94 const wxString& GetPrinterOptions() const { return m_printerOptions; }
95 const wxString& GetPreviewCommand() const { return m_previewCommand; }
96 const wxString& GetFontMetricPath() const { return m_afmPath; }
97 double GetPrinterScaleX() const { return m_printerScaleX; }
98 double GetPrinterScaleY() const { return m_printerScaleY; }
99 long GetPrinterTranslateX() const { return m_printerTranslateX; }
100 long GetPrinterTranslateY() const { return m_printerTranslateY; }
101 wxPrintMode GetPrintMode() const { return m_printMode; }
102
103 void SetPrinterCommand(const wxString& command) { m_printerCommand = command; }
104 void SetPrinterOptions(const wxString& options) { m_printerOptions = options; }
105 void SetPreviewCommand(const wxString& command) { m_previewCommand = command; }
106 void SetFontMetricPath(const wxString& path) { m_afmPath = path; }
107 void SetPrinterScaleX(double x) { m_printerScaleX = x; }
108 void SetPrinterScaleY(double y) { m_printerScaleY = y; }
109 void SetPrinterScaling(double x, double y) { m_printerScaleX = x; m_printerScaleY = y; }
110 void SetPrinterTranslateX(long x) { m_printerTranslateX = x; }
111 void SetPrinterTranslateY(long y) { m_printerTranslateY = y; }
112 void SetPrinterTranslation(long x, long y) { m_printerTranslateX = x; m_printerTranslateY = y; }
113 void SetPrintMode(wxPrintMode printMode) { m_printMode = printMode; }
114
115#if wxUSE_STREAMS
116 wxOutputStream *GetOutputStream() { return m_outputStream; }
117 void SetOutputStream( wxOutputStream *output ) { m_outputStream = output; }
118#endif
119
120private:
121 wxString m_printerCommand;
122 wxString m_previewCommand;
123 wxString m_printerOptions;
124 wxString m_afmPath;
125 double m_printerScaleX;
126 double m_printerScaleY;
127 long m_printerTranslateX;
128 long m_printerTranslateY;
129 wxPrintMode m_printMode;
130#if wxUSE_STREAMS
131 wxOutputStream *m_outputStream;
132#endif
133
134private:
135 DECLARE_DYNAMIC_CLASS(wxPostScriptPrintNativeData)
136};
137
d6b9496a
VZ
138// ----------------------------------------------------------------------------
139// Simulated Print and Print Setup dialogs for non-Windows platforms (and
140// Windows using PostScript print/preview)
141// ----------------------------------------------------------------------------
142
c061373d 143class WXDLLEXPORT wxGenericPrintDialog : public wxPrintDialogBase
c801d85f 144{
7bcb11d3 145public:
d6b9496a
VZ
146 wxGenericPrintDialog(wxWindow *parent,
147 wxPrintDialogData* data = (wxPrintDialogData*)NULL);
148 wxGenericPrintDialog(wxWindow *parent, wxPrintData* data);
149
150 virtual ~wxGenericPrintDialog();
7bcb11d3
JS
151
152 void OnSetup(wxCommandEvent& event);
153 void OnRange(wxCommandEvent& event);
154 void OnOK(wxCommandEvent& event);
d6b9496a 155
7bcb11d3
JS
156 virtual bool TransferDataFromWindow();
157 virtual bool TransferDataToWindow();
158
159 virtual int ShowModal();
160
d6b9496a
VZ
161#if wxUSE_POSTSCRIPT
162 wxPrintData& GetPrintData()
163 { return m_printDialogData.GetPrintData(); }
164#endif // wxUSE_POSTSCRIPT
165
166 wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
7bcb11d3
JS
167 wxDC *GetPrintDC();
168
169public:
58a33cb4 170// wxStaticText* m_printerMessage;
7bcb11d3 171 wxButton* m_setupButton;
58a33cb4 172// wxButton* m_helpButton;
7bcb11d3
JS
173 wxRadioBox* m_rangeRadioBox;
174 wxTextCtrl* m_fromText;
175 wxTextCtrl* m_toText;
176 wxTextCtrl* m_noCopiesText;
177 wxCheckBox* m_printToFileCheckBox;
58a33cb4 178// wxCheckBox* m_collateCopiesCheckBox;
d6b9496a 179
7bcb11d3 180 wxPrintDialogData m_printDialogData;
d6b9496a
VZ
181
182protected:
183 void Init(wxWindow *parent);
184
185private:
7bcb11d3 186 DECLARE_EVENT_TABLE()
47dc9f78 187 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
c801d85f
KB
188};
189
d6b9496a 190class WXDLLEXPORT wxGenericPrintSetupDialog : public wxDialog
c801d85f 191{
7bcb11d3
JS
192public:
193 // There are no configuration options for the dialog, so we
194 // just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
195 wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data);
196 wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data);
d6b9496a 197 virtual ~wxGenericPrintSetupDialog();
7bcb11d3
JS
198
199 void Init(wxPrintData* data);
200
201 virtual bool TransferDataFromWindow();
202 virtual bool TransferDataToWindow();
203
fa12f7e6 204 wxComboBox *CreatePaperTypeChoice(int* x, int* y);
d6b9496a 205
7bcb11d3
JS
206public:
207 wxRadioBox* m_orientationRadioBox;
208 wxTextCtrl* m_printerCommandText;
209 wxTextCtrl* m_printerOptionsText;
210 wxCheckBox* m_colourCheckBox;
fa12f7e6 211 wxComboBox* m_paperTypeChoice;
d6b9496a 212
5e9f4026 213#if wxUSE_POSTSCRIPT
7bcb11d3 214 wxPrintData m_printData;
d6b9496a
VZ
215 wxPrintData& GetPrintData() { return m_printData; }
216#endif // wxUSE_POSTSCRIPT
47dc9f78
RR
217
218private:
219 DECLARE_CLASS(wxGenericPrintSetupDialog)
c801d85f 220};
25889d3c
JS
221#endif
222 // wxUSE_POSTSCRIPT
c801d85f 223
d6b9496a 224class WXDLLEXPORT wxGenericPageSetupDialog : public wxDialog
c801d85f 225{
7bcb11d3 226public:
47494677
VZ
227 wxGenericPageSetupDialog(wxWindow *parent = NULL,
228 wxPageSetupData* data = NULL);
d6b9496a 229 virtual ~wxGenericPageSetupDialog();
7bcb11d3
JS
230
231 virtual bool TransferDataFromWindow();
232 virtual bool TransferDataToWindow();
233
234 void OnPrinter(wxCommandEvent& event);
d6b9496a 235
fa12f7e6 236 wxComboBox *CreatePaperTypeChoice(int* x, int* y);
d6b9496a 237 wxPageSetupData& GetPageSetupData() { return m_pageData; }
7bcb11d3
JS
238
239public:
240 wxButton* m_printerButton;
241 wxRadioBox* m_orientationRadioBox;
242 wxTextCtrl* m_marginLeftText;
243 wxTextCtrl* m_marginTopText;
244 wxTextCtrl* m_marginRightText;
245 wxTextCtrl* m_marginBottomText;
fa12f7e6 246 wxComboBox* m_paperTypeChoice;
d6b9496a 247
7bcb11d3 248 static bool m_pageSetupDialogCancelled;
d6b9496a 249
7bcb11d3 250 wxPageSetupData m_pageData;
d6b9496a
VZ
251
252private:
7bcb11d3 253 DECLARE_EVENT_TABLE()
47494677 254 DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericPageSetupDialog)
c801d85f
KB
255};
256
ce4169a4
RR
257#endif
258
c801d85f 259#endif
7bcb11d3 260// __PRINTDLGH_G__