1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        prntdlgg.h
3 // Purpose:     wxGenericPrintDialog, wxGenericPrintSetupDialog,
4 //              wxGenericPageSetupDialog
5 // Author:      Julian Smart
6 // Modified by:
7 // Created:     01/02/97
8 // RCS-ID:      $Id: prntdlgg.h,v 1.1 2006/12/02 15:58:29 scara Exp $
9 // Copyright:   (c)
10 // Licence:     wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
12 
13 #ifndef __PRINTDLGH_G_
14 #define __PRINTDLGH_G_
15 
16 #if defined(__GNUG__) && !defined(__APPLE__)
17     #pragma interface "prntdlgg.h"
18 #endif
19 
20 #include "wx/defs.h"
21 
22 #if wxUSE_PRINTING_ARCHITECTURE
23 
24 #include "wx/dialog.h"
25 #include "wx/cmndata.h"
26 
27 #if wxUSE_POSTSCRIPT
28     #include "wx/dcps.h"
29 #endif
30 
31 class WXDLLEXPORT wxTextCtrl;
32 class WXDLLEXPORT wxButton;
33 class WXDLLEXPORT wxCheckBox;
34 class WXDLLEXPORT wxComboBox;
35 class WXDLLEXPORT wxStaticText;
36 class WXDLLEXPORT wxRadioBox;
37 class WXDLLEXPORT wxPrintSetupData;
38 class WXDLLEXPORT wxPageSetupData;
39 // ----------------------------------------------------------------------------
40 // constants
41 // ----------------------------------------------------------------------------
42 
43 // FIXME why all these enums start with 10 or 30?
44 
45 enum
46 {
47     wxPRINTID_STATIC = 10,
48     wxPRINTID_RANGE,
49     wxPRINTID_FROM,
50     wxPRINTID_TO,
51     wxPRINTID_COPIES,
52     wxPRINTID_PRINTTOFILE,
53     wxPRINTID_SETUP
54 };
55 
56 enum
57 {
58     wxPRINTID_LEFTMARGIN = 30,
59     wxPRINTID_RIGHTMARGIN,
60     wxPRINTID_TOPMARGIN,
61     wxPRINTID_BOTTOMMARGIN
62 };
63 
64 enum
65 {
66     wxPRINTID_PRINTCOLOUR = 10,
67     wxPRINTID_ORIENTATION,
68     wxPRINTID_COMMAND,
69     wxPRINTID_OPTIONS,
70     wxPRINTID_PAPERSIZE
71 };
72 
73 // ----------------------------------------------------------------------------
74 // Simulated Print and Print Setup dialogs for non-Windows platforms (and
75 // Windows using PostScript print/preview)
76 // ----------------------------------------------------------------------------
77 
78 #if wxUSE_POSTSCRIPT
79 class WXDLLEXPORT wxGenericPrintDialog : public wxDialog
80 {
81 public:
82     wxGenericPrintDialog(wxWindow *parent,
83                          wxPrintDialogData* data = (wxPrintDialogData*)NULL);
84     wxGenericPrintDialog(wxWindow *parent, wxPrintData* data);
85 
86     virtual ~wxGenericPrintDialog();
87 
88     void OnSetup(wxCommandEvent& event);
89     void OnRange(wxCommandEvent& event);
90     void OnOK(wxCommandEvent& event);
91 
92     virtual bool TransferDataFromWindow();
93     virtual bool TransferDataToWindow();
94 
95     virtual int ShowModal();
96 
97 #if wxUSE_POSTSCRIPT
GetPrintData()98     wxPrintData& GetPrintData()
99         { return m_printDialogData.GetPrintData(); }
100 #endif // wxUSE_POSTSCRIPT
101 
GetPrintDialogData()102     wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
103     wxDC *GetPrintDC();
104 
105 public:
106 //    wxStaticText*       m_printerMessage;
107     wxButton*           m_setupButton;
108 //    wxButton*           m_helpButton;
109     wxRadioBox*         m_rangeRadioBox;
110     wxTextCtrl*         m_fromText;
111     wxTextCtrl*         m_toText;
112     wxTextCtrl*         m_noCopiesText;
113     wxCheckBox*         m_printToFileCheckBox;
114 //    wxCheckBox*         m_collateCopiesCheckBox;
115 
116     wxPrintDialogData   m_printDialogData;
117 
118 protected:
119     void Init(wxWindow *parent);
120 
121 private:
122     DECLARE_EVENT_TABLE()
123     DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
124 };
125 
126 class WXDLLEXPORT wxGenericPrintSetupDialog : public wxDialog
127 {
128 public:
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();
134 
135     void Init(wxPrintData* data);
136 
137     virtual bool TransferDataFromWindow();
138     virtual bool TransferDataToWindow();
139 
140     wxComboBox *CreatePaperTypeChoice(int* x, int* y);
141 
142 public:
143     wxRadioBox*         m_orientationRadioBox;
144     wxTextCtrl*         m_printerCommandText;
145     wxTextCtrl*         m_printerOptionsText;
146     wxCheckBox*         m_colourCheckBox;
147     wxComboBox*           m_paperTypeChoice;
148 
149 #if wxUSE_POSTSCRIPT
150     wxPrintData         m_printData;
GetPrintData()151     wxPrintData&        GetPrintData() { return m_printData; }
152 #endif // wxUSE_POSTSCRIPT
153 
154 private:
155     DECLARE_CLASS(wxGenericPrintSetupDialog)
156 };
157 #endif
158     // wxUSE_POSTSCRIPT
159 
160 class WXDLLEXPORT wxGenericPageSetupDialog : public wxDialog
161 {
162 public:
163     wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data = (wxPageSetupData*) NULL);
164     virtual ~wxGenericPageSetupDialog();
165 
166     virtual bool TransferDataFromWindow();
167     virtual bool TransferDataToWindow();
168 
169     void OnPrinter(wxCommandEvent& event);
170 
171     wxComboBox *CreatePaperTypeChoice(int* x, int* y);
GetPageSetupData()172     wxPageSetupData& GetPageSetupData() { return m_pageData; }
173 
174 public:
175     wxButton*       m_printerButton;
176     wxRadioBox*     m_orientationRadioBox;
177     wxTextCtrl*     m_marginLeftText;
178     wxTextCtrl*     m_marginTopText;
179     wxTextCtrl*     m_marginRightText;
180     wxTextCtrl*     m_marginBottomText;
181     wxComboBox*       m_paperTypeChoice;
182 
183     static bool     m_pageSetupDialogCancelled;
184 
185     wxPageSetupData m_pageData;
186 
187 private:
188     DECLARE_EVENT_TABLE()
189     DECLARE_CLASS(wxGenericPageSetupDialog)
190 };
191 
192 #endif
193 
194 #endif
195 // __PRINTDLGH_G__
196