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/dialog.h"
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
;
39 * Simulated Print and Print Setup dialogs
40 * for non-Windows platforms (and Windows using PostScript print/preview)
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
51 class WXDLLEXPORT wxGenericPrintDialog
: public wxDialog
53 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog
)
56 wxGenericPrintDialog(wxWindow
*parent
, wxPrintDialogData
* data
= (wxPrintDialogData
*) NULL
);
57 ~wxGenericPrintDialog();
59 void OnSetup(wxCommandEvent
& event
);
60 void OnRange(wxCommandEvent
& event
);
61 void OnOK(wxCommandEvent
& event
);
63 virtual bool TransferDataFromWindow();
64 virtual bool TransferDataToWindow();
66 virtual int ShowModal();
68 inline wxPrintDialogData
& GetPrintDialogData() { return m_printDialogData
; }
72 wxStaticText
* m_printerMessage
;
73 wxButton
* m_setupButton
;
74 wxButton
* m_helpButton
;
75 wxRadioBox
* m_rangeRadioBox
;
76 wxTextCtrl
* m_fromText
;
78 wxTextCtrl
* m_noCopiesText
;
79 wxCheckBox
* m_printToFileCheckBox
;
80 wxCheckBox
* m_collateCopiesCheckBox
;
82 wxPrintDialogData m_printDialogData
;
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
94 class WXDLLEXPORT wxGenericPrintSetupDialog
: public wxDialog
96 DECLARE_CLASS(wxGenericPrintSetupDialog
)
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();
105 void Init(wxPrintData
* data
);
107 virtual bool TransferDataFromWindow();
108 virtual bool TransferDataToWindow();
110 wxChoice
*CreatePaperTypeChoice(int* x
, int* y
);
113 wxRadioBox
* m_orientationRadioBox
;
114 wxTextCtrl
* m_printerCommandText
;
115 wxTextCtrl
* m_printerOptionsText
;
116 wxCheckBox
* m_colourCheckBox
;
117 wxChoice
* m_paperTypeChoice
;
120 wxPrintData m_printData
;
121 inline wxPrintData
& GetPrintData() { return m_printData
; }
126 #define wxPRINTID_LEFTMARGIN 30
127 #define wxPRINTID_RIGHTMARGIN 31
128 #define wxPRINTID_TOPMARGIN 32
129 #define wxPRINTID_BOTTOMMARGIN 33
131 class WXDLLEXPORT wxGenericPageSetupDialog
: public wxDialog
133 DECLARE_CLASS(wxGenericPageSetupDialog
)
136 wxGenericPageSetupDialog(wxWindow
*parent
, wxPageSetupData
* data
= (wxPageSetupData
*) NULL
);
137 ~wxGenericPageSetupDialog();
139 virtual bool TransferDataFromWindow();
140 virtual bool TransferDataToWindow();
142 void OnPrinter(wxCommandEvent
& event
);
144 wxChoice
*CreatePaperTypeChoice(int* x
, int* y
);
145 inline wxPageSetupData
& GetPageSetupData() { return m_pageData
; }
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
;
156 static bool m_pageSetupDialogCancelled
;
158 wxPageSetupData m_pageData
;
160 DECLARE_EVENT_TABLE()