]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/fdrepdlg.tex
Some work on GTK focus handling and events.
[wxWidgets.git] / docs / latex / wx / fdrepdlg.tex
CommitLineData
8db37e06
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: fdrepdlg.tex
3%% Purpose: wxFindReplaceDialog documentation
4%% Author: Vadim Zeitlin
5%% Modified by:
6%% Created: 01.08.01
7%% RCS-ID: $Id$
8%% Copyright: (c) 2001 Vadim Zeitlin
9%% License: wxWindows license
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxFindDialogEvent}}\label{wxfinddialogevent}
13
14wxFindReplaceDialog events
15
16\wxheading{Derived from}
17
18\helpref{wxCommandEvent}{wxcommandevent}
19
20\wxheading{Include files}
21
22<wx/fdrepdlg.h>
23
24\wxheading{Event table macros}
25
26To process a command event from
27\helpref{wxFindReplaceDialog}{wxfindreplacedialog}, use these event handler
28macros to direct input to member functions that take a wxFindDialogEvent
29argument. The {\it id} parameter is the identifier of the find dialog and you
30may usually specify $-1$ for it unless you plan to have several find dialogs
31sending events to the same owner window simultaneously.
32
33\twocolwidtha{7cm}
34\begin{twocollist}\itemsep=0pt
35\twocolitem{{\bf EVT\_FIND(id, func)}}{Find button was pressed in the dialog.}
36\twocolitem{{\bf EVT\_FIND\_NEXT(id, func)}}{Find next button was pressed in the dialog.}
37\twocolitem{{\bf EVT\_FIND\_REPLACE(id, func)}}{Replace button was pressed in the dialog.}
38\twocolitem{{\bf EVT\_FIND\_REPLACE\_ALL(id, func)}}{Replace all button was pressed in the dialog.}
39\twocolitem{{\bf EVT\_FIND\_CLOSE(id, func)}}{The dialog is being destroyed,
40any pointers to it cannot be used any longer.}
41\end{twocollist}%
42
43\latexignore{\rtfignore{\wxheading{Members}}}
44
45\membersection{wxFindDialogEvent::wxFindDialogEvent}\label{wxfinddialogeventwxfinddialogevent}
46
47\func{}{wxFindDialogEvent}{\param{wxEventType }{commandType = wxEVT\_NULL}, \param{int }{id = 0}}
48
49Constuctor used by wxWindows only.
50
51\membersection{wxFindDialogEvent::GetFlags}\label{wxfinddialogeventgetflags}
52
53\constfunc{int}{GetFlags}{\void}
54
55Get the currently selected flags: this is the combination of {\tt wxFR\_DOWN},
56{\tt wxFR\_WHOLEWORD} and {\tt wxFR\_MATCHCASE} flags.
57
58\membersection{wxFindDialogEvent::GetFindString}\label{wxfinddialogeventgetfindstring}
59
60\constfunc{wxString}{GetFindString}{\void}
61
62Return the string to find (never empty).
63
64\membersection{wxFindDialogEvent::GetReplaceString}\label{wxfinddialogeventgetreplacestring}
65
66\constfunc{const wxString\&}{GetReplaceString}{\void}
67
68Return the string to replace the search string with (only for replace and
69replace all events).
70
71\membersection{wxFindDialogEvent::GetDialog}\label{wxfinddialogeventgetdialog}
72
73\constfunc{wxFindReplaceDialog*}{GetDialog}{\void}
74
75Return the pointer to the dialog which generated this event.
76
77\section{\class{wxFindReplaceData}}\label{wxfindreplacedata}
78
79wxFindReplaceData holds the data for
80\helpref{wxFindReplaceDialog}{wxfindreplacedialog}. It is used to initialize
81the dialog with the default values and will keep the last values from the
82dialog when it is closed. It is also updated each time a
83\helpref{wxFindDialogEvent}{wxfinddialogevent} is generated so instead of
84using the wxFindDialogEvent methods you can also directly query this object.
85
86Note that all {\tt SetXXX()} methods may only be called before showing the
87dialog and calling them has no effect later.
88
89\wxheading{Include files}
90
91#include <wx/fdrepdlg.h>
92
93\wxheading{Derived from}
94
95\helpref{wxObject}{wxobject}
96
97\wxheading{Data structures}
98
99Flages used by
100\helpref{wxFindReplaceData::GetFlags()}{wxfindreplacedatagetflags} and
101\helpref{wxFindDialogEvent::GetFlags()}{wxfinddialogeventgetflags}:
102
103\begin{verbatim}
104enum wxFindReplaceFlags
105{
106 // downward search/replace selected (otherwise - upwards)
107 wxFR_DOWN = 1,
108
109 // whole word search/replace selected
110 wxFR_WHOLEWORD = 2,
111
112 // case sensitive search/replace selected (otherwise - case insensitive)
113 wxFR_MATCHCASE = 4
114}
115\end{verbatim}
116
117These flags can be specified in
118\helpref{wxFindReplaceDialog ctor}{wxfindreplacedialogctor} or
119\helpref{Create()}{wxfindreplacedialogcreate}:
120
121\begin{verbatim}
122enum wxFindReplaceDialogStyles
123{
124 // replace dialog (otherwise find dialog)
125 wxFR_REPLACEDIALOG = 1,
126
127 // don't allow changing the search direction
128 wxFR_NOUPDOWN = 2,
129
130 // don't allow case sensitive searching
131 wxFR_NOMATCHCASE = 4,
132
133 // don't allow whole word searching
134 wxFR_NOWHOLEWORD = 8
135}
136\end{verbatim}
137
138\latexignore{\rtfignore{\wxheading{Members}}}
139
140\membersection{wxFindReplaceData::wxFindReplaceData}\label{wxfindreplacedatactor}
141
142\func{}{wxFindReplaceData}{\param{wxUint32 }{flags = 0}}
143
144Constuctor initializes the flags to default value ($0$).
145
146\membersection{wxFindReplaceData::GetFindString}\label{wxfindreplacedatagetfindstring}
147
148\func{const wxString\&}{GetFindString}{\void}
149
150Get the string to find.
151
152\membersection{wxFindReplaceData::GetReplaceString}\label{wxfindreplacedatagetreplacestring}
153
154\func{const wxString\&}{GetReplaceString}{\void}
155
156Get the replacement string.
157
158\membersection{wxFindReplaceData::GetFlags}\label{wxfindreplacedatagetflags}
159
160\constfunc{int}{GetFlags}{\void}
161
162Get the combination of {\tt wxFindReplaceFlags} values.
163
164\membersection{wxFindReplaceData::SetFlags}\label{wxfindreplacedatasetflags}
165
166\func{void}{SetFlags}{\param{wxUint32 }{flags}}
167
168Set the flags to use to initialize the controls of the dialog.
169
170\membersection{wxFindReplaceData::SetFindString}\label{wxfindreplacedatasetfindstring}
171
172\func{void}{SetFindString}{\param{const wxString\& }{str}}
173
174Set the string to find (used as initial value by the dialog).
175
176\membersection{wxFindReplaceData::SetReplaceString}\label{wxfindreplacedatasetreplacestring}
177
178\func{void}{SetReplaceString}{\param{const wxString\& }{str}}
179
180Set the replacement string (used as initial value by the dialog).
181
182\section{\class{wxFindReplaceDialog}}\label{wxfindreplacedialog}
183
184wxFindReplaceDialog is a standard modeless dialog which is used to allow the
185user to search for some text (and possible replace it with something else).
186The actual searching is supposed to be done in the owner window which is the
187parent of this dialog. Note that it means that unlike for the other standard
08829b06
VZ
188dialogs this one {\bf must} have a parent window. Also note that there is no
189way to use this dialog in a modal way, it is always, by design and
190implementation, modeless.
8db37e06
VZ
191
192Please see the dialogs sample for example of using it.
193
194\wxheading{Include files}
195
196#include <wx/fdrepdlg.h>
197
198\wxheading{Derived from}
199
200\helpref{wxDialog}{wxdialog}
201
202\latexignore{\rtfignore{\wxheading{Members}}}
203
204\membersection{wxFindReplaceDialog::wxFindReplaceDialog}\label{wxfindreplacedialogctor}
205
5e6a47f5 206\func{}{wxFindReplaceDialog}{\void}
8db37e06 207
5e6a47f5 208\func{}{wxFindReplaceDialog}{\param{wxWindow * }{parent}, \param{wxFindReplaceData* }{data}, \param{const wxString\& }{title}, \param{int }{style = 0}}
8db37e06 209
5e6a47f5 210After using default constructor \helpref{Create()}{wxfindreplacedialogcreate}
8db37e06
VZ
211must be called.
212
213The {\it parent} and {\it data} parameters must be non-{\tt NULL}.
214
5e6a47f5 215\membersection{wxFindReplaceDialog::\destruct{wxFindReplaceDialog}}\label{wxfindreplacedialogdtor}
8db37e06 216
5e6a47f5 217\func{}{\destruct{wxFindReplaceDialog}}{\void}
8db37e06
VZ
218
219Destructor.
220
5e6a47f5
VZ
221\membersection{wxFindReplaceDialog::Create}\label{wxfindreplacedialogcreate}
222
8db37e06
VZ
223\func{bool}{Create}{\param{wxWindow * }{parent}, \param{wxFindReplaceData* }{data}, \param{const wxString\& }{title}, \param{int }{style = 0}}
224
225Creates the dialog and shows it on screen.
226
227The {\it parent} and {\it data} parameters must be non-{\tt NULL}.
228
5e6a47f5 229\membersection{wxFindReplaceDialog::GetData}\label{wxfindreplacedialoggetdata}
8db37e06
VZ
230
231\constfunc{const wxFindReplaceData*}{GetData}{\void}
232
233Get the \helpref{wxFindReplaceData}{wxfindreplacedata} object used by this
234dialog.
235