1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGenericPrintDialog, wxGenericPrintSetupDialog,
4 // wxGenericPageSetupDialog
5 // Author: Julian Smart
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef __PRINTDLGH_G_
14 #define __PRINTDLGH_G_
16 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
17 #pragma interface "prntdlgg.h"
22 #if wxUSE_PRINTING_ARCHITECTURE
24 #include "wx/dialog.h"
25 #include "wx/cmndata.h"
26 #include "wx/printdlg.h"
32 class WXDLLEXPORT wxTextCtrl
;
33 class WXDLLEXPORT wxButton
;
34 class WXDLLEXPORT wxCheckBox
;
35 class WXDLLEXPORT wxComboBox
;
36 class WXDLLEXPORT wxStaticText
;
37 class WXDLLEXPORT wxRadioBox
;
38 class WXDLLEXPORT wxPrintSetupData
;
39 class WXDLLEXPORT wxPageSetupData
;
40 // ----------------------------------------------------------------------------
42 // ----------------------------------------------------------------------------
44 // FIXME why all these enums start with 10 or 30?
48 wxPRINTID_STATIC
= 10,
53 wxPRINTID_PRINTTOFILE
,
59 wxPRINTID_LEFTMARGIN
= 30,
60 wxPRINTID_RIGHTMARGIN
,
62 wxPRINTID_BOTTOMMARGIN
67 wxPRINTID_PRINTCOLOUR
= 10,
68 wxPRINTID_ORIENTATION
,
74 // ----------------------------------------------------------------------------
75 // Simulated Print and Print Setup dialogs for non-Windows platforms (and
76 // Windows using PostScript print/preview)
77 // ----------------------------------------------------------------------------
80 class WXDLLEXPORT wxGenericPrintDialog
: public wxPrintDialogBase
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()
124 DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog
)
127 class WXDLLEXPORT wxGenericPrintSetupDialog
: public wxDialog
130 // There are no configuration options for the dialog, so we
131 // just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
132 wxGenericPrintSetupDialog(wxWindow
*parent
, wxPrintData
* data
);
133 wxGenericPrintSetupDialog(wxWindow
*parent
, wxPrintSetupData
* data
);
134 virtual ~wxGenericPrintSetupDialog();
136 void Init(wxPrintData
* data
);
138 virtual bool TransferDataFromWindow();
139 virtual bool TransferDataToWindow();
141 wxComboBox
*CreatePaperTypeChoice(int* x
, int* y
);
144 wxRadioBox
* m_orientationRadioBox
;
145 wxTextCtrl
* m_printerCommandText
;
146 wxTextCtrl
* m_printerOptionsText
;
147 wxCheckBox
* m_colourCheckBox
;
148 wxComboBox
* m_paperTypeChoice
;
151 wxPrintData m_printData
;
152 wxPrintData
& GetPrintData() { return m_printData
; }
153 #endif // wxUSE_POSTSCRIPT
156 DECLARE_CLASS(wxGenericPrintSetupDialog
)
161 class WXDLLEXPORT wxGenericPageSetupDialog
: public wxDialog
164 wxGenericPageSetupDialog(wxWindow
*parent
= NULL
,
165 wxPageSetupData
* data
= NULL
);
166 virtual ~wxGenericPageSetupDialog();
168 virtual bool TransferDataFromWindow();
169 virtual bool TransferDataToWindow();
171 void OnPrinter(wxCommandEvent
& event
);
173 wxComboBox
*CreatePaperTypeChoice(int* x
, int* y
);
174 wxPageSetupData
& GetPageSetupData() { return m_pageData
; }
177 wxButton
* m_printerButton
;
178 wxRadioBox
* m_orientationRadioBox
;
179 wxTextCtrl
* m_marginLeftText
;
180 wxTextCtrl
* m_marginTopText
;
181 wxTextCtrl
* m_marginRightText
;
182 wxTextCtrl
* m_marginBottomText
;
183 wxComboBox
* m_paperTypeChoice
;
185 static bool m_pageSetupDialogCancelled
;
187 wxPageSetupData m_pageData
;
190 DECLARE_EVENT_TABLE()
191 DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericPageSetupDialog
)