]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/prntdlgg.h
wxUsleep() introduced (and documented) to try to work around usleep() bug in
[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 wxStaticText *printerMessage;
57 wxButton *setupButton;
58 wxButton *helpButton;
59 wxRadioBox *rangeRadioBox;
60 wxTextCtrl *fromText;
61 wxTextCtrl *toText;
62 wxTextCtrl *noCopiesText;
63 wxCheckBox *printToFileCheckBox;
64 wxCheckBox *collateCopiesCheckBox;
65
66 wxPrintData printData;
67 wxGenericPrintDialog(wxWindow *parent, wxPrintData* data);
68 ~wxGenericPrintDialog(void);
69
70 void OnSetup(wxCommandEvent& event);
71 void OnRange(wxCommandEvent& event);
72 void OnOK(wxCommandEvent& event);
73
74 virtual bool TransferDataFromWindow(void);
75 virtual bool TransferDataToWindow(void);
76
77 virtual int ShowModal(void);
78
79 inline wxPrintData& GetPrintData(void) { return printData; }
80 wxDC *GetPrintDC(void);
81
82 DECLARE_EVENT_TABLE()
83 };
84
85 #define wxPRINTID_PRINTCOLOUR 10
86 #define wxPRINTID_ORIENTATION 11
87 #define wxPRINTID_COMMAND 12
88 #define wxPRINTID_OPTIONS 13
89 #define wxPRINTID_PAPERSIZE 14
90
91 class WXDLLEXPORT wxGenericPrintSetupDialog: public wxDialog
92 {
93 DECLARE_CLASS(wxGenericPrintSetupDialog)
94
95 public:
96 wxRadioBox *orientationRadioBox;
97 wxTextCtrl *printerCommandText;
98 wxTextCtrl *printerOptionsText;
99 wxCheckBox *colourCheckBox;
100 wxChoice *paperTypeChoice;
101
102 #if wxUSE_POSTSCRIPT
103 wxPrintSetupData printData;
104 inline wxPrintSetupData& GetPrintData(void) { return printData; }
105 #endif
106
107 wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data);
108 ~wxGenericPrintSetupDialog(void);
109
110 virtual bool TransferDataFromWindow(void);
111 virtual bool TransferDataToWindow(void);
112
113 wxChoice *CreatePaperTypeChoice(int* x, int* y);
114 };
115
116 #define wxPRINTID_LEFTMARGIN 30
117 #define wxPRINTID_RIGHTMARGIN 31
118 #define wxPRINTID_TOPMARGIN 32
119 #define wxPRINTID_BOTTOMMARGIN 33
120
121 class WXDLLEXPORT wxGenericPageSetupDialog: public wxDialog
122 {
123 DECLARE_CLASS(wxGenericPageSetupDialog)
124
125 public:
126 wxButton *printerButton;
127 wxRadioBox *orientationRadioBox;
128 wxTextCtrl *marginLeftText;
129 wxTextCtrl *marginTopText;
130 wxTextCtrl *marginRightText;
131 wxTextCtrl *marginBottomText;
132 wxChoice *paperTypeChoice;
133
134 static bool pageSetupDialogCancelled;
135
136 wxPageSetupData pageData;
137
138 wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data = (wxPageSetupData*) NULL);
139 ~wxGenericPageSetupDialog(void);
140
141 virtual bool TransferDataFromWindow(void);
142 virtual bool TransferDataToWindow(void);
143
144 void OnPrinter(wxCommandEvent& event);
145
146 wxChoice *CreatePaperTypeChoice(int* x, int* y);
147 inline wxPageSetupData& GetPageSetupData(void) { return pageData; }
148
149 DECLARE_EVENT_TABLE()
150 };
151
152 #endif
153 // __PRINTDLGH_G__