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