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 // ----------------------------------------------------------------------------
76 class WXDLLEXPORT wxGenericPrintDialog
: public wxDialog
78 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog
)
81 wxGenericPrintDialog(wxWindow
*parent
,
82 wxPrintDialogData
* data
= (wxPrintDialogData
*)NULL
);
83 wxGenericPrintDialog(wxWindow
*parent
, wxPrintData
* data
);
85 virtual ~wxGenericPrintDialog();
87 void OnSetup(wxCommandEvent
& event
);
88 void OnRange(wxCommandEvent
& event
);
89 void OnOK(wxCommandEvent
& event
);
91 virtual bool TransferDataFromWindow();
92 virtual bool TransferDataToWindow();
94 virtual int ShowModal();
97 wxPrintData
& GetPrintData()
98 { return m_printDialogData
.GetPrintData(); }
99 #endif // wxUSE_POSTSCRIPT
101 wxPrintDialogData
& GetPrintDialogData() { return m_printDialogData
; }
105 // wxStaticText* m_printerMessage;
106 wxButton
* m_setupButton
;
107 // wxButton* m_helpButton;
108 wxRadioBox
* m_rangeRadioBox
;
109 wxTextCtrl
* m_fromText
;
110 wxTextCtrl
* m_toText
;
111 wxTextCtrl
* m_noCopiesText
;
112 wxCheckBox
* m_printToFileCheckBox
;
113 // wxCheckBox* m_collateCopiesCheckBox;
115 wxPrintDialogData m_printDialogData
;
118 void Init(wxWindow
*parent
);
121 DECLARE_EVENT_TABLE()
124 class WXDLLEXPORT wxGenericPrintSetupDialog
: public wxDialog
126 DECLARE_CLASS(wxGenericPrintSetupDialog
)
129 // There are no configuration options for the dialog, so we
130 // just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
131 wxGenericPrintSetupDialog(wxWindow
*parent
, wxPrintData
* data
);
132 wxGenericPrintSetupDialog(wxWindow
*parent
, wxPrintSetupData
* data
);
133 virtual ~wxGenericPrintSetupDialog();
135 void Init(wxPrintData
* data
);
137 virtual bool TransferDataFromWindow();
138 virtual bool TransferDataToWindow();
140 wxChoice
*CreatePaperTypeChoice(int* x
, int* y
);
143 wxRadioBox
* m_orientationRadioBox
;
144 wxTextCtrl
* m_printerCommandText
;
145 wxTextCtrl
* m_printerOptionsText
;
146 wxCheckBox
* m_colourCheckBox
;
147 wxChoice
* m_paperTypeChoice
;
150 wxPrintData m_printData
;
151 wxPrintData
& GetPrintData() { return m_printData
; }
152 #endif // wxUSE_POSTSCRIPT
157 class WXDLLEXPORT wxGenericPageSetupDialog
: public wxDialog
159 DECLARE_CLASS(wxGenericPageSetupDialog
)
162 wxGenericPageSetupDialog(wxWindow
*parent
, wxPageSetupData
* data
= (wxPageSetupData
*) NULL
);
163 virtual ~wxGenericPageSetupDialog();
165 virtual bool TransferDataFromWindow();
166 virtual bool TransferDataToWindow();
168 void OnPrinter(wxCommandEvent
& event
);
170 wxChoice
*CreatePaperTypeChoice(int* x
, int* y
);
171 wxPageSetupData
& GetPageSetupData() { return m_pageData
; }
174 wxButton
* m_printerButton
;
175 wxRadioBox
* m_orientationRadioBox
;
176 wxTextCtrl
* m_marginLeftText
;
177 wxTextCtrl
* m_marginTopText
;
178 wxTextCtrl
* m_marginRightText
;
179 wxTextCtrl
* m_marginBottomText
;
180 wxChoice
* m_paperTypeChoice
;
182 static bool m_pageSetupDialogCancelled
;
184 wxPageSetupData m_pageData
;
187 DECLARE_EVENT_TABLE()