]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/prntdlgg.h
Many changes to the printing classes.
[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 #ifdef __GNUG__
17 #pragma interface "prntdlgg.h"
18 #endif
19
20 #include "wx/defs.h"
21 #include "wx/dialog.h"
22 #include "wx/dc.h"
23 #include "wx/cmndata.h"
24 #include "wx/dialog.h"
25
26 #if wxUSE_POSTSCRIPT
27 #include "wx/dcps.h"
28 #endif
29
30 class WXDLLEXPORT wxTextCtrl;
31 class WXDLLEXPORT wxButton;
32 class WXDLLEXPORT wxCheckBox;
33 class WXDLLEXPORT wxChoice;
34 class WXDLLEXPORT wxStaticText;
35 class WXDLLEXPORT wxRadioBox;
36 class WXDLLEXPORT wxPrintSetupData;
37
38 /*
39 * Simulated Print and Print Setup dialogs
40 * for non-Windows platforms (and Windows using PostScript print/preview)
41 */
42
43 #define wxPRINTID_STATIC 10
44 #define wxPRINTID_RANGE 11
45 #define wxPRINTID_FROM 12
46 #define wxPRINTID_TO 13
47 #define wxPRINTID_COPIES 14
48 #define wxPRINTID_PRINTTOFILE 15
49 #define wxPRINTID_SETUP 16
50
51 class WXDLLEXPORT wxGenericPrintDialog: public wxDialog
52 {
53 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
54
55 public:
56 wxGenericPrintDialog(wxWindow *parent, wxPrintDialogData* data = (wxPrintDialogData*) NULL);
57 ~wxGenericPrintDialog();
58
59 void OnSetup(wxCommandEvent& event);
60 void OnRange(wxCommandEvent& event);
61 void OnOK(wxCommandEvent& event);
62
63 virtual bool TransferDataFromWindow();
64 virtual bool TransferDataToWindow();
65
66 virtual int ShowModal();
67
68 inline wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
69 wxDC *GetPrintDC();
70
71 public:
72 wxStaticText* m_printerMessage;
73 wxButton* m_setupButton;
74 wxButton* m_helpButton;
75 wxRadioBox* m_rangeRadioBox;
76 wxTextCtrl* m_fromText;
77 wxTextCtrl* m_toText;
78 wxTextCtrl* m_noCopiesText;
79 wxCheckBox* m_printToFileCheckBox;
80 wxCheckBox* m_collateCopiesCheckBox;
81
82 wxPrintDialogData m_printDialogData;
83
84
85 DECLARE_EVENT_TABLE()
86 };
87
88 #define wxPRINTID_PRINTCOLOUR 10
89 #define wxPRINTID_ORIENTATION 11
90 #define wxPRINTID_COMMAND 12
91 #define wxPRINTID_OPTIONS 13
92 #define wxPRINTID_PAPERSIZE 14
93
94 class WXDLLEXPORT wxGenericPrintSetupDialog: public wxDialog
95 {
96 DECLARE_CLASS(wxGenericPrintSetupDialog)
97
98 public:
99 // There are no configuration options for the dialog, so we
100 // just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
101 wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data);
102 wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data);
103 ~wxGenericPrintSetupDialog();
104
105 void Init(wxPrintData* data);
106
107 virtual bool TransferDataFromWindow();
108 virtual bool TransferDataToWindow();
109
110 wxChoice *CreatePaperTypeChoice(int* x, int* y);
111
112 public:
113 wxRadioBox* m_orientationRadioBox;
114 wxTextCtrl* m_printerCommandText;
115 wxTextCtrl* m_printerOptionsText;
116 wxCheckBox* m_colourCheckBox;
117 wxChoice* m_paperTypeChoice;
118
119 #if wxUSE_POSTSCRIPT
120 wxPrintData m_printData;
121 inline wxPrintData& GetPrintData() { return m_printData; }
122 #endif
123
124 };
125
126 #define wxPRINTID_LEFTMARGIN 30
127 #define wxPRINTID_RIGHTMARGIN 31
128 #define wxPRINTID_TOPMARGIN 32
129 #define wxPRINTID_BOTTOMMARGIN 33
130
131 class WXDLLEXPORT wxGenericPageSetupDialog: public wxDialog
132 {
133 DECLARE_CLASS(wxGenericPageSetupDialog)
134
135 public:
136 wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data = (wxPageSetupData*) NULL);
137 ~wxGenericPageSetupDialog();
138
139 virtual bool TransferDataFromWindow();
140 virtual bool TransferDataToWindow();
141
142 void OnPrinter(wxCommandEvent& event);
143
144 wxChoice *CreatePaperTypeChoice(int* x, int* y);
145 inline wxPageSetupData& GetPageSetupData() { return m_pageData; }
146
147 public:
148 wxButton* m_printerButton;
149 wxRadioBox* m_orientationRadioBox;
150 wxTextCtrl* m_marginLeftText;
151 wxTextCtrl* m_marginTopText;
152 wxTextCtrl* m_marginRightText;
153 wxTextCtrl* m_marginBottomText;
154 wxChoice* m_paperTypeChoice;
155
156 static bool m_pageSetupDialogCancelled;
157
158 wxPageSetupData m_pageData;
159
160 DECLARE_EVENT_TABLE()
161 };
162
163 #endif
164 // __PRINTDLGH_G__