Generic file dialog presentation. Regenerated makefiles.
[wxWidgets.git] / samples / dialogs / dialogs.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dialogs.h
3 // Purpose: Common dialogs demo
4 // Author: Julian Smart
5 // Modified by: ABX (2004) - adjustementd for conditional building
6 // Created: 04/01/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __DIALOGSH__
13 #define __DIALOGSH__
14
15 #define USE_COLOURDLG_GENERIC \
16 ( \
17 wxUSE_COLOURDLG && \
18 ( defined(__WXMSW__) || defined(__WXMAC__) ) && \
19 !defined(__WXUNIVERSAL__) \
20 )
21
22
23 #define USE_DIRDLG_GENERIC \
24 ( \
25 wxUSE_DIRDLG && \
26 ( defined(__WXMSW__) || defined(__WXMAC__) ) && \
27 !defined(__WXUNIVERSAL__) \
28 )
29
30 #define USE_FILEDLG_GENERIC \
31 ( \
32 wxUSE_FILEDLG && \
33 ( defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXPM__) ) && \
34 !defined(__WXUNIVERSAL__) \
35 )
36
37 #define USE_FONTDLG_GENERIC \
38 ( \
39 wxUSE_FONTDLG && \
40 ( defined(__WXMSW__) || defined(__WXPM__) ) && \
41 !defined(__WXUNIVERSAL__) \
42 )
43
44
45 #define USE_MODAL_PRESENTATION 1
46
47 // Define a new application type
48 class MyApp: public wxApp
49 {
50 public:
51 bool OnInit();
52
53 wxFont m_canvasFont;
54 wxColour m_canvasTextColour;
55 };
56
57 // A custom modeless dialog
58 class MyModelessDialog : public wxDialog
59 {
60 public:
61 MyModelessDialog(wxWindow *parent);
62
63 void OnButton(wxCommandEvent& event);
64 void OnClose(wxCloseEvent& event);
65
66 private:
67 DECLARE_EVENT_TABLE()
68 };
69
70 // A custom modal dialog
71 class MyModalDialog : public wxDialog
72 {
73 public:
74 MyModalDialog(wxWindow *parent);
75
76 void OnButton(wxCommandEvent& event);
77
78 private:
79 wxButton *m_btnModal,
80 *m_btnModeless,
81 *m_btnDelete;
82
83 DECLARE_EVENT_TABLE()
84 };
85
86 // Define a new frame type
87 class MyFrame: public wxFrame
88 {
89 public:
90 MyFrame(wxWindow *parent, const wxString& title);
91
92 void MessageBox(wxCommandEvent& event);
93
94 #if wxUSE_COLOURDLG
95 void ChooseColour(wxCommandEvent& event);
96 #endif // wxUSE_COLOURDLG
97
98 #if wxUSE_FONTDLG
99 void ChooseFont(wxCommandEvent& event);
100 #endif // wxUSE_FONTDLG
101
102 #if wxUSE_LOG_DIALOG
103 void LogDialog(wxCommandEvent& event);
104 #endif // wxUSE_LOG_DIALOG
105
106 #if wxUSE_CHOICEDLG
107 void SingleChoice(wxCommandEvent& event);
108 void MultiChoice(wxCommandEvent& event);
109 #endif // wxUSE_CHOICEDLG
110
111 #if wxUSE_TEXTDLG
112 void TextEntry(wxCommandEvent& event);
113 void PasswordEntry(wxCommandEvent& event);
114 #endif // wxUSE_TEXTDLG
115
116 #if wxUSE_NUMBERDLG
117 void NumericEntry(wxCommandEvent& event);
118 #endif // wxUSE_NUMBERDLG
119
120 #if wxUSE_FILEDLG
121 void FileOpen(wxCommandEvent& event);
122 void FileOpen2(wxCommandEvent& event);
123 void FilesOpen(wxCommandEvent& event);
124 void FileSave(wxCommandEvent& event);
125 #endif // wxUSE_FILEDLG
126
127 #if USE_FILEDLG_GENERIC
128 void FileOpenGeneric(wxCommandEvent& event);
129 void FilesOpenGeneric(wxCommandEvent& event);
130 void FileSaveGeneric(wxCommandEvent& event);
131 #endif // USE_FILEDLG_GENERIC
132
133 #if wxUSE_DIRDLG
134 void DirChoose(wxCommandEvent& event);
135 void DirChooseNew(wxCommandEvent& event);
136 #endif // wxUSE_DIRDLG
137
138 #if USE_DIRDLG_GENERIC
139 void GenericDirChoose(wxCommandEvent& event);
140 #endif // USE_DIRDLG_GENERIC
141
142 #if wxUSE_STARTUP_TIPS
143 void ShowTip(wxCommandEvent& event);
144 #endif // wxUSE_STARTUP_TIPS
145
146 #if USE_MODAL_PRESENTATION
147 void ModalDlg(wxCommandEvent& event);
148 void ModelessDlg(wxCommandEvent& event);
149 #endif // USE_MODAL_PRESENTATION
150
151 #if wxUSE_PROGRESSDLG
152 void ShowProgress(wxCommandEvent& event);
153 #endif // wxUSE_PROGRESSDLG
154
155 #if wxUSE_BUSYINFO
156 void ShowBusyInfo(wxCommandEvent& event);
157 #endif // wxUSE_BUSYINFO
158
159 #if wxUSE_FINDREPLDLG
160 void ShowFindDialog(wxCommandEvent& event);
161 void ShowReplaceDialog(wxCommandEvent& event);
162 void OnFindDialog(wxFindDialogEvent& event);
163 #endif // wxUSE_FINDREPLDLG
164
165 #if USE_COLOURDLG_GENERIC
166 void ChooseColourGeneric(wxCommandEvent& event);
167 #endif // USE_COLOURDLG_GENERIC
168
169 #if USE_FONTDLG_GENERIC
170 void ChooseFontGeneric(wxCommandEvent& event);
171 #endif // USE_FONTDLG_GENERIC
172
173 void OnExit(wxCommandEvent& event);
174
175 private:
176 #if wxUSE_DIRDLG
177 void DoDirChoose(int style);
178 #endif // wxUSE_DIRDLG
179
180 #if USE_MODAL_PRESENTATION
181 MyModelessDialog *m_dialog;
182 #endif // USE_MODAL_PRESENTATION
183
184 #if wxUSE_FINDREPLDLG
185 wxFindReplaceData m_findData;
186
187 wxFindReplaceDialog *m_dlgFind,
188 *m_dlgReplace;
189 #endif // wxUSE_FINDREPLDLG
190
191 wxColourData m_clrData;
192
193 DECLARE_EVENT_TABLE()
194 };
195
196 class MyCanvas: public wxScrolledWindow
197 {
198 public:
199 MyCanvas(wxWindow *parent) :
200 wxScrolledWindow(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxNO_FULL_REPAINT_ON_RESIZE) { }
201
202 void OnPaint(wxPaintEvent& event);
203
204 DECLARE_EVENT_TABLE()
205 };
206
207
208 // Menu IDs
209 enum
210 {
211 DIALOGS_CHOOSE_COLOUR = wxID_HIGHEST,
212 DIALOGS_CHOOSE_COLOUR_GENERIC,
213 DIALOGS_CHOOSE_FONT,
214 DIALOGS_CHOOSE_FONT_GENERIC,
215 DIALOGS_MESSAGE_BOX,
216 DIALOGS_SINGLE_CHOICE,
217 DIALOGS_MULTI_CHOICE,
218 DIALOGS_TEXT_ENTRY,
219 DIALOGS_PASSWORD_ENTRY,
220 DIALOGS_FILE_OPEN,
221 DIALOGS_FILE_OPEN2,
222 DIALOGS_FILES_OPEN,
223 DIALOGS_FILE_SAVE,
224 DIALOGS_FILE_OPEN_GENERIC,
225 DIALOGS_FILES_OPEN_GENERIC,
226 DIALOGS_FILE_SAVE_GENERIC,
227 DIALOGS_DIR_CHOOSE,
228 DIALOGS_DIRNEW_CHOOSE,
229 DIALOGS_GENERIC_DIR_CHOOSE,
230 DIALOGS_TIP,
231 DIALOGS_NUM_ENTRY,
232 DIALOGS_LOG_DIALOG,
233 DIALOGS_MODAL,
234 DIALOGS_MODELESS,
235 DIALOGS_MODELESS_BTN,
236 DIALOGS_PROGRESS,
237 DIALOGS_BUSYINFO,
238 DIALOGS_FIND,
239 DIALOGS_REPLACE
240 };
241
242 #endif
243