]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/prntdlgg.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / generic / prntdlgg.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: wx/generic/prntdlgg.h
c801d85f
KB
3// Purpose: wxGenericPrintDialog, wxGenericPrintSetupDialog,
4// wxGenericPageSetupDialog
5// Author: Julian Smart
6// Modified by:
7// Created: 01/02/97
99d80019 8// Copyright: (c) Julian Smart
65571936 9// Licence: wxWindows licence
c801d85f
KB
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __PRINTDLGH_G_
13#define __PRINTDLGH_G_
14
c801d85f 15#include "wx/defs.h"
ce4169a4
RR
16
17#if wxUSE_PRINTING_ARCHITECTURE
18
bf38cbff 19#include "wx/dialog.h"
d7a7bd6d 20#include "wx/cmndata.h"
8850cbd3 21#include "wx/prntbase.h"
c061373d 22#include "wx/printdlg.h"
2c84e0c2 23#include "wx/listctrl.h"
bf38cbff 24
888dde65 25#include "wx/dc.h"
bf38cbff 26#if wxUSE_POSTSCRIPT
d6b9496a 27 #include "wx/dcps.h"
bf38cbff 28#endif
c801d85f 29
b5dbe15d
VS
30class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
31class WXDLLIMPEXP_FWD_CORE wxButton;
32class WXDLLIMPEXP_FWD_CORE wxCheckBox;
33class WXDLLIMPEXP_FWD_CORE wxComboBox;
34class WXDLLIMPEXP_FWD_CORE wxStaticText;
35class WXDLLIMPEXP_FWD_CORE wxRadioBox;
7193abfb 36class WXDLLIMPEXP_FWD_CORE wxPageSetupDialogData;
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
53a2db12 80class WXDLLIMPEXP_CORE wxPostScriptPrintNativeData: public wxPrintNativeDataBase
8850cbd3
RR
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
b7cacb43
VZ
89 virtual bool Ok() const { return IsOk(); }
90 virtual bool IsOk() const { return true; }
5c750f94 91
8850cbd3
RR
92 const wxString& GetPrinterCommand() const { return m_printerCommand; }
93 const wxString& GetPrinterOptions() const { return m_printerOptions; }
94 const wxString& GetPreviewCommand() const { return m_previewCommand; }
95 const wxString& GetFontMetricPath() const { return m_afmPath; }
96 double GetPrinterScaleX() const { return m_printerScaleX; }
97 double GetPrinterScaleY() const { return m_printerScaleY; }
98 long GetPrinterTranslateX() const { return m_printerTranslateX; }
99 long GetPrinterTranslateY() const { return m_printerTranslateY; }
8850cbd3
RR
100
101 void SetPrinterCommand(const wxString& command) { m_printerCommand = command; }
102 void SetPrinterOptions(const wxString& options) { m_printerOptions = options; }
103 void SetPreviewCommand(const wxString& command) { m_previewCommand = command; }
104 void SetFontMetricPath(const wxString& path) { m_afmPath = path; }
105 void SetPrinterScaleX(double x) { m_printerScaleX = x; }
106 void SetPrinterScaleY(double y) { m_printerScaleY = y; }
107 void SetPrinterScaling(double x, double y) { m_printerScaleX = x; m_printerScaleY = y; }
108 void SetPrinterTranslateX(long x) { m_printerTranslateX = x; }
109 void SetPrinterTranslateY(long y) { m_printerTranslateY = y; }
110 void SetPrinterTranslation(long x, long y) { m_printerTranslateX = x; m_printerTranslateY = y; }
8850cbd3
RR
111
112#if wxUSE_STREAMS
113 wxOutputStream *GetOutputStream() { return m_outputStream; }
114 void SetOutputStream( wxOutputStream *output ) { m_outputStream = output; }
115#endif
116
117private:
118 wxString m_printerCommand;
119 wxString m_previewCommand;
120 wxString m_printerOptions;
121 wxString m_afmPath;
122 double m_printerScaleX;
123 double m_printerScaleY;
124 long m_printerTranslateX;
125 long m_printerTranslateY;
8850cbd3
RR
126#if wxUSE_STREAMS
127 wxOutputStream *m_outputStream;
128#endif
5c750f94 129
8850cbd3
RR
130private:
131 DECLARE_DYNAMIC_CLASS(wxPostScriptPrintNativeData)
132};
5c750f94 133
d6b9496a
VZ
134// ----------------------------------------------------------------------------
135// Simulated Print and Print Setup dialogs for non-Windows platforms (and
136// Windows using PostScript print/preview)
137// ----------------------------------------------------------------------------
138
53a2db12 139class WXDLLIMPEXP_CORE wxGenericPrintDialog : public wxPrintDialogBase
c801d85f 140{
7bcb11d3 141public:
d6b9496a 142 wxGenericPrintDialog(wxWindow *parent,
d3b9f782 143 wxPrintDialogData* data = NULL);
d6b9496a
VZ
144 wxGenericPrintDialog(wxWindow *parent, wxPrintData* data);
145
146 virtual ~wxGenericPrintDialog();
7bcb11d3
JS
147
148 void OnSetup(wxCommandEvent& event);
149 void OnRange(wxCommandEvent& event);
150 void OnOK(wxCommandEvent& event);
d6b9496a 151
7bcb11d3
JS
152 virtual bool TransferDataFromWindow();
153 virtual bool TransferDataToWindow();
154
155 virtual int ShowModal();
156
d6b9496a
VZ
157 wxPrintData& GetPrintData()
158 { return m_printDialogData.GetPrintData(); }
d6b9496a
VZ
159
160 wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
7bcb11d3
JS
161 wxDC *GetPrintDC();
162
163public:
58a33cb4 164// wxStaticText* m_printerMessage;
7bcb11d3 165 wxButton* m_setupButton;
58a33cb4 166// wxButton* m_helpButton;
7bcb11d3
JS
167 wxRadioBox* m_rangeRadioBox;
168 wxTextCtrl* m_fromText;
169 wxTextCtrl* m_toText;
170 wxTextCtrl* m_noCopiesText;
171 wxCheckBox* m_printToFileCheckBox;
58a33cb4 172// wxCheckBox* m_collateCopiesCheckBox;
d6b9496a 173
7bcb11d3 174 wxPrintDialogData m_printDialogData;
d6b9496a
VZ
175
176protected:
177 void Init(wxWindow *parent);
178
179private:
7bcb11d3 180 DECLARE_EVENT_TABLE()
47dc9f78 181 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
c801d85f
KB
182};
183
53a2db12 184class WXDLLIMPEXP_CORE wxGenericPrintSetupDialog : public wxDialog
c801d85f 185{
7bcb11d3
JS
186public:
187 // There are no configuration options for the dialog, so we
188 // just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
189 wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data);
d6b9496a 190 virtual ~wxGenericPrintSetupDialog();
7bcb11d3
JS
191
192 void Init(wxPrintData* data);
193
2c84e0c2 194 void OnPrinter(wxListEvent& event);
5c750f94 195
7bcb11d3
JS
196 virtual bool TransferDataFromWindow();
197 virtual bool TransferDataToWindow();
198
6038ec8e 199 virtual wxComboBox *CreatePaperTypeChoice();
d6b9496a 200
7bcb11d3 201public:
2c84e0c2 202 wxListCtrl* m_printerListCtrl;
7bcb11d3
JS
203 wxRadioBox* m_orientationRadioBox;
204 wxTextCtrl* m_printerCommandText;
205 wxTextCtrl* m_printerOptionsText;
206 wxCheckBox* m_colourCheckBox;
2c84e0c2 207 wxComboBox* m_paperTypeChoice;
d6b9496a 208
7bcb11d3 209 wxPrintData m_printData;
d6b9496a 210 wxPrintData& GetPrintData() { return m_printData; }
5c750f94 211
2c84e0c2
RR
212 // After pressing OK, write data here.
213 wxPrintData* m_targetData;
47dc9f78
RR
214
215private:
2c84e0c2 216 DECLARE_EVENT_TABLE()
47dc9f78 217 DECLARE_CLASS(wxGenericPrintSetupDialog)
c801d85f 218};
25889d3c
JS
219#endif
220 // wxUSE_POSTSCRIPT
c801d85f 221
53a2db12 222class WXDLLIMPEXP_CORE wxGenericPageSetupDialog : public wxPageSetupDialogBase
c801d85f 223{
7bcb11d3 224public:
47494677 225 wxGenericPageSetupDialog(wxWindow *parent = NULL,
08680429 226 wxPageSetupDialogData* data = NULL);
d6b9496a 227 virtual ~wxGenericPageSetupDialog();
7bcb11d3
JS
228
229 virtual bool TransferDataFromWindow();
230 virtual bool TransferDataToWindow();
231
08680429 232 virtual wxPageSetupDialogData& GetPageSetupDialogData();
d6b9496a 233
08680429 234 void OnPrinter(wxCommandEvent& event);
fa12f7e6 235 wxComboBox *CreatePaperTypeChoice(int* x, int* y);
7bcb11d3
JS
236
237public:
238 wxButton* m_printerButton;
239 wxRadioBox* m_orientationRadioBox;
240 wxTextCtrl* m_marginLeftText;
241 wxTextCtrl* m_marginTopText;
242 wxTextCtrl* m_marginRightText;
243 wxTextCtrl* m_marginBottomText;
fa12f7e6 244 wxComboBox* m_paperTypeChoice;
d6b9496a 245
08680429 246 wxPageSetupDialogData m_pageData;
d6b9496a
VZ
247
248private:
7bcb11d3 249 DECLARE_EVENT_TABLE()
47494677 250 DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericPageSetupDialog)
c801d85f
KB
251};
252
ce4169a4
RR
253#endif
254
c801d85f 255#endif
28181831 256// __PRINTDLGH_G_