1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxFindDialogEvent, wxFindReplaceDialog
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
11 See wxFindDialogEvent::GetFlags().
13 enum wxFindReplaceFlags
15 /** downward search/replace selected (otherwise - upwards) */
18 /** whole word search/replace selected */
21 /** case sensitive search/replace selected (otherwise - case insensitive) */
27 These flags can be specified in wxFindReplaceDialog ctor or Create():
29 enum wxFindReplaceDialogStyles
31 /** replace dialog (otherwise find dialog) */
32 wxFR_REPLACEDIALOG
= 1,
34 /** don't allow changing the search direction */
37 /** don't allow case sensitive searching */
40 /** don't allow whole word searching */
46 @class wxFindDialogEvent
49 wxFindReplaceDialog events
51 @beginEventTable{wxFindDialogEvent}
52 @event{EVT_FIND(id, func)}
53 Find button was pressed in the dialog.
54 @event{EVT_FIND_NEXT(id, func)}
55 Find next button was pressed in the dialog.
56 @event{EVT_FIND_REPLACE(id, func)}
57 Replace button was pressed in the dialog.
58 @event{EVT_FIND_REPLACE_ALL(id, func)}
59 Replace all button was pressed in the dialog.
60 @event{EVT_FIND_CLOSE(id, func)}
61 The dialog is being destroyed, any pointers to it cannot be used any longer.
67 class wxFindDialogEvent
: public wxCommandEvent
71 Constuctor used by wxWidgets only.
73 wxFindDialogEvent(wxEventType commandType
= wxEVT_NULL
,
77 Return the pointer to the dialog which generated this event.
79 wxFindReplaceDialog
* GetDialog() const;
82 Return the string to find (never empty).
84 wxString
GetFindString() const;
87 Get the currently selected flags: this is the combination of
88 the ::wxFindReplaceFlags enumeration values.
93 Return the string to replace the search string with (only for replace and
96 const wxString
& GetReplaceString() const;
102 @class wxFindReplaceData
103 @wxheader{fdrepdlg.h}
105 wxFindReplaceData holds the data for wxFindReplaceDialog.
107 It is used to initialize the dialog with the default values and will keep the
108 last values from the dialog when it is closed. It is also updated each time a
109 wxFindDialogEvent is generated so instead of using the wxFindDialogEvent
110 methods you can also directly query this object.
112 Note that all @c SetXXX() methods may only be called before showing the
113 dialog and calling them has no effect later.
118 class wxFindReplaceData
: public wxObject
122 Constuctor initializes the flags to default value (0).
124 wxFindReplaceData(wxUint32 flags
= 0);
127 Get the string to find.
129 const wxString
GetFindString();
132 Get the combination of @c wxFindReplaceFlags values.
134 int GetFlags() const;
137 Get the replacement string.
139 const wxString
GetReplaceString();
142 Set the string to find (used as initial value by the dialog).
144 void SetFindString(const wxString
& str
);
147 Set the flags to use to initialize the controls of the dialog.
149 void SetFlags(wxUint32 flags
);
152 Set the replacement string (used as initial value by the dialog).
154 void SetReplaceString(const wxString
& str
);
160 @class wxFindReplaceDialog
161 @wxheader{fdrepdlg.h}
163 wxFindReplaceDialog is a standard modeless dialog which is used to allow the
164 user to search for some text (and possibly replace it with something else).
166 The actual searching is supposed to be done in the owner window which is the
167 parent of this dialog. Note that it means that unlike for the other standard
168 dialogs this one @b must have a parent window. Also note that there is no
169 way to use this dialog in a modal way; it is always, by design and
170 implementation, modeless.
172 Please see the @ref page_samples_dialogs sample for an example of using it.
177 class wxFindReplaceDialog
: public wxDialog
180 wxFindReplaceDialog();
183 After using default constructor Create() must be called.
185 The @a parent and @a data parameters must be non-@NULL.
187 wxFindReplaceDialog(wxWindow
* parent
,
188 wxFindReplaceData
* data
,
189 const wxString
& title
,
195 ~wxFindReplaceDialog();
198 Creates the dialog; use wxWindow::Show to show it on screen.
200 The @a parent and @a data parameters must be non-@NULL.
202 bool Create(wxWindow
* parent
, wxFindReplaceData
* data
,
203 const wxString
& title
, int style
= 0);
206 Get the wxFindReplaceData object used by this dialog.
208 const wxFindReplaceData
* GetData() const;