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
;
34 * Simulated Print and Print Setup dialogs
35 * for non-Windows platforms (and Windows using PostScript print/preview)
38 #define wxPRINTID_STATIC 10
39 #define wxPRINTID_RANGE 11
40 #define wxPRINTID_FROM 12
41 #define wxPRINTID_TO 13
42 #define wxPRINTID_COPIES 14
43 #define wxPRINTID_PRINTTOFILE 15
44 #define wxPRINTID_SETUP 16
46 class WXDLLEXPORT wxGenericPrintDialog
: public wxDialog
48 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog
)
51 wxStaticText
*printerMessage
;
52 wxButton
*setupButton
;
54 wxRadioBox
*rangeRadioBox
;
57 wxTextCtrl
*noCopiesText
;
58 wxCheckBox
*printToFileCheckBox
;
59 wxCheckBox
*collateCopiesCheckBox
;
61 wxPrintData printData
;
62 wxGenericPrintDialog(wxWindow
*parent
, wxPrintData
* data
);
63 ~wxGenericPrintDialog(void);
65 void OnSetup(wxCommandEvent
& event
);
66 void OnRange(wxCommandEvent
& event
);
67 void OnOK(wxCommandEvent
& event
);
69 virtual bool TransferDataFromWindow(void);
70 virtual bool TransferDataToWindow(void);
72 virtual int ShowModal(void);
74 inline wxPrintData
& GetPrintData(void) { return printData
; }
75 wxDC
*GetPrintDC(void);
80 #define wxPRINTID_PRINTCOLOUR 10
81 #define wxPRINTID_ORIENTATION 11
82 #define wxPRINTID_COMMAND 12
83 #define wxPRINTID_OPTIONS 13
84 #define wxPRINTID_PAPERSIZE 14
86 class WXDLLEXPORT wxGenericPrintSetupDialog
: public wxDialog
88 DECLARE_CLASS(wxGenericPrintSetupDialog
)
91 wxRadioBox
*orientationRadioBox
;
92 wxTextCtrl
*printerCommandText
;
93 wxTextCtrl
*printerOptionsText
;
94 wxCheckBox
*colourCheckBox
;
95 wxChoice
*paperTypeChoice
;
97 wxPrintSetupData printData
;
98 wxGenericPrintSetupDialog(wxWindow
*parent
, wxPrintSetupData
* data
);
99 ~wxGenericPrintSetupDialog(void);
101 virtual bool TransferDataFromWindow(void);
102 virtual bool TransferDataToWindow(void);
104 wxChoice
*CreatePaperTypeChoice(int* x
, int* y
);
105 inline wxPrintSetupData
& GetPrintData(void) { return printData
; }
108 #define wxPRINTID_LEFTMARGIN 30
109 #define wxPRINTID_RIGHTMARGIN 31
110 #define wxPRINTID_TOPMARGIN 32
111 #define wxPRINTID_BOTTOMMARGIN 33
113 class WXDLLEXPORT wxGenericPageSetupDialog
: public wxDialog
115 DECLARE_CLASS(wxGenericPageSetupDialog
)
118 wxButton
*printerButton
;
119 wxRadioBox
*orientationRadioBox
;
120 wxTextCtrl
*marginLeftText
;
121 wxTextCtrl
*marginTopText
;
122 wxTextCtrl
*marginRightText
;
123 wxTextCtrl
*marginBottomText
;
124 wxChoice
*paperTypeChoice
;
126 static bool pageSetupDialogCancelled
;
128 wxPageSetupData pageData
;
130 wxGenericPageSetupDialog(wxWindow
*parent
, wxPageSetupData
* data
= (wxPageSetupData
*) NULL
);
131 ~wxGenericPageSetupDialog(void);
133 virtual bool TransferDataFromWindow(void);
134 virtual bool TransferDataToWindow(void);
136 void OnPrinter(wxCommandEvent
& event
);
138 wxChoice
*CreatePaperTypeChoice(int* x
, int* y
);
139 inline wxPageSetupData
& GetPageSetupData(void) { return pageData
; }
141 DECLARE_EVENT_TABLE()