1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxFindDialogEvent, wxFindReplaceDialog
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
10 See wxFindDialogEvent::GetFlags().
12 enum wxFindReplaceFlags
14 /** downward search/replace selected (otherwise - upwards) */
17 /** whole word search/replace selected */
20 /** case sensitive search/replace selected (otherwise - case insensitive) */
26 These flags can be specified in wxFindReplaceDialog ctor or Create():
28 enum wxFindReplaceDialogStyles
30 /** replace dialog (otherwise find dialog) */
31 wxFR_REPLACEDIALOG
= 1,
33 /** don't allow changing the search direction */
36 /** don't allow case sensitive searching */
39 /** don't allow whole word searching */
45 @class wxFindDialogEvent
47 wxFindReplaceDialog events.
49 @beginEventTable{wxFindDialogEvent}
50 @event{EVT_FIND(id, func)}
51 Find button was pressed in the dialog.
52 @event{EVT_FIND_NEXT(id, func)}
53 Find next button was pressed in the dialog.
54 @event{EVT_FIND_REPLACE(id, func)}
55 Replace button was pressed in the dialog.
56 @event{EVT_FIND_REPLACE_ALL(id, func)}
57 Replace all button was pressed in the dialog.
58 @event{EVT_FIND_CLOSE(id, func)}
59 The dialog is being destroyed, any pointers to it cannot be used any longer.
65 class wxFindDialogEvent
: public wxCommandEvent
69 Constructor used by wxWidgets only.
71 wxFindDialogEvent(wxEventType commandType
= wxEVT_NULL
,
75 Return the pointer to the dialog which generated this event.
77 wxFindReplaceDialog
* GetDialog() const;
80 Return the string to find (never empty).
82 wxString
GetFindString() const;
85 Get the currently selected flags: this is the combination of
86 the ::wxFindReplaceFlags enumeration values.
91 Return the string to replace the search string with (only for replace and
94 const wxString
& GetReplaceString() const;
97 wxEventType wxEVT_FIND
;
98 wxEventType wxEVT_FIND_NEXT
;
99 wxEventType wxEVT_FIND_REPLACE
;
100 wxEventType wxEVT_FIND_REPLACE_ALL
;
101 wxEventType wxEVT_FIND_CLOSE
;
106 @class wxFindReplaceData
108 wxFindReplaceData holds the data for wxFindReplaceDialog.
110 It is used to initialize the dialog with the default values and will keep the
111 last values from the dialog when it is closed. It is also updated each time a
112 wxFindDialogEvent is generated so instead of using the wxFindDialogEvent
113 methods you can also directly query this object.
115 Note that all @c SetXXX() methods may only be called before showing the
116 dialog and calling them has no effect later.
119 @category{cmndlg,data}
121 class wxFindReplaceData
: public wxObject
125 Constructor initializes the flags to default value (0).
127 wxFindReplaceData(wxUint32 flags
= 0);
130 Get the string to find.
132 const wxString
& GetFindString() const;
135 Get the combination of @c wxFindReplaceFlags values.
137 int GetFlags() const;
140 Get the replacement string.
142 const wxString
& GetReplaceString() const;
145 Set the string to find (used as initial value by the dialog).
147 void SetFindString(const wxString
& str
);
150 Set the flags to use to initialize the controls of the dialog.
152 void SetFlags(wxUint32 flags
);
155 Set the replacement string (used as initial value by the dialog).
157 void SetReplaceString(const wxString
& str
);
163 @class wxFindReplaceDialog
165 wxFindReplaceDialog is a standard modeless dialog which is used to allow the
166 user to search for some text (and possibly replace it with something else).
168 The actual searching is supposed to be done in the owner window which is the
169 parent of this dialog. Note that it means that unlike for the other standard
170 dialogs this one @b must have a parent window. Also note that there is no
171 way to use this dialog in a modal way; it is always, by design and
172 implementation, modeless.
174 Please see the @ref page_samples_dialogs sample for an example of using it.
179 class wxFindReplaceDialog
: public wxDialog
182 wxFindReplaceDialog();
185 After using default constructor Create() must be called.
187 The @a parent and @a data parameters must be non-@NULL.
189 wxFindReplaceDialog(wxWindow
* parent
,
190 wxFindReplaceData
* data
,
191 const wxString
& title
,
197 virtual ~wxFindReplaceDialog();
200 Creates the dialog; use wxWindow::Show to show it on screen.
202 The @a parent and @a data parameters must be non-@NULL.
204 bool Create(wxWindow
* parent
, wxFindReplaceData
* data
,
205 const wxString
& title
, int style
= 0);
208 Get the wxFindReplaceData object used by this dialog.
210 const wxFindReplaceData
* GetData() const;