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"
22 #include "wx/dialog.h"
28 class WXDLLEXPORT wxTextCtrl
;
29 class WXDLLEXPORT wxButton
;
30 class WXDLLEXPORT wxCheckBox
;
31 class WXDLLEXPORT wxChoice
;
32 class WXDLLEXPORT wxStaticText
;
33 class WXDLLEXPORT wxRadioBox
;
34 class WXDLLEXPORT wxPrintSetupData
;
36 // ----------------------------------------------------------------------------
38 // ----------------------------------------------------------------------------
40 // FIXME why all these enums start with 10 or 30?
44 wxPRINTID_STATIC
= 10,
49 wxPRINTID_PRINTTOFILE
,
55 wxPRINTID_LEFTMARGIN
= 30,
56 wxPRINTID_RIGHTMARGIN
,
58 wxPRINTID_BOTTOMMARGIN
63 wxPRINTID_PRINTCOLOUR
= 10,
64 wxPRINTID_ORIENTATION
,
70 // ----------------------------------------------------------------------------
71 // Simulated Print and Print Setup dialogs for non-Windows platforms (and
72 // Windows using PostScript print/preview)
73 // ----------------------------------------------------------------------------
75 class WXDLLEXPORT wxGenericPrintDialog
: public wxDialog
77 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog
)
80 wxGenericPrintDialog(wxWindow
*parent
,
81 wxPrintDialogData
* data
= (wxPrintDialogData
*)NULL
);
82 wxGenericPrintDialog(wxWindow
*parent
, wxPrintData
* data
);
84 virtual ~wxGenericPrintDialog();
86 void OnSetup(wxCommandEvent
& event
);
87 void OnRange(wxCommandEvent
& event
);
88 void OnOK(wxCommandEvent
& event
);
90 virtual bool TransferDataFromWindow();
91 virtual bool TransferDataToWindow();
93 virtual int ShowModal();
96 wxPrintData
& GetPrintData()
97 { return m_printDialogData
.GetPrintData(); }
98 #endif // wxUSE_POSTSCRIPT
100 wxPrintDialogData
& GetPrintDialogData() { return m_printDialogData
; }
104 // wxStaticText* m_printerMessage;
105 wxButton
* m_setupButton
;
106 // wxButton* m_helpButton;
107 wxRadioBox
* m_rangeRadioBox
;
108 wxTextCtrl
* m_fromText
;
109 wxTextCtrl
* m_toText
;
110 wxTextCtrl
* m_noCopiesText
;
111 wxCheckBox
* m_printToFileCheckBox
;
112 // wxCheckBox* m_collateCopiesCheckBox;
114 wxPrintDialogData m_printDialogData
;
117 void Init(wxWindow
*parent
);
120 DECLARE_EVENT_TABLE()
123 class WXDLLEXPORT wxGenericPrintSetupDialog
: public wxDialog
125 DECLARE_CLASS(wxGenericPrintSetupDialog
)
128 // There are no configuration options for the dialog, so we
129 // just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
130 wxGenericPrintSetupDialog(wxWindow
*parent
, wxPrintData
* data
);
131 wxGenericPrintSetupDialog(wxWindow
*parent
, wxPrintSetupData
* data
);
132 virtual ~wxGenericPrintSetupDialog();
134 void Init(wxPrintData
* data
);
136 virtual bool TransferDataFromWindow();
137 virtual bool TransferDataToWindow();
139 wxChoice
*CreatePaperTypeChoice(int* x
, int* y
);
142 wxRadioBox
* m_orientationRadioBox
;
143 wxTextCtrl
* m_printerCommandText
;
144 wxTextCtrl
* m_printerOptionsText
;
145 wxCheckBox
* m_colourCheckBox
;
146 wxChoice
* m_paperTypeChoice
;
149 wxPrintData m_printData
;
150 wxPrintData
& GetPrintData() { return m_printData
; }
151 #endif // wxUSE_POSTSCRIPT
154 class WXDLLEXPORT wxGenericPageSetupDialog
: public wxDialog
156 DECLARE_CLASS(wxGenericPageSetupDialog
)
159 wxGenericPageSetupDialog(wxWindow
*parent
, wxPageSetupData
* data
= (wxPageSetupData
*) NULL
);
160 virtual ~wxGenericPageSetupDialog();
162 virtual bool TransferDataFromWindow();
163 virtual bool TransferDataToWindow();
165 void OnPrinter(wxCommandEvent
& event
);
167 wxChoice
*CreatePaperTypeChoice(int* x
, int* y
);
168 wxPageSetupData
& GetPageSetupData() { return m_pageData
; }
171 wxButton
* m_printerButton
;
172 wxRadioBox
* m_orientationRadioBox
;
173 wxTextCtrl
* m_marginLeftText
;
174 wxTextCtrl
* m_marginTopText
;
175 wxTextCtrl
* m_marginRightText
;
176 wxTextCtrl
* m_marginBottomText
;
177 wxChoice
* m_paperTypeChoice
;
179 static bool m_pageSetupDialogCancelled
;
181 wxPageSetupData m_pageData
;
184 DECLARE_EVENT_TABLE()