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"
22 #if wxUSE_PRINTING_ARCHITECTURE
24 #include "wx/dialog.h"
30 class WXDLLEXPORT wxTextCtrl
;
31 class WXDLLEXPORT wxButton
;
32 class WXDLLEXPORT wxCheckBox
;
33 class WXDLLEXPORT wxComboBox
;
34 class WXDLLEXPORT wxStaticText
;
35 class WXDLLEXPORT wxRadioBox
;
36 class WXDLLEXPORT wxPrintSetupData
;
38 // ----------------------------------------------------------------------------
40 // ----------------------------------------------------------------------------
42 // FIXME why all these enums start with 10 or 30?
46 wxPRINTID_STATIC
= 10,
51 wxPRINTID_PRINTTOFILE
,
57 wxPRINTID_LEFTMARGIN
= 30,
58 wxPRINTID_RIGHTMARGIN
,
60 wxPRINTID_BOTTOMMARGIN
65 wxPRINTID_PRINTCOLOUR
= 10,
66 wxPRINTID_ORIENTATION
,
72 // ----------------------------------------------------------------------------
73 // Simulated Print and Print Setup dialogs for non-Windows platforms (and
74 // Windows using PostScript print/preview)
75 // ----------------------------------------------------------------------------
78 class WXDLLEXPORT wxGenericPrintDialog
: public wxDialog
80 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog
)
83 wxGenericPrintDialog(wxWindow
*parent
,
84 wxPrintDialogData
* data
= (wxPrintDialogData
*)NULL
);
85 wxGenericPrintDialog(wxWindow
*parent
, wxPrintData
* data
);
87 virtual ~wxGenericPrintDialog();
89 void OnSetup(wxCommandEvent
& event
);
90 void OnRange(wxCommandEvent
& event
);
91 void OnOK(wxCommandEvent
& event
);
93 virtual bool TransferDataFromWindow();
94 virtual bool TransferDataToWindow();
96 virtual int ShowModal();
99 wxPrintData
& GetPrintData()
100 { return m_printDialogData
.GetPrintData(); }
101 #endif // wxUSE_POSTSCRIPT
103 wxPrintDialogData
& GetPrintDialogData() { return m_printDialogData
; }
107 // wxStaticText* m_printerMessage;
108 wxButton
* m_setupButton
;
109 // wxButton* m_helpButton;
110 wxRadioBox
* m_rangeRadioBox
;
111 wxTextCtrl
* m_fromText
;
112 wxTextCtrl
* m_toText
;
113 wxTextCtrl
* m_noCopiesText
;
114 wxCheckBox
* m_printToFileCheckBox
;
115 // wxCheckBox* m_collateCopiesCheckBox;
117 wxPrintDialogData m_printDialogData
;
120 void Init(wxWindow
*parent
);
123 DECLARE_EVENT_TABLE()
126 class WXDLLEXPORT wxGenericPrintSetupDialog
: public wxDialog
128 DECLARE_CLASS(wxGenericPrintSetupDialog
)
131 // There are no configuration options for the dialog, so we
132 // just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
133 wxGenericPrintSetupDialog(wxWindow
*parent
, wxPrintData
* data
);
134 wxGenericPrintSetupDialog(wxWindow
*parent
, wxPrintSetupData
* data
);
135 virtual ~wxGenericPrintSetupDialog();
137 void Init(wxPrintData
* data
);
139 virtual bool TransferDataFromWindow();
140 virtual bool TransferDataToWindow();
142 wxComboBox
*CreatePaperTypeChoice(int* x
, int* y
);
145 wxRadioBox
* m_orientationRadioBox
;
146 wxTextCtrl
* m_printerCommandText
;
147 wxTextCtrl
* m_printerOptionsText
;
148 wxCheckBox
* m_colourCheckBox
;
149 wxComboBox
* m_paperTypeChoice
;
152 wxPrintData m_printData
;
153 wxPrintData
& GetPrintData() { return m_printData
; }
154 #endif // wxUSE_POSTSCRIPT
159 class WXDLLEXPORT wxGenericPageSetupDialog
: public wxDialog
161 DECLARE_CLASS(wxGenericPageSetupDialog
)
164 wxGenericPageSetupDialog(wxWindow
*parent
, wxPageSetupData
* data
= (wxPageSetupData
*) NULL
);
165 virtual ~wxGenericPageSetupDialog();
167 virtual bool TransferDataFromWindow();
168 virtual bool TransferDataToWindow();
170 void OnPrinter(wxCommandEvent
& event
);
172 wxComboBox
*CreatePaperTypeChoice(int* x
, int* y
);
173 wxPageSetupData
& GetPageSetupData() { return m_pageData
; }
176 wxButton
* m_printerButton
;
177 wxRadioBox
* m_orientationRadioBox
;
178 wxTextCtrl
* m_marginLeftText
;
179 wxTextCtrl
* m_marginTopText
;
180 wxTextCtrl
* m_marginRightText
;
181 wxTextCtrl
* m_marginBottomText
;
182 wxComboBox
* m_paperTypeChoice
;
184 static bool m_pageSetupDialogCancelled
;
186 wxPageSetupData m_pageData
;
189 DECLARE_EVENT_TABLE()