]>
Commit | Line | Data |
---|---|---|
7bf85405 | 1 | ///////////////////////////////////////////////////////////////////////////// |
d14a1e28 RD |
2 | // Name: _cmndlgs.i |
3 | // Purpose: SWIG interface for the "Common Dialog" classes | |
7bf85405 RD |
4 | // |
5 | // Author: Robin Dunn | |
6 | // | |
d14a1e28 | 7 | // Created: 25-July-1998 |
7bf85405 | 8 | // RCS-ID: $Id$ |
d14a1e28 | 9 | // Copyright: (c) 2003 by Total Control Software |
7bf85405 RD |
10 | // Licence: wxWindows license |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
d14a1e28 | 13 | // Not a %module |
7bf85405 | 14 | |
7bf85405 | 15 | |
d14a1e28 RD |
16 | //--------------------------------------------------------------------------- |
17 | %newgroup | |
7bf85405 | 18 | |
b2dc1044 RD |
19 | MAKE_CONST_WXSTRING(FileSelectorPromptStr); |
20 | MAKE_CONST_WXSTRING(DirSelectorPromptStr); | |
21 | MAKE_CONST_WXSTRING(DirDialogNameStr); | |
22 | MAKE_CONST_WXSTRING(FileSelectorDefaultWildcardStr); | |
23 | MAKE_CONST_WXSTRING(GetTextFromUserPromptStr); | |
24 | MAKE_CONST_WXSTRING(MessageBoxCaptionStr); | |
137b5242 | 25 | |
d14a1e28 RD |
26 | //--------------------------------------------------------------------------- |
27 | ||
137b5242 | 28 | |
fcafa8a9 | 29 | DocStr(wxColourData, |
dce2bd22 RD |
30 | "This class holds a variety of information related to the colour |
31 | chooser dialog, used to transfer settings and results to and from the | |
d07d2bc9 | 32 | `wx.ColourDialog`.", ""); |
d0e2ede0 | 33 | |
9416aa89 | 34 | class wxColourData : public wxObject { |
7bf85405 | 35 | public: |
fcafa8a9 RD |
36 | DocCtorStr( |
37 | wxColourData(), | |
d07d2bc9 | 38 | "Constructor, sets default values.", ""); |
d0e2ede0 | 39 | |
7bf85405 RD |
40 | ~wxColourData(); |
41 | ||
d0e2ede0 | 42 | |
fcafa8a9 RD |
43 | DocDeclStr( |
44 | bool , GetChooseFull(), | |
dce2bd22 RD |
45 | "Under Windows, determines whether the Windows colour dialog will |
46 | display the full dialog with custom colour selection controls. Has no | |
d07d2bc9 | 47 | meaning under other platforms. The default value is true.", ""); |
d0e2ede0 | 48 | |
fcafa8a9 RD |
49 | DocDeclStr( |
50 | wxColour , GetColour(), | |
d07d2bc9 | 51 | "Gets the colour (pre)selected by the dialog.", ""); |
d0e2ede0 | 52 | |
fcafa8a9 RD |
53 | DocDeclStr( |
54 | wxColour , GetCustomColour(int i), | |
dce2bd22 RD |
55 | "Gets the i'th custom colour associated with the colour dialog. i |
56 | should be an integer between 0 and 15. The default custom colours are | |
da397248 | 57 | all invalid colours.", ""); |
d0e2ede0 | 58 | |
fcafa8a9 RD |
59 | DocDeclStr( |
60 | void , SetChooseFull(int flag), | |
dce2bd22 RD |
61 | "Under Windows, tells the Windows colour dialog to display the full |
62 | dialog with custom colour selection controls. Under other platforms, | |
d07d2bc9 | 63 | has no effect. The default value is true.", ""); |
d0e2ede0 | 64 | |
fcafa8a9 RD |
65 | DocDeclStr( |
66 | void , SetColour(const wxColour& colour), | |
dce2bd22 | 67 | "Sets the default colour for the colour dialog. The default colour is |
d07d2bc9 | 68 | black.", ""); |
d0e2ede0 | 69 | |
fcafa8a9 RD |
70 | DocDeclStr( |
71 | void , SetCustomColour(int i, const wxColour& colour), | |
dce2bd22 | 72 | "Sets the i'th custom colour for the colour dialog. i should be an |
da397248 | 73 | integer between 0 and 15. The default custom colours are all invalid colours.", ""); |
d0e2ede0 | 74 | |
7bf85405 RD |
75 | }; |
76 | ||
77 | ||
dce2bd22 RD |
78 | |
79 | ||
fcafa8a9 | 80 | DocStr(wxColourDialog, |
d07d2bc9 | 81 | "This class represents the colour chooser dialog.", ""); |
fcafa8a9 | 82 | |
ab1f7d2a RD |
83 | MustHaveApp(wxColourDialog); |
84 | ||
7bf85405 RD |
85 | class wxColourDialog : public wxDialog { |
86 | public: | |
2b9048c5 | 87 | %pythonAppend wxColourDialog "self._setOORInfo(self)" |
7bf85405 | 88 | |
fcafa8a9 RD |
89 | DocCtorStr( |
90 | wxColourDialog(wxWindow* parent, wxColourData* data = NULL), | |
dce2bd22 RD |
91 | "Constructor. Pass a parent window, and optionally a `wx.ColourData`, |
92 | which will be copied to the colour dialog's internal ColourData | |
d07d2bc9 | 93 | instance.", ""); |
0122b7e3 | 94 | |
fcafa8a9 RD |
95 | DocDeclStr( |
96 | wxColourData& , GetColourData(), | |
d07d2bc9 | 97 | "Returns a reference to the `wx.ColourData` used by the dialog.", ""); |
7bf85405 RD |
98 | }; |
99 | ||
100 | ||
1979aa58 RD |
101 | wxColour wxGetColourFromUser(wxWindow *parent = (wxWindow *)NULL, |
102 | const wxColour& colInit = wxNullColour, | |
103 | const wxString& caption = wxPyEmptyString); | |
104 | ||
105 | ||
d14a1e28 | 106 | //-------------------------------------------------------------------------------- |
7bf85405 | 107 | |
d0e2ede0 RD |
108 | enum { |
109 | wxDD_NEW_DIR_BUTTON, | |
110 | wxDD_DEFAULT_STYLE, | |
111 | wxDD_CHANGE_DIR, | |
112 | }; | |
fcafa8a9 RD |
113 | |
114 | DocStr(wxDirDialog, | |
dce2bd22 | 115 | "wx.DirDialog allows the user to select a directory by browising the |
d07d2bc9 | 116 | file system.", " |
dce2bd22 RD |
117 | |
118 | Window Styles | |
119 | -------------- | |
120 | ==================== ========================================== | |
d0e2ede0 RD |
121 | wx.DD_DEFAULT_STYLE Equivalent to a combination of |
122 | wx.DEFAULT_DIALOG_STYLE, wx.DD_NEW_DIR_BUTTON | |
123 | and wx.RESIZE_BORDER. | |
124 | ||
dce2bd22 RD |
125 | wx.DD_NEW_DIR_BUTTON Add 'Create new directory' button and allow |
126 | directory names to be editable. On Windows | |
127 | the new directory button is only available | |
128 | with recent versions of the common dialogs. | |
d0e2ede0 RD |
129 | |
130 | wx.DD_CHANGE_DIR Change the current working directory to the | |
131 | directory chosen by the user. | |
dce2bd22 RD |
132 | ==================== ========================================== |
133 | "); | |
fcafa8a9 | 134 | |
ab1f7d2a RD |
135 | MustHaveApp(wxDirDialog); |
136 | ||
7bf85405 RD |
137 | class wxDirDialog : public wxDialog { |
138 | public: | |
2b9048c5 | 139 | %pythonAppend wxDirDialog "self._setOORInfo(self)" |
41d4305c | 140 | %pythonAppend wxDirDialog() "" |
d0e2ede0 | 141 | |
fcafa8a9 RD |
142 | DocCtorStr( |
143 | wxDirDialog(wxWindow* parent, | |
144 | const wxString& message = wxPyDirSelectorPromptStr, | |
145 | const wxString& defaultPath = wxPyEmptyString, | |
d0e2ede0 | 146 | long style = wxDD_DEFAULT_STYLE, |
fcafa8a9 RD |
147 | const wxPoint& pos = wxDefaultPosition, |
148 | const wxSize& size = wxDefaultSize, | |
149 | const wxString& name = wxPyDirDialogNameStr), | |
d07d2bc9 | 150 | "Constructor. Use ShowModal method to show the dialog.", ""); |
fcafa8a9 | 151 | |
2daad280 RD |
152 | // %RenameCtor(PreDirDialog, wxDirDialog()); |
153 | ||
154 | // bool Create(wxWindow *parent, | |
155 | // const wxString& title = wxDirSelectorPromptStr, | |
156 | // const wxString& defaultPath = wxEmptyString, | |
157 | // long style = wxDD_DEFAULT_STYLE, | |
158 | // const wxPoint& pos = wxDefaultPosition, | |
159 | // const wxSize& sz = wxDefaultSize, | |
160 | // const wxString& name = wxPyDirDialogNameStr); | |
fcafa8a9 RD |
161 | |
162 | DocDeclStr( | |
163 | wxString , GetPath(), | |
d07d2bc9 | 164 | "Returns the default or user-selected path.", ""); |
d0e2ede0 | 165 | |
fcafa8a9 RD |
166 | DocDeclStr( |
167 | wxString , GetMessage(), | |
d07d2bc9 | 168 | "Returns the message that will be displayed on the dialog.", ""); |
d0e2ede0 | 169 | |
fcafa8a9 RD |
170 | DocDeclStr( |
171 | void , SetMessage(const wxString& message), | |
d07d2bc9 | 172 | "Sets the message that will be displayed on the dialog.", ""); |
d0e2ede0 | 173 | |
fcafa8a9 RD |
174 | DocDeclStr( |
175 | void , SetPath(const wxString& path), | |
d07d2bc9 | 176 | "Sets the default path.", ""); |
d0e2ede0 | 177 | |
7bf85405 RD |
178 | }; |
179 | ||
68320e40 | 180 | |
d14a1e28 | 181 | //--------------------------------------------------------------------------- |
7bf85405 | 182 | |
16182b7b RD |
183 | %{ |
184 | // for compatibility only | |
185 | #define wxHIDE_READONLY 0 | |
186 | %} | |
187 | ||
d0e2ede0 RD |
188 | enum { |
189 | // These will dissappear in 2.8 | |
190 | wxOPEN, | |
191 | wxSAVE, | |
d0e2ede0 RD |
192 | wxOVERWRITE_PROMPT, |
193 | wxFILE_MUST_EXIST, | |
194 | wxMULTIPLE, | |
195 | wxCHANGE_DIR, | |
16182b7b | 196 | wxHIDE_READONLY, |
d0e2ede0 RD |
197 | |
198 | wxFD_OPEN, | |
199 | wxFD_SAVE, | |
200 | wxFD_OVERWRITE_PROMPT, | |
201 | wxFD_FILE_MUST_EXIST, | |
202 | wxFD_MULTIPLE, | |
203 | wxFD_CHANGE_DIR, | |
6aaca5ba | 204 | wxFD_PREVIEW, |
d0e2ede0 RD |
205 | wxFD_DEFAULT_STYLE, |
206 | }; | |
207 | ||
fcafa8a9 | 208 | DocStr(wxFileDialog, |
dce2bd22 | 209 | "wx.FileDialog allows the user to select one or more files from the |
d07d2bc9 | 210 | filesystem.", " |
dce2bd22 RD |
211 | |
212 | In Windows, this is the common file selector dialog. On X based | |
213 | platforms a generic alternative is used. The path and filename are | |
214 | distinct elements of a full file pathname. If path is \"\", the | |
215 | current directory will be used. If filename is \"\", no default | |
216 | filename will be supplied. The wildcard determines what files are | |
217 | displayed in the file selector, and file extension supplies a type | |
218 | extension for the required filename. | |
219 | ||
220 | Both the X and Windows versions implement a wildcard filter. Typing a | |
d07d2bc9 | 221 | filename containing wildcards (\*, ?) in the filename text item, and |
dce2bd22 RD |
222 | clicking on Ok, will result in only those files matching the pattern |
223 | being displayed. The wildcard may be a specification for multiple | |
224 | types of file with a description for each, such as:: | |
fcafa8a9 RD |
225 | |
226 | \"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif\" | |
227 | ||
dce2bd22 RD |
228 | |
229 | Window Styles | |
230 | -------------- | |
d0e2ede0 RD |
231 | ====================== ========================================== |
232 | wx.FD_OPEN This is an open dialog. | |
fcafa8a9 | 233 | |
d0e2ede0 | 234 | wx.FD_SAVE This is a save dialog. |
fcafa8a9 | 235 | |
d0e2ede0 RD |
236 | wx.FD_OVERWRITE_PROMPT For save dialog only: prompt for a confirmation |
237 | if a file will be overwritten. | |
fcafa8a9 | 238 | |
d0e2ede0 RD |
239 | wx.FD_MULTIPLE For open dialog only: allows selecting multiple |
240 | files. | |
fcafa8a9 | 241 | |
d0e2ede0 RD |
242 | wx.FD_CHANGE_DIR Change the current working directory to the |
243 | directory where the file(s) chosen by the user | |
244 | are. | |
245 | ====================== ========================================== | |
fcafa8a9 RD |
246 | "); |
247 | ||
248 | ||
249 | ||
ab1f7d2a RD |
250 | MustHaveApp(wxFileDialog); |
251 | ||
7bf85405 RD |
252 | class wxFileDialog : public wxDialog { |
253 | public: | |
2b9048c5 | 254 | %pythonAppend wxFileDialog "self._setOORInfo(self)" |
fcafa8a9 RD |
255 | |
256 | DocCtorStr( | |
257 | wxFileDialog(wxWindow* parent, | |
258 | const wxString& message = wxPyFileSelectorPromptStr, | |
259 | const wxString& defaultDir = wxPyEmptyString, | |
260 | const wxString& defaultFile = wxPyEmptyString, | |
261 | const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr, | |
d0e2ede0 | 262 | long style = wxFD_DEFAULT_STYLE, |
fcafa8a9 | 263 | const wxPoint& pos = wxDefaultPosition), |
d07d2bc9 | 264 | "Constructor. Use ShowModal method to show the dialog.", ""); |
fcafa8a9 RD |
265 | |
266 | ||
267 | DocDeclStr( | |
268 | void , SetMessage(const wxString& message), | |
d07d2bc9 | 269 | "Sets the message that will be displayed on the dialog.", ""); |
d0e2ede0 | 270 | |
fcafa8a9 RD |
271 | DocDeclStr( |
272 | void , SetPath(const wxString& path), | |
dce2bd22 | 273 | "Sets the path (the combined directory and filename that will be |
d07d2bc9 | 274 | returned when the dialog is dismissed).", ""); |
d0e2ede0 | 275 | |
fcafa8a9 RD |
276 | DocDeclStr( |
277 | void , SetDirectory(const wxString& dir), | |
d07d2bc9 | 278 | "Sets the default directory.", ""); |
d0e2ede0 | 279 | |
fcafa8a9 RD |
280 | DocDeclStr( |
281 | void , SetFilename(const wxString& name), | |
d07d2bc9 | 282 | "Sets the default filename.", ""); |
d0e2ede0 | 283 | |
fcafa8a9 RD |
284 | DocDeclStr( |
285 | void , SetWildcard(const wxString& wildCard), | |
dce2bd22 RD |
286 | "Sets the wildcard, which can contain multiple file types, for |
287 | example:: | |
288 | ||
289 | \"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif\" | |
d07d2bc9 | 290 | ", ""); |
d0e2ede0 | 291 | |
fcafa8a9 RD |
292 | DocDeclStr( |
293 | void , SetFilterIndex(int filterIndex), | |
d07d2bc9 | 294 | "Sets the default filter index, starting from zero.", ""); |
d0e2ede0 | 295 | |
fcafa8a9 RD |
296 | DocDeclStr( |
297 | wxString , GetMessage() const, | |
d07d2bc9 | 298 | "Returns the message that will be displayed on the dialog.", ""); |
d0e2ede0 | 299 | |
fcafa8a9 RD |
300 | DocDeclStr( |
301 | wxString , GetPath() const, | |
d07d2bc9 | 302 | "Returns the full path (directory and filename) of the selected file.", ""); |
d0e2ede0 | 303 | |
fcafa8a9 RD |
304 | DocDeclStr( |
305 | wxString , GetDirectory() const, | |
d07d2bc9 | 306 | "Returns the default directory.", ""); |
d0e2ede0 | 307 | |
fcafa8a9 RD |
308 | DocDeclStr( |
309 | wxString , GetFilename() const, | |
d07d2bc9 | 310 | "Returns the default filename.", ""); |
d0e2ede0 | 311 | |
fcafa8a9 RD |
312 | DocDeclStr( |
313 | wxString , GetWildcard() const, | |
d07d2bc9 | 314 | "Returns the file dialog wildcard.", ""); |
d0e2ede0 | 315 | |
fcafa8a9 RD |
316 | DocDeclStr( |
317 | int , GetFilterIndex() const, | |
dce2bd22 RD |
318 | "Returns the index into the list of filters supplied, optionally, in |
319 | the wildcard parameter. Before the dialog is shown, this is the index | |
320 | which will be used when the dialog is first displayed. After the | |
d07d2bc9 | 321 | dialog is shown, this is the index selected by the user.", ""); |
f6bcfd97 | 322 | |
fcafa8a9 | 323 | |
214c4fbe RD |
324 | %extend { |
325 | DocStr(GetFilenames, | |
326 | "Returns a list of filenames chosen in the dialog. This function | |
dce2bd22 | 327 | should only be used with the dialogs which have wx.MULTIPLE style, use |
d07d2bc9 | 328 | GetFilename for the others.", ""); |
f6bcfd97 BP |
329 | PyObject* GetFilenames() { |
330 | wxArrayString arr; | |
331 | self->GetFilenames(arr); | |
b37c7e1d | 332 | return wxArrayString2PyList_helper(arr); |
f6bcfd97 BP |
333 | } |
334 | ||
214c4fbe RD |
335 | DocStr(GetPaths, |
336 | "Fills the array paths with the full paths of the files chosen. This | |
337 | function should only be used with the dialogs which have wx.MULTIPLE | |
d0e2ede0 RD |
338 | style, use GetPath for the others.", ""); |
339 | ||
f6bcfd97 BP |
340 | PyObject* GetPaths() { |
341 | wxArrayString arr; | |
342 | self->GetPaths(arr); | |
b37c7e1d | 343 | return wxArrayString2PyList_helper(arr); |
f6bcfd97 BP |
344 | } |
345 | } | |
3ef86e32 RD |
346 | |
347 | // TODO | |
348 | // // Utility functions | |
349 | ||
350 | // // Parses the wildCard, returning the number of filters. | |
351 | // // Returns 0 if none or if there's a problem, | |
352 | // // The arrays will contain an equal number of items found before the error. | |
353 | // // wildCard is in the form: | |
354 | // // "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png" | |
355 | // static int ParseWildcard(const wxString& wildCard, | |
356 | // wxArrayString& descriptions, | |
357 | // wxArrayString& filters); | |
358 | ||
359 | // // Append first extension to filePath from a ';' separated extensionList | |
360 | // // if filePath = "path/foo.bar" just return it as is | |
361 | // // if filePath = "foo[.]" and extensionList = "*.jpg;*.png" return "foo.jpg" | |
362 | // // if the extension is "*.j?g" (has wildcards) or "jpg" then return filePath | |
363 | // static wxString AppendExtension(const wxString &filePath, | |
364 | // const wxString &extensionList); | |
365 | ||
366 | ||
7bf85405 RD |
367 | }; |
368 | ||
369 | ||
d14a1e28 | 370 | //--------------------------------------------------------------------------- |
7bf85405 | 371 | |
293a0a86 RD |
372 | enum { wxCHOICEDLG_STYLE }; |
373 | ||
e5868095 RD |
374 | |
375 | DocStr(wxMultiChoiceDialog, | |
d07d2bc9 | 376 | "A simple dialog with a multi selection listbox.", ""); |
e5868095 | 377 | |
ab1f7d2a RD |
378 | MustHaveApp(wxMultiChoiceDialog); |
379 | ||
293a0a86 RD |
380 | class wxMultiChoiceDialog : public wxDialog |
381 | { | |
382 | public: | |
2b9048c5 | 383 | %pythonAppend wxMultiChoiceDialog "self._setOORInfo(self)" |
293a0a86 | 384 | |
e5868095 RD |
385 | DocCtorAStr( |
386 | wxMultiChoiceDialog(wxWindow *parent, | |
387 | const wxString& message, | |
388 | const wxString& caption, | |
d5573410 | 389 | int choices=0, wxString* choices_array=NULL, |
e5868095 RD |
390 | long style = wxCHOICEDLG_STYLE, |
391 | const wxPoint& pos = wxDefaultPosition), | |
870b7ef0 | 392 | "__init__(self, Window parent, String message, String caption, |
40a0d6ca | 393 | List choices=EmptyList, long style=CHOICEDLG_STYLE, |
dce2bd22 | 394 | Point pos=DefaultPosition) -> MultiChoiceDialog", |
870b7ef0 RD |
395 | "Constructor. Use the `ShowModal` method to show the dialog. |
396 | ||
397 | :param parent: The parent window. | |
398 | :param message: Text to display above the list of selections. | |
399 | :param caption: Text to use in the title bar of the dialog. | |
400 | :param choices: A list of strings or unicode objects that the | |
401 | user is allowed to choose from. | |
402 | :param style: Styles to apply to the dialog. The default value is | |
403 | equivallent to wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.OK|wx.CANCEL|wx.CENTER. | |
404 | :param pos: Where to position the dialog (not used on Windows) | |
405 | ||
406 | ", ""); | |
e5868095 | 407 | |
d0e2ede0 | 408 | |
e5868095 RD |
409 | DocDeclAStr( |
410 | void, SetSelections(const wxArrayInt& selections), | |
411 | "SetSelections(List selections)", | |
dce2bd22 | 412 | "Specify the items in the list that should be selected, using a list of |
870b7ef0 RD |
413 | integers. The list should specify the indexes of the items that |
414 | should be selected.", ""); | |
293a0a86 | 415 | |
e5868095 RD |
416 | DocAStr(GetSelections, |
417 | "GetSelections() -> [selections]", | |
870b7ef0 RD |
418 | "Returns a list of integers representing the items that are selected. |
419 | If an item is selected then its index will appear in the list.", ""); | |
d14a1e28 | 420 | %extend { |
293a0a86 RD |
421 | PyObject* GetSelections() { |
422 | return wxArrayInt2PyList_helper(self->GetSelections()); | |
423 | } | |
424 | } | |
425 | }; | |
426 | ||
7bf85405 | 427 | |
d14a1e28 | 428 | //--------------------------------------------------------------------------- |
7bf85405 | 429 | |
e5868095 | 430 | DocStr(wxSingleChoiceDialog, |
d07d2bc9 | 431 | "A simple dialog with a single selection listbox.", ""); |
e5868095 | 432 | |
ab1f7d2a RD |
433 | MustHaveApp(wxSingleChoiceDialog); |
434 | ||
7bf85405 RD |
435 | class wxSingleChoiceDialog : public wxDialog { |
436 | public: | |
2b9048c5 | 437 | %pythonAppend wxSingleChoiceDialog "self._setOORInfo(self)" |
e5868095 RD |
438 | |
439 | DocAStr(wxSingleChoiceDialog, | |
dce2bd22 | 440 | "__init__(Window parent, String message, String caption, |
40a0d6ca | 441 | List choices=EmptyList, long style=CHOICEDLG_STYLE, |
dce2bd22 | 442 | Point pos=DefaultPosition) -> SingleChoiceDialog", |
d07d2bc9 | 443 | "Constructor. Use ShowModal method to show the dialog.", ""); |
e5868095 | 444 | |
d14a1e28 RD |
445 | %extend { |
446 | // TODO: ignoring clientData for now... FIX THIS | |
7bf85405 RD |
447 | // SWIG is messing up the &/*'s for some reason. |
448 | wxSingleChoiceDialog(wxWindow* parent, | |
d14a1e28 RD |
449 | const wxString& message, |
450 | const wxString& caption, | |
451 | int choices, wxString* choices_array, | |
7bf85405 | 452 | //char** clientData = NULL, |
293a0a86 | 453 | long style = wxCHOICEDLG_STYLE, |
d14a1e28 RD |
454 | const wxPoint& pos = wxDefaultPosition) { |
455 | return new wxSingleChoiceDialog(parent, message, caption, | |
456 | choices, choices_array, NULL, style, pos); | |
7bf85405 | 457 | } |
09f3d4e6 | 458 | } |
9c039d08 | 459 | |
e5868095 RD |
460 | DocDeclStr( |
461 | int , GetSelection(), | |
6aaca5ba | 462 | "Get the index of the currently selected item.", ""); |
d0e2ede0 | 463 | |
e5868095 RD |
464 | DocDeclStr( |
465 | wxString , GetStringSelection(), | |
d07d2bc9 | 466 | "Returns the string value of the currently selected item", ""); |
d0e2ede0 | 467 | |
e5868095 RD |
468 | DocDeclStr( |
469 | void , SetSelection(int sel), | |
d07d2bc9 | 470 | "Set the current selected item to sel", ""); |
7bf85405 RD |
471 | }; |
472 | ||
473 | ||
d14a1e28 | 474 | //--------------------------------------------------------------------------- |
7bf85405 | 475 | |
e5868095 | 476 | DocStr(wxTextEntryDialog, |
d07d2bc9 | 477 | "A dialog with text control, [ok] and [cancel] buttons", ""); |
e5868095 | 478 | |
ab1f7d2a RD |
479 | MustHaveApp(wxTextEntryDialog); |
480 | ||
f63a6e0c RD |
481 | enum { wxTextEntryDialogStyle }; |
482 | ||
7bf85405 RD |
483 | class wxTextEntryDialog : public wxDialog { |
484 | public: | |
2b9048c5 | 485 | %pythonAppend wxTextEntryDialog "self._setOORInfo(self)" |
7bf85405 | 486 | |
e5868095 RD |
487 | DocCtorStr( |
488 | wxTextEntryDialog(wxWindow* parent, | |
489 | const wxString& message, | |
490 | const wxString& caption = wxPyGetTextFromUserPromptStr, | |
491 | const wxString& defaultValue = wxPyEmptyString, | |
7aada1e0 | 492 | long style = wxTextEntryDialogStyle, |
e5868095 | 493 | const wxPoint& pos = wxDefaultPosition), |
d07d2bc9 | 494 | "Constructor. Use ShowModal method to show the dialog.", ""); |
e5868095 RD |
495 | |
496 | DocDeclStr( | |
497 | wxString , GetValue(), | |
dce2bd22 | 498 | "Returns the text that the user has entered if the user has pressed OK, |
d07d2bc9 | 499 | or the original value if the user has pressed Cancel.", ""); |
d0e2ede0 | 500 | |
e5868095 RD |
501 | DocDeclStr( |
502 | void , SetValue(const wxString& value), | |
d07d2bc9 | 503 | "Sets the default text value.", ""); |
7bf85405 RD |
504 | }; |
505 | ||
d14a1e28 | 506 | //--------------------------------------------------------------------------- |
7bf85405 | 507 | |
7aada1e0 RD |
508 | MAKE_CONST_WXSTRING(GetPasswordFromUserPromptStr); |
509 | ||
510 | class wxPasswordEntryDialog : public wxTextEntryDialog | |
511 | { | |
512 | public: | |
513 | wxPasswordEntryDialog(wxWindow *parent, | |
514 | const wxString& message, | |
515 | const wxString& caption = wxPyGetPasswordFromUserPromptStr, | |
516 | const wxString& value = wxPyEmptyString, | |
517 | long style = wxTextEntryDialogStyle, | |
518 | const wxPoint& pos = wxDefaultPosition); | |
519 | }; | |
520 | ||
521 | //--------------------------------------------------------------------------- | |
522 | ||
9165401f RD |
523 | DocStr( wxNumberEntryDialog, |
524 | "A dialog with spin control, ok and cancel buttons.", "") | |
525 | ||
526 | MustHaveApp(wxNumberEntryDialog); | |
527 | ||
528 | class wxNumberEntryDialog : public wxDialog | |
529 | { | |
530 | public: | |
531 | %pythonAppend wxNumberEntryDialog "self._setOORInfo(self)" | |
532 | ||
533 | DocCtorStr( | |
534 | wxNumberEntryDialog(wxWindow *parent, | |
535 | const wxString& message, | |
536 | const wxString& prompt, | |
537 | const wxString& caption, | |
538 | long value, long min, long max, | |
539 | const wxPoint& pos = wxDefaultPosition), | |
540 | "Constructor. Use ShowModal method to show the dialog.", ""); | |
541 | ||
542 | long GetValue(); | |
543 | }; | |
544 | ||
545 | //--------------------------------------------------------------------------- | |
546 | ||
e5868095 RD |
547 | |
548 | DocStr(wxFontData, | |
dce2bd22 | 549 | "This class holds a variety of information related to font dialogs and |
d07d2bc9 | 550 | is used to transfer settings to and results from a `wx.FontDialog`.", ""); |
e5868095 RD |
551 | |
552 | ||
9416aa89 | 553 | class wxFontData : public wxObject { |
7bf85405 RD |
554 | public: |
555 | wxFontData(); | |
556 | ~wxFontData(); | |
557 | ||
e5868095 RD |
558 | DocDeclStr( |
559 | void , EnableEffects(bool enable), | |
dce2bd22 RD |
560 | "Enables or disables 'effects' under MS Windows only. This refers to |
561 | the controls for manipulating colour, strikeout and underline | |
d07d2bc9 | 562 | properties. The default value is true.", ""); |
d0e2ede0 | 563 | |
e5868095 RD |
564 | DocDeclStr( |
565 | bool , GetAllowSymbols(), | |
dce2bd22 RD |
566 | "Under MS Windows, returns a flag determining whether symbol fonts can |
567 | be selected. Has no effect on other platforms. The default value is | |
d07d2bc9 | 568 | true.", ""); |
d0e2ede0 | 569 | |
e5868095 RD |
570 | DocDeclStr( |
571 | wxColour , GetColour(), | |
dce2bd22 | 572 | "Gets the colour associated with the font dialog. The default value is |
d07d2bc9 | 573 | black.", ""); |
d0e2ede0 | 574 | |
e5868095 RD |
575 | DocDeclStr( |
576 | wxFont , GetChosenFont(), | |
d07d2bc9 | 577 | "Gets the font chosen by the user.", ""); |
d0e2ede0 | 578 | |
e5868095 RD |
579 | DocDeclStr( |
580 | bool , GetEnableEffects(), | |
d07d2bc9 | 581 | "Determines whether 'effects' are enabled under Windows.", ""); |
d0e2ede0 | 582 | |
e5868095 RD |
583 | DocDeclStr( |
584 | wxFont , GetInitialFont(), | |
dce2bd22 | 585 | "Gets the font that will be initially used by the font dialog. This |
d07d2bc9 | 586 | should have previously been set by the application.", ""); |
d0e2ede0 | 587 | |
e5868095 RD |
588 | DocDeclStr( |
589 | bool , GetShowHelp(), | |
dce2bd22 | 590 | "Returns true if the Help button will be shown (Windows only). The |
d07d2bc9 | 591 | default value is false.", ""); |
d0e2ede0 | 592 | |
e5868095 RD |
593 | DocDeclStr( |
594 | void , SetAllowSymbols(bool allowSymbols), | |
dce2bd22 | 595 | "Under MS Windows, determines whether symbol fonts can be selected. Has |
d07d2bc9 | 596 | no effect on other platforms. The default value is true.", ""); |
d0e2ede0 | 597 | |
e5868095 RD |
598 | DocDeclStr( |
599 | void , SetChosenFont(const wxFont& font), | |
dce2bd22 | 600 | "Sets the font that will be returned to the user (normally for internal |
d07d2bc9 | 601 | use only).", ""); |
d0e2ede0 | 602 | |
e5868095 RD |
603 | DocDeclStr( |
604 | void , SetColour(const wxColour& colour), | |
dce2bd22 | 605 | "Sets the colour that will be used for the font foreground colour. The |
d07d2bc9 | 606 | default colour is black.", ""); |
d0e2ede0 | 607 | |
e5868095 RD |
608 | DocDeclStr( |
609 | void , SetInitialFont(const wxFont& font), | |
d07d2bc9 | 610 | "Sets the font that will be initially used by the font dialog.", ""); |
d0e2ede0 | 611 | |
e5868095 RD |
612 | DocDeclStr( |
613 | void , SetRange(int min, int max), | |
dce2bd22 | 614 | "Sets the valid range for the font point size (Windows only). The |
d07d2bc9 | 615 | default is 0, 0 (unrestricted range).", ""); |
d0e2ede0 | 616 | |
e5868095 RD |
617 | DocDeclStr( |
618 | void , SetShowHelp(bool showHelp), | |
dce2bd22 | 619 | "Determines whether the Help button will be displayed in the font |
d07d2bc9 | 620 | dialog (Windows only). The default value is false.", ""); |
7bf85405 RD |
621 | }; |
622 | ||
623 | ||
e5868095 RD |
624 | |
625 | ||
626 | DocStr(wxFontDialog, | |
dce2bd22 RD |
627 | "wx.FontDialog allows the user to select a system font and its attributes. |
628 | ||
629 | :see: `wx.FontData` | |
d07d2bc9 | 630 | ", ""); |
e5868095 | 631 | |
ab1f7d2a RD |
632 | MustHaveApp(wxFontDialog); |
633 | ||
7bf85405 RD |
634 | class wxFontDialog : public wxDialog { |
635 | public: | |
2b9048c5 | 636 | %pythonAppend wxFontDialog "self._setOORInfo(self)" |
e5868095 RD |
637 | |
638 | DocStr(wxFontDialog, | |
dce2bd22 RD |
639 | "Constructor. Pass a parent window and the `wx.FontData` object to be |
640 | used to initialize the dialog controls. Call `ShowModal` to display | |
641 | the dialog. If ShowModal returns ``wx.ID_OK`` then you can fetch the | |
d07d2bc9 | 642 | results with via the `wx.FontData` returned by `GetFontData`.", ""); |
557a93b9 | 643 | wxFontDialog(wxWindow* parent, const wxFontData& data); |
7bf85405 | 644 | |
d0e2ede0 | 645 | |
e5868095 RD |
646 | DocDeclStr( |
647 | wxFontData& , GetFontData(), | |
dce2bd22 | 648 | "Returns a reference to the internal `wx.FontData` used by the |
d0e2ede0 | 649 | wx.FontDialog.", ""); |
7bf85405 RD |
650 | }; |
651 | ||
652 | ||
1979aa58 RD |
653 | wxFont wxGetFontFromUser(wxWindow *parent = NULL, |
654 | const wxFont& fontInit = wxNullFont, | |
655 | const wxString& caption = wxPyEmptyString); | |
656 | ||
657 | ||
d14a1e28 | 658 | //--------------------------------------------------------------------------- |
7bf85405 | 659 | |
e5868095 RD |
660 | |
661 | DocStr(wxMessageDialog, | |
dce2bd22 | 662 | "This class provides a simple dialog that shows a single or multi-line |
d07d2bc9 | 663 | message, with a choice of OK, Yes, No and/or Cancel buttons.", " |
dce2bd22 RD |
664 | |
665 | Window Styles | |
666 | -------------- | |
d07d2bc9 RD |
667 | =================== ============================================= |
668 | wx.OK Show an OK button. | |
669 | wx.CANCEL Show a Cancel button. | |
670 | wx.YES_NO Show Yes and No buttons. | |
671 | wx.YES_DEFAULT Used with wxYES_NO, makes Yes button the | |
672 | default - which is the default behaviour. | |
673 | wx.NO_DEFAULT Used with wxYES_NO, makes No button the default. | |
674 | wx.ICON_EXCLAMATION Shows an exclamation mark icon. | |
675 | wx.ICON_HAND Shows an error icon. | |
676 | wx.ICON_ERROR Shows an error icon - the same as wxICON_HAND. | |
677 | wx.ICON_QUESTION Shows a question mark icon. | |
678 | wx.ICON_INFORMATION Shows an information (i) icon. | |
679 | wx.STAY_ON_TOP The message box stays on top of all other | |
680 | window, even those of the other applications | |
681 | (Windows only). | |
682 | =================== ============================================= | |
e5868095 RD |
683 | "); |
684 | ||
685 | ||
ab1f7d2a RD |
686 | MustHaveApp(wxMessageDialog); |
687 | ||
7bf85405 RD |
688 | class wxMessageDialog : public wxDialog { |
689 | public: | |
2b9048c5 | 690 | %pythonAppend wxMessageDialog "self._setOORInfo(self)" |
d0e2ede0 | 691 | |
dce2bd22 RD |
692 | DocCtorStr( |
693 | wxMessageDialog(wxWindow* parent, | |
694 | const wxString& message, | |
695 | const wxString& caption = wxPyMessageBoxCaptionStr, | |
696 | long style = wxOK | wxCANCEL | wxCENTRE, | |
697 | const wxPoint& pos = wxDefaultPosition), | |
d07d2bc9 | 698 | "Constructor, use `ShowModal` to display the dialog.", ""); |
7bf85405 | 699 | |
7bf85405 RD |
700 | }; |
701 | ||
d14a1e28 | 702 | //--------------------------------------------------------------------------- |
7bf85405 | 703 | |
e5868095 RD |
704 | |
705 | DocStr(wxProgressDialog, | |
dce2bd22 | 706 | "A dialog that shows a short message and a progress bar. Optionally, it |
d07d2bc9 | 707 | can display an ABORT button.", " |
dce2bd22 RD |
708 | |
709 | Window Styles | |
710 | -------------- | |
d07d2bc9 RD |
711 | ==================== ============================================= |
712 | wx.PD_APP_MODAL Make the progress dialog modal. If this flag is | |
713 | not given, it is only \"locally\" modal - | |
714 | that is the input to the parent window is | |
715 | disabled, but not to the other ones. | |
716 | ||
717 | wx.PD_AUTO_HIDE Causes the progress dialog to disappear from | |
718 | screen as soon as the maximum value of the | |
719 | progress meter has been reached. | |
720 | ||
721 | wx.PD_CAN_ABORT This flag tells the dialog that it should have | |
722 | a \"Cancel\" button which the user may press. If | |
723 | this happens, the next call to Update() will | |
4ba3af91 RD |
724 | return False in the first component of its return |
725 | value. | |
726 | ||
727 | wx.PD_CAN_SKIP This flag tells the dialog that it should have a | |
728 | \"Skip\" button which the user may press. If this | |
729 | happens, the next call to Update() will return | |
730 | True in the second component of its return value. | |
d07d2bc9 RD |
731 | |
732 | wx.PD_ELAPSED_TIME This flag tells the dialog that it should show | |
733 | elapsed time (since creating the dialog). | |
734 | ||
735 | wx.PD_ESTIMATED_TIME This flag tells the dialog that it should show | |
736 | estimated time. | |
737 | ||
738 | wx.PD_REMAINING_TIME This flag tells the dialog that it should show | |
739 | remaining time. | |
191dea6d RD |
740 | |
741 | wx.PD_SMOOTH Uses the wx.GA_SMOOTH style on the embedded | |
742 | wx.Gauge widget. | |
d07d2bc9 | 743 | ==================== ============================================= |
e5868095 RD |
744 | "); |
745 | ||
746 | ||
191dea6d RD |
747 | // TODO: wxPD_CAN_SKIP |
748 | ||
ab1f7d2a RD |
749 | MustHaveApp(wxProgressDialog); |
750 | ||
bb0054cd RD |
751 | class wxProgressDialog : public wxFrame { |
752 | public: | |
2b9048c5 | 753 | %pythonAppend wxProgressDialog "self._setOORInfo(self)" |
7bf85405 | 754 | |
e5868095 RD |
755 | DocCtorStr( |
756 | wxProgressDialog(const wxString& title, | |
757 | const wxString& message, | |
758 | int maximum = 100, | |
759 | wxWindow* parent = NULL, | |
760 | int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL ), | |
dce2bd22 RD |
761 | "Constructor. Creates the dialog, displays it and disables user input |
762 | for other windows, or, if wx.PD_APP_MODAL flag is not given, for its | |
d07d2bc9 | 763 | parent window only.", ""); |
e5868095 | 764 | |
191dea6d RD |
765 | // TODO: support getting the skipped value back in the return value, but |
766 | // only if style is set. This is so the API doesn't change for existing | |
767 | // users... | |
4ba3af91 RD |
768 | DocDeclAStr( |
769 | virtual bool , Update(int value, const wxString& newmsg = wxPyEmptyString, | |
770 | bool *OUTPUT), | |
771 | "Update(self, int value, String newmsg) --> (continue, skip)", | |
dce2bd22 | 772 | "Updates the dialog, setting the progress bar to the new value and, if |
e4836488 RD |
773 | given changes the message above it. The value given should be less |
774 | than or equal to the maximum value given to the constructor and the | |
4ba3af91 RD |
775 | dialog is closed if it is equal to the maximum. Returns a tuple of |
776 | boolean values, ``(continue, skip)`` where ``continue`` is ``True`` | |
777 | unless the Cancel button has been pressed, and ``skip`` is ``False`` | |
778 | unless the Skip button (if any) has been pressed. | |
779 | ||
780 | If the ``continue`` return value is ``false``, the application can either | |
781 | immediately destroy the dialog or ask the user for confirmation, and if the | |
782 | abort is not confirmed the dialog may be resumed with `Resume` function. | |
783 | ", ""); | |
d0e2ede0 | 784 | |
e5868095 RD |
785 | DocDeclStr( |
786 | void , Resume(), | |
dce2bd22 | 787 | "Can be used to continue with the dialog, after the user had chosen to |
d07d2bc9 | 788 | abort.", ""); |
d0e2ede0 | 789 | |
d14a1e28 | 790 | }; |
bb0054cd | 791 | |
d14a1e28 | 792 | //--------------------------------------------------------------------------- |
0122b7e3 RD |
793 | |
794 | enum wxFindReplaceFlags | |
795 | { | |
796 | // downward search/replace selected (otherwise - upwards) | |
797 | wxFR_DOWN = 1, | |
798 | ||
799 | // whole word search/replace selected | |
800 | wxFR_WHOLEWORD = 2, | |
801 | ||
802 | // case sensitive search/replace selected (otherwise - case insensitive) | |
803 | wxFR_MATCHCASE = 4 | |
804 | }; | |
805 | ||
806 | ||
807 | enum wxFindReplaceDialogStyles | |
808 | { | |
809 | // replace dialog (otherwise find dialog) | |
810 | wxFR_REPLACEDIALOG = 1, | |
811 | ||
812 | // don't allow changing the search direction | |
813 | wxFR_NOUPDOWN = 2, | |
814 | ||
815 | // don't allow case sensitive searching | |
816 | wxFR_NOMATCHCASE = 4, | |
817 | ||
818 | // don't allow whole word searching | |
819 | wxFR_NOWHOLEWORD = 8 | |
820 | }; | |
821 | ||
0122b7e3 | 822 | |
0122b7e3 | 823 | |
d14a1e28 RD |
824 | %constant wxEventType wxEVT_COMMAND_FIND; |
825 | %constant wxEventType wxEVT_COMMAND_FIND_NEXT; | |
826 | %constant wxEventType wxEVT_COMMAND_FIND_REPLACE; | |
827 | %constant wxEventType wxEVT_COMMAND_FIND_REPLACE_ALL; | |
828 | %constant wxEventType wxEVT_COMMAND_FIND_CLOSE; | |
0122b7e3 | 829 | |
0122b7e3 | 830 | |
d14a1e28 RD |
831 | %pythoncode { |
832 | EVT_FIND = wx.PyEventBinder( wxEVT_COMMAND_FIND, 1 ) | |
833 | EVT_FIND_NEXT = wx.PyEventBinder( wxEVT_COMMAND_FIND_NEXT, 1 ) | |
834 | EVT_FIND_REPLACE = wx.PyEventBinder( wxEVT_COMMAND_FIND_REPLACE, 1 ) | |
835 | EVT_FIND_REPLACE_ALL = wx.PyEventBinder( wxEVT_COMMAND_FIND_REPLACE_ALL, 1 ) | |
836 | EVT_FIND_CLOSE = wx.PyEventBinder( wxEVT_COMMAND_FIND_CLOSE, 1 ) | |
0122b7e3 | 837 | |
d14a1e28 | 838 | %# For backwards compatibility. Should they be removed? |
d0e2ede0 | 839 | EVT_COMMAND_FIND = EVT_FIND |
d14a1e28 RD |
840 | EVT_COMMAND_FIND_NEXT = EVT_FIND_NEXT |
841 | EVT_COMMAND_FIND_REPLACE = EVT_FIND_REPLACE | |
842 | EVT_COMMAND_FIND_REPLACE_ALL = EVT_FIND_REPLACE_ALL | |
d0e2ede0 | 843 | EVT_COMMAND_FIND_CLOSE = EVT_FIND_CLOSE |
d14a1e28 | 844 | } |
0122b7e3 | 845 | |
0122b7e3 | 846 | |
e5868095 | 847 | DocStr(wxFindDialogEvent, |
d07d2bc9 | 848 | "Events for the FindReplaceDialog", ""); |
e5868095 | 849 | |
0122b7e3 RD |
850 | class wxFindDialogEvent : public wxCommandEvent |
851 | { | |
852 | public: | |
853 | wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0); | |
d0e2ede0 | 854 | |
e5868095 RD |
855 | DocDeclStr( |
856 | int , GetFlags(), | |
dce2bd22 | 857 | "Get the currently selected flags: this is the combination of |
d07d2bc9 | 858 | wx.FR_DOWN, wx.FR_WHOLEWORD and wx.FR_MATCHCASE flags.", ""); |
d0e2ede0 | 859 | |
e5868095 RD |
860 | DocDeclStr( |
861 | const wxString& , GetFindString(), | |
d07d2bc9 | 862 | "Return the string to find (never empty).", ""); |
d0e2ede0 | 863 | |
e5868095 RD |
864 | DocDeclStr( |
865 | const wxString& , GetReplaceString(), | |
dce2bd22 | 866 | "Return the string to replace the search string with (only for replace |
d07d2bc9 | 867 | and replace all events).", ""); |
d0e2ede0 | 868 | |
e5868095 RD |
869 | DocDeclStr( |
870 | wxFindReplaceDialog *, GetDialog(), | |
d07d2bc9 | 871 | "Return the pointer to the dialog which generated this event.", ""); |
d0e2ede0 | 872 | |
e5868095 RD |
873 | DocDeclStr( |
874 | void , SetFlags(int flags), | |
d07d2bc9 | 875 | "", ""); |
d0e2ede0 | 876 | |
e5868095 RD |
877 | DocDeclStr( |
878 | void , SetFindString(const wxString& str), | |
d07d2bc9 | 879 | "", ""); |
d0e2ede0 | 880 | |
e5868095 RD |
881 | DocDeclStr( |
882 | void , SetReplaceString(const wxString& str), | |
d07d2bc9 | 883 | "", ""); |
0122b7e3 RD |
884 | }; |
885 | ||
886 | ||
887 | ||
d0e2ede0 | 888 | DocStr(wxFindReplaceData, |
dce2bd22 RD |
889 | "wx.FindReplaceData holds the data for wx.FindReplaceDialog. It is used |
890 | to initialize the dialog with the default values and will keep the | |
891 | last values from the dialog when it is closed. It is also updated each | |
892 | time a `wx.FindDialogEvent` is generated so instead of using the | |
893 | `wx.FindDialogEvent` methods you can also directly query this object. | |
894 | ||
895 | Note that all SetXXX() methods may only be called before showing the | |
d07d2bc9 | 896 | dialog and calling them has no effect later.", " |
dce2bd22 RD |
897 | |
898 | Flags | |
899 | ----- | |
d0e2ede0 | 900 | ================ =============================================== |
dce2bd22 RD |
901 | wx.FR_DOWN Downward search/replace selected (otherwise, |
902 | upwards) | |
903 | ||
904 | wx.FR_WHOLEWORD Whole word search/replace selected | |
905 | ||
906 | wx.FR_MATCHCASE Case sensitive search/replace selected | |
907 | (otherwise, case insensitive) | |
d0e2ede0 | 908 | ================ =============================================== |
e5868095 RD |
909 | "); |
910 | ||
911 | ||
912 | ||
913 | ||
0122b7e3 RD |
914 | class wxFindReplaceData : public wxObject |
915 | { | |
916 | public: | |
e5868095 RD |
917 | DocCtorStr( |
918 | wxFindReplaceData(int flags=0), | |
d07d2bc9 | 919 | "Constuctor initializes the flags to default value (0).", ""); |
d0e2ede0 | 920 | |
0122b7e3 | 921 | ~wxFindReplaceData(); |
d0e2ede0 | 922 | |
0122b7e3 | 923 | |
e5868095 RD |
924 | DocDeclStr( |
925 | const wxString& , GetFindString(), | |
d07d2bc9 | 926 | "Get the string to find.", ""); |
d0e2ede0 | 927 | |
e5868095 RD |
928 | DocDeclStr( |
929 | const wxString& , GetReplaceString(), | |
d07d2bc9 | 930 | "Get the replacement string.", ""); |
d0e2ede0 | 931 | |
e5868095 RD |
932 | DocDeclStr( |
933 | int , GetFlags(), | |
d07d2bc9 | 934 | "Get the combination of flag values.", ""); |
d0e2ede0 | 935 | |
e5868095 RD |
936 | DocDeclStr( |
937 | void , SetFlags(int flags), | |
d07d2bc9 | 938 | "Set the flags to use to initialize the controls of the dialog.", ""); |
d0e2ede0 | 939 | |
e5868095 RD |
940 | DocDeclStr( |
941 | void , SetFindString(const wxString& str), | |
d07d2bc9 | 942 | "Set the string to find (used as initial value by the dialog).", ""); |
d0e2ede0 | 943 | |
e5868095 RD |
944 | DocDeclStr( |
945 | void , SetReplaceString(const wxString& str), | |
d07d2bc9 | 946 | "Set the replacement string (used as initial value by the dialog).", ""); |
d0e2ede0 | 947 | |
0122b7e3 RD |
948 | }; |
949 | ||
950 | ||
e5868095 RD |
951 | |
952 | ||
953 | DocStr(wxFindReplaceDialog, | |
dce2bd22 RD |
954 | "wx.FindReplaceDialog is a standard modeless dialog which is used to |
955 | allow the user to search for some text (and possibly replace it with | |
956 | something else). The actual searching is supposed to be done in the | |
957 | owner window which is the parent of this dialog. Note that it means | |
958 | that unlike for the other standard dialogs this one must have a parent | |
959 | window. Also note that there is no way to use this dialog in a modal | |
d07d2bc9 | 960 | way; it is always, by design and implementation, modeless.", " |
dce2bd22 RD |
961 | |
962 | ||
963 | Window Styles | |
964 | ------------- | |
e5868095 | 965 | |
dce2bd22 RD |
966 | ===================== ========================================= |
967 | wx.FR_REPLACEDIALOG replace dialog (otherwise find dialog) | |
e5868095 | 968 | |
dce2bd22 | 969 | wx.FR_NOUPDOWN don't allow changing the search direction |
e5868095 | 970 | |
dce2bd22 | 971 | wx.FR_NOMATCHCASE don't allow case sensitive searching |
e5868095 | 972 | |
dce2bd22 RD |
973 | wx.FR_NOWHOLEWORD don't allow whole word searching |
974 | ===================== ========================================= | |
e5868095 RD |
975 | "); |
976 | ||
ab1f7d2a RD |
977 | MustHaveApp(wxFindReplaceDialog); |
978 | ||
0122b7e3 RD |
979 | class wxFindReplaceDialog : public wxDialog { |
980 | public: | |
2b9048c5 RD |
981 | %pythonAppend wxFindReplaceDialog "self._setOORInfo(self)" |
982 | %pythonAppend wxFindReplaceDialog() "" | |
d14a1e28 | 983 | |
e5868095 RD |
984 | DocCtorStr( |
985 | wxFindReplaceDialog(wxWindow *parent, | |
986 | wxFindReplaceData *data, | |
987 | const wxString &title, | |
988 | int style = 0), | |
dce2bd22 | 989 | "Create a FindReplaceDialog. The parent and data parameters must be |
d07d2bc9 | 990 | non-None. Use Show to display the dialog.", ""); |
e5868095 RD |
991 | |
992 | DocCtorStrName( | |
993 | wxFindReplaceDialog(), | |
d07d2bc9 | 994 | "Precreate a FindReplaceDialog for 2-phase creation", "", |
e5868095 | 995 | PreFindReplaceDialog); |
0122b7e3 | 996 | |
d0e2ede0 | 997 | |
e5868095 | 998 | DocDeclStr( |
dce2bd22 RD |
999 | bool , Create(wxWindow *parent, wxFindReplaceData *data, |
1000 | const wxString &title, int style = 0), | |
d07d2bc9 | 1001 | "Create the dialog, for 2-phase create.", ""); |
d0e2ede0 | 1002 | |
0122b7e3 | 1003 | |
e5868095 RD |
1004 | DocDeclStr( |
1005 | const wxFindReplaceData *, GetData(), | |
d07d2bc9 | 1006 | "Get the FindReplaceData object used by this dialog.", ""); |
d0e2ede0 | 1007 | |
e5868095 RD |
1008 | DocDeclStr( |
1009 | void , SetData(wxFindReplaceData *data), | |
d07d2bc9 | 1010 | "Set the FindReplaceData object used by this dialog.", ""); |
d0e2ede0 | 1011 | |
0122b7e3 RD |
1012 | }; |
1013 | ||
d14a1e28 RD |
1014 | //--------------------------------------------------------------------------- |
1015 | //--------------------------------------------------------------------------- |