1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGenericPrintDialog, wxGenericPrintSetupDialog,
4 // wxGenericPageSetupDialog
5 // Author: Julian Smart
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef __PRINTDLGH_G_
14 #define __PRINTDLGH_G_
17 #pragma interface "prntdlgg.h"
21 #include "wx/dialog.h"
23 #include "wx/cmndata.h"
24 #include "wx/postscrp.h"
26 class WXDLLEXPORT wxTextCtrl
;
27 class WXDLLEXPORT wxButton
;
28 class WXDLLEXPORT wxCheckBox
;
29 class WXDLLEXPORT wxChoice
;
30 class WXDLLEXPORT wxStaticText
;
31 class WXDLLEXPORT wxRadioBox
;
32 class WXDLLEXPORT wxPrintSetupData
;
35 * Simulated Print and Print Setup dialogs
36 * for non-Windows platforms (and Windows using PostScript print/preview)
39 #define wxPRINTID_STATIC 10
40 #define wxPRINTID_RANGE 11
41 #define wxPRINTID_FROM 12
42 #define wxPRINTID_TO 13
43 #define wxPRINTID_COPIES 14
44 #define wxPRINTID_PRINTTOFILE 15
45 #define wxPRINTID_SETUP 16
47 class WXDLLEXPORT wxGenericPrintDialog
: public wxDialog
49 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog
)
52 wxStaticText
*printerMessage
;
53 wxButton
*setupButton
;
55 wxRadioBox
*rangeRadioBox
;
58 wxTextCtrl
*noCopiesText
;
59 wxCheckBox
*printToFileCheckBox
;
60 wxCheckBox
*collateCopiesCheckBox
;
62 wxPrintData printData
;
63 wxGenericPrintDialog(wxWindow
*parent
, wxPrintData
* data
);
64 ~wxGenericPrintDialog(void);
66 void OnSetup(wxCommandEvent
& event
);
67 void OnRange(wxCommandEvent
& event
);
68 void OnOK(wxCommandEvent
& event
);
70 virtual bool TransferDataFromWindow(void);
71 virtual bool TransferDataToWindow(void);
73 virtual int ShowModal(void);
75 inline wxPrintData
& GetPrintData(void) { return printData
; }
76 wxDC
*GetPrintDC(void);
81 #define wxPRINTID_PRINTCOLOUR 10
82 #define wxPRINTID_ORIENTATION 11
83 #define wxPRINTID_COMMAND 12
84 #define wxPRINTID_OPTIONS 13
85 #define wxPRINTID_PAPERSIZE 14
87 class WXDLLEXPORT wxGenericPrintSetupDialog
: public wxDialog
89 DECLARE_CLASS(wxGenericPrintSetupDialog
)
92 wxRadioBox
*orientationRadioBox
;
93 wxTextCtrl
*printerCommandText
;
94 wxTextCtrl
*printerOptionsText
;
95 wxCheckBox
*colourCheckBox
;
96 wxChoice
*paperTypeChoice
;
99 wxPrintSetupData printData
;
100 inline wxPrintSetupData
& GetPrintData(void) { return printData
; }
103 wxGenericPrintSetupDialog(wxWindow
*parent
, wxPrintSetupData
* data
);
104 ~wxGenericPrintSetupDialog(void);
106 virtual bool TransferDataFromWindow(void);
107 virtual bool TransferDataToWindow(void);
109 wxChoice
*CreatePaperTypeChoice(int* x
, int* y
);
112 #define wxPRINTID_LEFTMARGIN 30
113 #define wxPRINTID_RIGHTMARGIN 31
114 #define wxPRINTID_TOPMARGIN 32
115 #define wxPRINTID_BOTTOMMARGIN 33
117 class WXDLLEXPORT wxGenericPageSetupDialog
: public wxDialog
119 DECLARE_CLASS(wxGenericPageSetupDialog
)
122 wxButton
*printerButton
;
123 wxRadioBox
*orientationRadioBox
;
124 wxTextCtrl
*marginLeftText
;
125 wxTextCtrl
*marginTopText
;
126 wxTextCtrl
*marginRightText
;
127 wxTextCtrl
*marginBottomText
;
128 wxChoice
*paperTypeChoice
;
130 static bool pageSetupDialogCancelled
;
132 wxPageSetupData pageData
;
134 wxGenericPageSetupDialog(wxWindow
*parent
, wxPageSetupData
* data
= (wxPageSetupData
*) NULL
);
135 ~wxGenericPageSetupDialog(void);
137 virtual bool TransferDataFromWindow(void);
138 virtual bool TransferDataToWindow(void);
140 void OnPrinter(wxCommandEvent
& event
);
142 wxChoice
*CreatePaperTypeChoice(int* x
, int* y
);
143 inline wxPageSetupData
& GetPageSetupData(void) { return pageData
; }
145 DECLARE_EVENT_TABLE()