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