]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/text.tex
test wxTE_NO_VSCROLL
[wxWidgets.git] / docs / latex / wx / text.tex
CommitLineData
eda40bfc
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%% wxTextCtrl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
a660d684
KB
3\section{\class{wxTextCtrl}}\label{wxtextctrl}
4
5A text control allows text to be displayed and edited. It may be
71777e2c 6single line or multi-line.
a660d684
KB
7
8\wxheading{Derived from}
9
10streambuf\\
11\helpref{wxControl}{wxcontrol}\\
12\helpref{wxWindow}{wxwindow}\\
13\helpref{wxEvtHandler}{wxevthandler}\\
14\helpref{wxObject}{wxobject}
15
954b8ae6
JS
16\wxheading{Include files}
17
18<wx/textctrl.h>
19
a660d684
KB
20\wxheading{Window styles}
21
22\twocolwidtha{5cm}
23\begin{twocollist}\itemsep=0pt
c50f1fb9 24\twocolitem{\windowstyle{wxTE\_PROCESS\_ENTER}}{The control will generate
01a01d10 25the event wxEVT\_COMMAND\_TEXT\_ENTER (otherwise pressing Enter key
0f66923e 26is either processed internally by the control or used for navigation between
c50f1fb9 27dialog controls).}
2edb0bde 28\twocolitem{\windowstyle{wxTE\_PROCESS\_TAB}}{The control will receive
01a01d10 29wxEVT\_CHAR events for TAB pressed - normally, TAB is used for passing to the
c50f1fb9
VZ
30next control in a dialog instead. For the control created with this style,
31you can still use Ctrl-Enter to pass to the next control from the keyboard.}
a660d684
KB
32\twocolitem{\windowstyle{wxTE\_MULTILINE}}{The text control allows multiple lines.}
33\twocolitem{\windowstyle{wxTE\_PASSWORD}}{The text will be echoed as asterisks.}
34\twocolitem{\windowstyle{wxTE\_READONLY}}{The text will not be user-editable.}
c57e3339 35\twocolitem{\windowstyle{wxTE\_RICH}}{Use rich text control under Win32, this
e119d049 36allows to have more than 64KB of text in the control even under Win9x. This
c57e3339 37style is ignored under other platforms.}
a5aa8086
VZ
38\twocolitem{\windowstyle{wxTE\_RICH2}}{Use rich text control version 2.0 or 3.0
39under Win32, this style is ignored under other platforms}
c57e3339 40\twocolitem{\windowstyle{wxTE\_AUTO\_URL}}{Highlight the URLs and generate the
d69b094f
KH
41wxTextUrlEvents when mouse events occur over them. This style is only supported
42for wxTE\_RICH Win32 and multi-line wxGTK2 text controls.}
5a8f04e3
VZ
43\twocolitem{\windowstyle{wxTE\_NOHIDESEL}}{By default, the Windows text control
44doesn't show the selection when it doesn't have focus - use this style to force
45it to always show it. It doesn't do anything under other platforms.}
0376ed54 46\twocolitem{\windowstyle{wxHSCROLL}}{A horizontal scrollbar will be created and
0fec2f73 47used, so that text won't be wrapped. No effect under wxGTK1.}
3908fe9b 48\twocolitem{\windowstyle{wxTE\_LEFT}}{The text in the control will be left-justified (default).}
c663fbea
VS
49\twocolitem{\windowstyle{wxTE\_CENTRE}}{The text in the control will be centered (currently wxMSW and wxGTK2 only).}
50\twocolitem{\windowstyle{wxTE\_RIGHT}}{The text in the control will be right-justified (currently wxMSW and wxGTK2 only).}
fb4888a6
VZ
51\twocolitem{\windowstyle{wxTE\_DONTWRAP}}{Same as {\tt wxHSCROLL} style: don't wrap at all, show horizontal scrollbar instead.}
52\twocolitem{\windowstyle{wxTE\_CHARWRAP}}{Wrap the lines too long to be shown entirely at any position (wxUniv and wxGTK2 only).}
53\twocolitem{\windowstyle{wxTE\_WORDWRAP}}{Wrap the lines too long to be shown entirely at word boundaries (wxUniv and wxGTK2 only).}
54\twocolitem{\windowstyle{wxTE\_BESTWRAP}}{Wrap the lines at word boundaries or at any other character if there are words longer than the window width (this is the default).}
b0dd9c00 55\twocolitem{\windowstyle{wxTE\_CAPITALIZE}}{On PocketPC and Smartphone, causes the first letter to be capitalized.}
a660d684
KB
56\end{twocollist}
57
b0dd9c00 58See also \helpref{window styles overview}{windowstyles} and \helpref{wxTextCtrl::wxTextCtrl}{wxtextctrlctor}.
a660d684 59
927637fd
VZ
60Note that alignment styles (\windowstyle{wxTE\_LEFT},
61\windowstyle{wxTE\_CENTRE} and \windowstyle{wxTE\_RIGHT}) can be changed
62dynamically after control creation on wxMSW and wxGTK.
63\windowstyle{wxTE\_READONLY}, \windowstyle{wxTE\_PASSWORD} and wrapping styles
64can be dynamically changed under wxGTK but not wxMSW. The other styles can be
65only set during control creation.
66
67
2b5f62a0
VZ
68\wxheading{wxTextCtrl text format}
69
70The multiline text controls always store the text as a sequence of lines
71separated by {\tt $\backslash$n} characters, i.e. in the Unix text format even
72on non-Unix platforms. This allows the user code to ignore the differences
73between the platforms but at a price: the indices in the control such as those
7d8268a1 74returned by \helpref{GetInsertionPoint}{wxtextctrlgetinsertionpoint} or
2b5f62a0
VZ
75\helpref{GetSelection}{wxtextctrlgetselection} can {\bf not} be used as
76indices into the string returned by \helpref{GetValue}{wxtextctrlgetvalue} as
7d8268a1 77they're going to be slightly off for platforms using
2b5f62a0
VZ
78{\tt $\backslash$r$\backslash$n} as separator (as Windows does), for example.
79
80Instead, if you need to obtain a substring between the $2$ indices obtained
81from the control with the help of the functions mentioned above, you should
82use \helpref{GetRange}{wxtextctrlgetrange}. And the indices themselves can
7d8268a1
WS
83only be passed to other methods, for example
84\helpref{SetInsertionPoint}{wxtextctrlsetinsertionpoint} or
2b5f62a0
VZ
85\helpref{SetSelection}{wxtextctrlsetselection}.
86
87To summarize: never use the indices returned by (multiline) wxTextCtrl as
88indices into the string it contains, but only as arguments to be passed back
89to the other wxTextCtrl methods.
90
eda40bfc
VZ
91\wxheading{wxTextCtrl styles}
92
93Multi-line text controls support the styles, i.e. provide a possibility to set
94colours and font for individual characters in it (note that under Windows {\tt
95wxTE\_RICH} style is required for style support). To use the styles you can
96either call \helpref{SetDefaultStyle}{wxtextctrlsetdefaultstyle} before
97inserting the text or call \helpref{SetStyle}{wxtextctrlsetstyle} later to
98change the style of the text already in the control (the first solution is
99much more efficient).
100
101In either case, if the style doesn't specify some of the attributes (for
102example you only want to set the text colour but without changing the font nor
103the text background), the values of the default style will be used for them.
104If there is no default style, the attributes of the text control itself are
105used.
106
107So the following code correctly describes what it does: the second call
108to \helpref{SetDefaultStyle}{wxtextctrlsetdefaultstyle} doesn't change the
109text foreground colour (which stays red) while the last one doesn't change the
110background colour (which stays grey):
111
112{\small%
113\begin{verbatim}
114 text->SetDefaultStyle(wxTextAttr(*wxRED));
115 text->AppendText("Red text\n");
116 text->SetDefaultStyle(wxTextAttr(wxNullColour, *wxLIGHT_GREY));
117 text->AppendText("Red on grey text\n");
118 text->SetDefaultStyle(wxTextAttr(*wxBLUE);
119 text->AppendText("Blue on grey text\n");
120\end{verbatim}
121}%
122
d73e6791 123\wxheading{wxTextCtrl and C++ streams}
a660d684 124
d73e6791
VZ
125This class multiply-inherits from {\bf streambuf} where compilers allow,
126allowing code such as the following:
a660d684
KB
127
128{\small%
129\begin{verbatim}
130 wxTextCtrl *control = new wxTextCtrl(...);
131
132 ostream stream(control)
133
134 stream << 123.456 << " some text\n";
135 stream.flush();
136\end{verbatim}
137}%
138
d73e6791
VZ
139If your compiler does not support derivation from {\bf streambuf} and gives a
140compile error, define the symbol {\bf NO\_TEXT\_WINDOW\_STREAM} in the
141wxTextCtrl header file.
9c884972 142
d73e6791
VZ
143Note that independently of this setting you can always use wxTextCtrl itself
144in a stream-like manner:
145
146{\small%
147\begin{verbatim}
148 wxTextCtrl *control = new wxTextCtrl(...);
149
150 *control << 123.456 << " some text\n";
151\end{verbatim}
152}%
153
154always works. However the possibility to create an ostream associated with
155wxTextCtrl may be useful if you need to redirect the output of a function
156taking an ostream as parameter to a text control.
157
158Another commonly requested need is to redirect {\bf std::cout} to the text
159control. This could be done in the following way:
160
161{\small%
162\begin{verbatim}
163 #include <iostream>
164
165 wxTextCtrl *control = new wxTextCtrl(...);
166
167 std::streambuf *sbOld = std::cout.rdbuf();
168 std::cout.rdbuf(*control);
169
170 // use cout as usual, the output appears in the text control
171 ...
172
173 std::cout.rdbuf(sbOld);
174\end{verbatim}
175}%
176
fc2171bd 177But wxWidgets provides a convenient class to make it even simpler so instead
d73e6791
VZ
178you may just do
179
180{\small%
181\begin{verbatim}
182 #include <iostream>
183
184 wxTextCtrl *control = new wxTextCtrl(...);
185
186 wxStreamToTextRedirector redirect(control);
187
188 // all output to cout goes into the text control until the exit from current
189 // scope
190\end{verbatim}
191}%
192
193See \helpref{wxStreamToTextRedirector}{wxstreamtotextredirector} for more
194details.
a660d684 195
562b0068
JS
196\wxheading{Constants}
197
198The values below are the possible return codes of the
199\helpref{HitTest}{wxtextctrlhittest} method:
200
201{\small
202\begin{verbatim}
203// the point asked is ...
204enum wxTextCtrlHitTestResult
205{
206 wxTE_HT_UNKNOWN = -2, // this means HitTest() is simply not implemented
207 wxTE_HT_BEFORE, // either to the left or upper
208 wxTE_HT_ON_TEXT, // directly on
209 wxTE_HT_BELOW, // below [the last line]
210 wxTE_HT_BEYOND // after [the end of line]
211};
212// ... the character returned
213\end{verbatim}
214}
215
216
5de76427
JS
217\wxheading{Event handling}
218
e702ff0f
JS
219The following commands are processed by default event handlers in wxTextCtrl: wxID\_CUT, wxID\_COPY,
220wxID\_PASTE, wxID\_UNDO, wxID\_REDO. The associated UI update events are also processed
221automatically, when the control has the focus.
222
5de76427
JS
223To process input from a text control, use these event handler macros to direct input to member
224functions that take a \helpref{wxCommandEvent}{wxcommandevent} argument.
225
226\twocolwidtha{7cm}%
227\begin{twocollist}\itemsep=0pt
228\twocolitem{{\bf EVT\_TEXT(id, func)}}{Respond to a wxEVT\_COMMAND\_TEXT\_UPDATED event,
f6519b40 229generated when the text changes. Notice that this event will be sent
a1665b22 230when the text controls contents changes - whether this is due to user input or
f6519b40
VZ
231comes from the program itself (for example, if SetValue() is called); see ChangeValue() for
232a function which does not send this event.}
5de76427 233\twocolitem{{\bf EVT\_TEXT\_ENTER(id, func)}}{Respond to a wxEVT\_COMMAND\_TEXT\_ENTER event,
0f66923e
VZ
234generated when enter is pressed in a text control (which must have
235wxTE\_PROCESS\_ENTER style for this event to be generated).}
43e8916f 236\twocolitem{{\bf EVT\_TEXT\_URL(id, func)}}{A mouse event occurred over an URL
d69b094f 237in the text control (wxMSW and wxGTK2 only)}
f2616db5 238\twocolitem{{\bf EVT\_TEXT\_MAXLEN(id, func)}}{User tried to enter more text
eef97940 239into the control than the limit set by
f2616db5 240\helpref{SetMaxLength}{wxtextctrlsetmaxlength}.}
5de76427
JS
241\end{twocollist}%
242
a660d684
KB
243\latexignore{\rtfignore{\wxheading{Members}}}
244
efe66bbc 245
15d83f72 246\membersection{wxTextCtrl::wxTextCtrl}\label{wxtextctrlctor}
a660d684
KB
247
248\func{}{wxTextCtrl}{\void}
249
250Default constructor.
251
eaaa6a06 252\func{}{wxTextCtrl}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp
aa8a815b
JS
253\param{const wxString\& }{value = ``"}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
254\param{long}{ style = 0}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxTextCtrlNameStr}}
a660d684
KB
255
256Constructor, creating and showing a text control.
257
258\wxheading{Parameters}
259
260\docparam{parent}{Parent window. Should not be NULL.}
261
262\docparam{id}{Control identifier. A value of -1 denotes a default value.}
263
264\docparam{value}{Default text value.}
265
266\docparam{pos}{Text control position.}
267
268\docparam{size}{Text control size.}
269
270\docparam{style}{Window style. See \helpref{wxTextCtrl}{wxtextctrl}.}
271
272\docparam{validator}{Window validator.}
273
274\docparam{name}{Window name.}
275
276\wxheading{Remarks}
277
74ede4eb
VZ
278The horizontal scrollbar ({\bf wxHSCROLL} style flag) will only be created
279for multi-line text controls.
86975656 280Without a horizontal scrollbar, text lines that don't fit in the control's
71777e2c
HH
281size will be wrapped (but no newline character is inserted). Single line
282controls don't have a horizontal scrollbar, the text is automatically scrolled
86975656 283so that the \helpref{insertion point}{wxtextctrlgetinsertionpoint} is always
71777e2c
HH
284visible.
285
c57e3339
VZ
286% VZ: this is no longer true
287%Under Windows, if the {\bf wxTE\_MULTILINE} style is used, the window is implemented
288%as a Windows rich text control with unlimited capacity. Otherwise, normal edit control limits
289%apply.
a660d684
KB
290
291\wxheading{See also}
292
293\helpref{wxTextCtrl::Create}{wxtextctrlcreate}, \helpref{wxValidator}{wxvalidator}
294
efe66bbc 295
15d83f72 296\membersection{wxTextCtrl::\destruct{wxTextCtrl}}\label{wxtextctrldtor}
a660d684
KB
297
298\func{}{\destruct{wxTextCtrl}}{\void}
299
300Destructor, destroying the text control.
301
efe66bbc 302
ca8b28f2
JS
303\membersection{wxTextCtrl::AppendText}\label{wxtextctrlappendtext}
304
305\func{void}{AppendText}{\param{const wxString\& }{ text}}
306
307Appends the text to the end of the text control.
308
309\wxheading{Parameters}
310
311\docparam{text}{Text to write to the text control.}
312
313\wxheading{Remarks}
314
315After the text is appended, the insertion point will be at the end of the text control. If this behaviour is not desired,
316the programmer should use \helpref{GetInsertionPoint}{wxtextctrlgetinsertionpoint} and \helpref{SetInsertionPoint}{wxtextctrlsetinsertionpoint}.
317
318\wxheading{See also}
319
320\helpref{wxTextCtrl::WriteText}{wxtextctrlwritetext}
321
efe66bbc 322
ca8b28f2
JS
323\membersection{wxTextCtrl::CanCopy}\label{wxtextctrlcancopy}
324
325\func{virtual bool}{CanCopy}{\void}
326
cc81d32f 327Returns {\tt true} if the selection can be copied to the clipboard.
ca8b28f2 328
efe66bbc 329
ca8b28f2
JS
330\membersection{wxTextCtrl::CanCut}\label{wxtextctrlcancut}
331
332\func{virtual bool}{CanCut}{\void}
333
cc81d32f 334Returns {\tt true} if the selection can be cut to the clipboard.
ca8b28f2 335
efe66bbc 336
ca8b28f2
JS
337\membersection{wxTextCtrl::CanPaste}\label{wxtextctrlcanpaste}
338
339\func{virtual bool}{CanPaste}{\void}
340
cc81d32f 341Returns {\tt true} if the contents of the clipboard can be pasted into the
ca8b28f2 342text control. On some platforms (Motif, GTK) this is an approximation
cc81d32f 343and returns {\tt true} if the control is editable, {\tt false} otherwise.
ca8b28f2 344
efe66bbc 345
ca8b28f2
JS
346\membersection{wxTextCtrl::CanRedo}\label{wxtextctrlcanredo}
347
348\func{virtual bool}{CanRedo}{\void}
349
cc81d32f 350Returns {\tt true} if there is a redo facility available and the last operation
ca8b28f2
JS
351can be redone.
352
efe66bbc 353
ca8b28f2
JS
354\membersection{wxTextCtrl::CanUndo}\label{wxtextctrlcanundo}
355
356\func{virtual bool}{CanUndo}{\void}
357
cc81d32f 358Returns {\tt true} if there is an undo facility available and the last operation
ca8b28f2
JS
359can be undone.
360
efe66bbc 361
a660d684
KB
362\membersection{wxTextCtrl::Clear}\label{wxtextctrlclear}
363
364\func{virtual void}{Clear}{\void}
365
366Clears the text in the control.
367
674c474f
VZ
368Note that this function will generate a {\tt wxEVT\_COMMAND\_TEXT\_UPDATED}
369event.
370
efe66bbc 371
a660d684
KB
372\membersection{wxTextCtrl::Copy}\label{wxtextctrlcopy}
373
374\func{virtual void}{Copy}{\void}
375
376Copies the selected text to the clipboard under Motif and MS Windows.
377
efe66bbc 378
a660d684
KB
379\membersection{wxTextCtrl::Create}\label{wxtextctrlcreate}
380
eaaa6a06 381\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp
aa8a815b
JS
382\param{const wxString\& }{value = ``"}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
383\param{long}{ style = 0}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxTextCtrlNameStr}}
a660d684
KB
384
385Creates the text control for two-step construction. Derived classes
15d83f72 386should call or replace this function. See \helpref{wxTextCtrl::wxTextCtrl}{wxtextctrlctor}\rtfsp
a660d684
KB
387for further details.
388
efe66bbc 389
a660d684
KB
390\membersection{wxTextCtrl::Cut}\label{wxtextctrlcut}
391
392\func{virtual void}{Cut}{\void}
393
394Copies the selected text to the clipboard and removes the selection.
395
efe66bbc 396
15d83f72 397\membersection{wxTextCtrl::DiscardEdits}\label{wxtextctrldiscardedits}
a660d684
KB
398
399\func{void}{DiscardEdits}{\void}
400
401Resets the internal `modified' flag as if the current edits had been saved.
402
efe66bbc 403
15d83f72 404\membersection{wxTextCtrl::EmulateKeyPress}\label{wxtextctrlemulatekeypress}
94af7d45
VZ
405
406\func{bool}{EmulateKeyPress}{\param{const wxKeyEvent\& }{event}}
407
408This functions inserts into the control the character which would have been
43e8916f 409inserted if the given key event had occurred in the text control. The
94af7d45 410{\it event} object should be the same as the one passed to {\tt EVT\_KEY\_DOWN}
fc2171bd 411handler previously by wxWidgets.
94af7d45 412
cd916794
VZ
413Please note that this function doesn't currently work correctly for all keys
414under any platform but MSW.
415
94af7d45
VZ
416\wxheading{Return value}
417
cc81d32f 418{\tt true} if the event resulted in a change to the control, {\tt false}
94af7d45
VZ
419otherwise.
420
efe66bbc 421
02a3b391 422\membersection{wxTextCtrl::GetDefaultStyle}\label{wxtextctrlgetdefaultstyle}
eda40bfc
VZ
423
424\constfunc{const wxTextAttr\& }{GetDefaultStyle}{\void}
425
426Returns the style currently used for the new text.
427
428\wxheading{See also}
429
430\helpref{SetDefaultStyle}{wxtextctrlsetdefaultstyle}
431
efe66bbc 432
a660d684
KB
433\membersection{wxTextCtrl::GetInsertionPoint}\label{wxtextctrlgetinsertionpoint}
434
435\constfunc{virtual long}{GetInsertionPoint}{\void}
436
71777e2c
HH
437Returns the insertion point. This is defined as the zero based index of the
438character position to the right of the insertion point. For example, if
439the insertion point is at the end of the text control, it is equal to
86975656
RD
440both \helpref{GetValue()}{wxtextctrlgetvalue}.Length() and
441\helpref{GetLastPosition()}{wxtextctrlgetlastposition}.
71777e2c
HH
442
443The following code snippet safely returns the character at the insertion
444point or the zero character if the point is at the end of the control.
445
446{\small%
447\begin{verbatim}
448 char GetCurrentChar(wxTextCtrl *tc) {
449 if (tc->GetInsertionPoint() == tc->GetLastPosition())
450 return '\0';
451 return tc->GetValue[tc->GetInsertionPoint()];
86975656 452 }
71777e2c
HH
453\end{verbatim}
454}%
a660d684 455
efe66bbc 456
a660d684
KB
457\membersection{wxTextCtrl::GetLastPosition}\label{wxtextctrlgetlastposition}
458
7d8268a1 459\constfunc{virtual wxTextPos}{GetLastPosition}{\void}
a660d684 460
86975656 461Returns the zero based index of the last position in the text control,
71777e2c 462which is equal to the number of characters in the control.
a660d684 463
efe66bbc 464
a660d684
KB
465\membersection{wxTextCtrl::GetLineLength}\label{wxtextctrlgetlinelength}
466
467\constfunc{int}{GetLineLength}{\param{long}{ lineNo}}
468
86975656 469Gets the length of the specified line, not including any trailing newline
71777e2c 470character(s).
a660d684
KB
471
472\wxheading{Parameters}
473
474\docparam{lineNo}{Line number (starting from zero).}
475
476\wxheading{Return value}
477
478The length of the line, or -1 if {\it lineNo} was invalid.
479
efe66bbc 480
a660d684
KB
481\membersection{wxTextCtrl::GetLineText}\label{wxtextctrlgetlinetext}
482
eaaa6a06 483\constfunc{wxString}{GetLineText}{\param{long}{ lineNo}}
a660d684 484
71777e2c
HH
485Returns the contents of a given line in the text control, not including
486any trailing newline character(s).
a660d684
KB
487
488\wxheading{Parameters}
489
490\docparam{lineNo}{The line number, starting from zero.}
491
492\wxheading{Return value}
493
494The contents of the line.
495
efe66bbc 496
a660d684
KB
497\membersection{wxTextCtrl::GetNumberOfLines}\label{wxtextctrlgetnumberoflines}
498
499\constfunc{int}{GetNumberOfLines}{\void}
500
501Returns the number of lines in the text control buffer.
502
71777e2c
HH
503\wxheading{Remarks}
504
505Note that even empty text controls have one line (where the insertion point
e894be20 506is), so GetNumberOfLines() never returns $0$.
71777e2c 507
e894be20
VZ
508For wxGTK using GTK+ 1.2.x and earlier, the number of lines in a multi-line
509text control is calculated by actually counting newline characters in the
510buffer, i.e. this function returns the number of logical lines and doesn't
511depend on whether any of them are wrapped. For all the other platforms, the
512number of physical lines in the control is returned.
513
514Also note that you may wish to avoid using functions that work with line
515numbers if you are working with controls that contain large amounts of text as
516this function has $O(N)$ complexity for $N$ being the number of lines.
71777e2c 517
efe66bbc 518
a5aa8086
VZ
519\membersection{wxTextCtrl::GetRange}\label{wxtextctrlgetrange}
520
521\constfunc{virtual wxString}{GetRange}{\param{long}{ from}, \param{long}{ to}}
522
43e8916f 523Returns the string containing the text starting in the positions {\it from} and
a5aa8086
VZ
524up to {\it to} in the control. The positions must have been returned by another
525wxTextCtrl method.
526
527Please note that the positions in a multiline wxTextCtrl do {\bf not}
7d8268a1 528correspond to the indices in the string returned by
a5aa8086
VZ
529\helpref{GetValue}{wxtextctrlgetvalue} because of the different new line
530representations ({\tt CR} or {\tt CR LF}) and so this method should be used to
531obtain the correct results instead of extracting parts of the entire value. It
532may also be more efficient, especially if the control contains a lot of data.
533
efe66bbc 534
ca8b28f2
JS
535\membersection{wxTextCtrl::GetSelection}\label{wxtextctrlgetselection}
536
a5aa8086 537\constfunc{virtual void}{GetSelection}{\param{long*}{ from}, \param{long*}{ to}}
ca8b28f2
JS
538
539Gets the current selection span. If the returned values are equal, there was
540no selection.
541
18414479
VZ
542Please note that the indices returned may be used with the other wxTextctrl
543methods but don't necessarily represent the correct indices into the string
544returned by \helpref{GetValue()}{wxtextctrlgetvalue} for multiline controls
eef97940
RD
545under Windows (at least,) you should use
546\helpref{GetStringSelection()}{wxtextctrlgetstringselection} to get the selected
18414479
VZ
547text.
548
ca8b28f2
JS
549\wxheading{Parameters}
550
551\docparam{from}{The returned first position.}
552
553\docparam{to}{The returned last position.}
554
86975656
RD
555\pythonnote{The wxPython version of this method returns a tuple
556consisting of the from and to values.}
557
5873607e
VZ
558\perlnote{In wxPerl this method takes no parameter and returns a
5592-element list {\tt ( from, to )}.}
560
efe66bbc 561
eef97940 562\membersection{wxTextCtrl::GetStringSelection}\label{wxtextctrlgetstringselection}
18414479 563
eef97940 564\func{virtual wxString}{GetStringSelection}{\void}
18414479
VZ
565
566Gets the text currently selected in the control. If there is no selection, the
567returned string is empty.
568
efe66bbc 569
e00a5d3c
JS
570\membersection{wxTextCtrl::GetStyle}\label{wxtextctrlgetstyle}
571
572\func{bool}{GetStyle}{\param{long }{position}, \param{wxTextAttr\& }{style}}
573
574Returns the style at this position in the text control. Not all platforms
575support this function.
576
577\wxheading{Return value}
578
43e8916f 579{\tt true} on success, {\tt false} if an error occurred - it may also mean that
e00a5d3c
JS
580the styles are not supported under this platform.
581
582\wxheading{See also}
583
584\helpref{wxTextCtrl::SetStyle}{wxtextctrlsetstyle}, \helpref{wxTextAttr}{wxtextattr}
585
efe66bbc 586
a660d684
KB
587\membersection{wxTextCtrl::GetValue}\label{wxtextctrlgetvalue}
588
589\constfunc{wxString}{GetValue}{\void}
590
9750fc42 591Gets the contents of the control. Notice that for a multiline text control,
2b5f62a0
VZ
592the lines will be separated by (Unix-style) $\backslash$n characters, even
593under Windows where they are separated by a $\backslash$r$\backslash$n
594sequence in the native control.
a660d684 595
efe66bbc
VZ
596
597\membersection{wxTextCtrl::HitTest}\label{wxtextctrlhittest}
598
599\constfunc{wxTextCtrlHitTestResult}{HitTest}{\param{const wxPoint\& }{pt}, \param{wxTextCoord }{*col}, \param{wxTextCoord }{*row}}
600
601This function finds the character at the specified position expressed in
602pixels. If the return code is not \texttt{wxTE\_HT\_UNKNOWN} the row and column
7d8268a1 603of the character closest to this position are returned in the \arg{col} and
b325f27f 604\arg{row} parameters (unless the pointers are {\tt NULL} which is allowed).
efe66bbc 605
692c9b86
VZ
606Please note that this function is currently only implemented in wxUniv,
607wxMSW and wxGTK2 ports.
efe66bbc
VZ
608
609\wxheading{See also}
610
e119d049 611\helpref{PositionToXY}{wxtextctrlpositiontoxy}, \helpref{XYToPosition}{wxtextctrlxytoposition}
efe66bbc 612
066f177c 613\perlnote{In wxPerl this function takes only the position argument and
e119d049 614returns a 3-element list \texttt{(result, col, row)}}.
efe66bbc 615
d4fbfbe5 616
9e3229b7
VZ
617\membersection{wxTextCtrl::IsEditable}\label{wxtextctrliseditable}
618
619\constfunc{bool}{IsEditable}{\void}
620
cc81d32f 621Returns {\tt true} if the controls contents may be edited by user (note that it
9e3229b7 622always can be changed by the program), i.e. if the control hasn't been put in
7d8268a1 623read-only mode by a previous call to
9e3229b7
VZ
624\helpref{SetEditable}{wxtextctrlseteditable}.
625
efe66bbc 626
d4fbfbe5
VZ
627\membersection{wxTextCtrl::IsEmpty}\label{wxtextctrlisempty}
628
629\constfunc{bool}{IsEmpty}{\void}
630
631Returns \true if the control is currently empty. This is the same as
632\texttt{GetValue().empty()} but can be much more efficient for the multiline
633controls containing big amounts of text.
634
635\newsince{2.7.1}
636
637
a660d684
KB
638\membersection{wxTextCtrl::IsModified}\label{wxtextctrlismodified}
639
640\constfunc{bool}{IsModified}{\void}
641
7d8268a1 642Returns {\tt true} if the text has been modified by user. Note that calling
29e1cfc2 643\helpref{SetValue}{wxtextctrlsetvalue} doesn't make the control modified.
a660d684 644
43e8916f
MW
645\wxheading{See also}
646
647\helpref{MarkDirty}{wxtextctrlmarkdirty}
648
efe66bbc 649
aa8e9a36
VZ
650\membersection{wxTextCtrl::IsMultiLine}\label{wxtextctrlismultiline}
651
652\constfunc{bool}{IsMultiLine}{\void}
653
cc81d32f 654Returns {\tt true} if this is a multi line edit control and {\tt false}
aa8e9a36
VZ
655otherwise.
656
657\wxheading{See also}
658
659\helpref{IsSingleLine}{wxtextctrlissingleline}
660
efe66bbc 661
aa8e9a36
VZ
662\membersection{wxTextCtrl::IsSingleLine}\label{wxtextctrlissingleline}
663
664\constfunc{bool}{IsSingleLine}{\void}
665
cc81d32f 666Returns {\tt true} if this is a single line edit control and {\tt false}
aa8e9a36
VZ
667otherwise.
668
669\wxheading{See also}
670
671\helpref{IsMultiLine}{wxtextctrlissingleline}
672
efe66bbc 673
a660d684
KB
674\membersection{wxTextCtrl::LoadFile}\label{wxtextctrlloadfile}
675
3306aec1 676\func{bool}{LoadFile}{\param{const wxString\& }{ filename}, \param{int }{fileType = wxTEXT\_TYPE\_ANY}}
a660d684
KB
677
678Loads and displays the named file, if it exists.
679
680\wxheading{Parameters}
681
682\docparam{filename}{The filename of the file to load.}
683
3306aec1
JS
684\docparam{fileType}{The type of file to load. This is currently ignored in wxTextCtrl.}
685
a660d684
KB
686\wxheading{Return value}
687
cc81d32f 688{\tt true} if successful, {\tt false} otherwise.
a660d684 689
d2d50a41
VZ
690% VZ: commenting this out as: (a) the docs are wrong (you can't replace
691% anything), (b) wxTextCtrl doesn't have any OnChar() anyhow
692%% \membersection{wxTextCtrl::OnChar}\label{wxtextctrlonchar}
7d8268a1 693%%
d2d50a41 694%% \func{void}{OnChar}{\param{wxKeyEvent\& }{event}}
7d8268a1 695%%
d2d50a41 696%% Default handler for character input.
7d8268a1 697%%
d2d50a41 698%% \wxheading{Remarks}
7d8268a1 699%%
d2d50a41
VZ
700%% It is possible to intercept character
701%% input by overriding this member. Call this function
702%% to let the default behaviour take place; not calling
703%% it results in the character being ignored. You can
704%% replace the {\it keyCode} member of {\it event} to
705%% translate keystrokes.
7d8268a1 706%%
d2d50a41
VZ
707%% Note that Windows and Motif have different ways
708%% of implementing the default behaviour. In Windows,
709%% calling wxTextCtrl::OnChar immediately
710%% processes the character. In Motif,
711%% calling this function simply sets a flag
712%% to let default processing happen. This might affect
713%% the way in which you write your OnChar function
714%% on different platforms.
7d8268a1 715%%
d2d50a41 716%% \wxheading{See also}
7d8268a1 717%%
d2d50a41 718%% \helpref{wxKeyEvent}{wxkeyevent}
a660d684 719
efe66bbc 720
43e8916f
MW
721\membersection{wxTextCtrl::MarkDirty}\label{wxtextctrlmarkdirty}
722
723\func{void}{MarkDirty}{\void}
724
725Mark text as modified (dirty).
726
727\wxheading{See also}
728
729\helpref{IsModified}{wxtextctrlismodified}
730
731
a660d684
KB
732\membersection{wxTextCtrl::OnDropFiles}\label{wxtextctrlondropfiles}
733
734\func{void}{OnDropFiles}{\param{wxDropFilesEvent\& }{event}}
735
736This event handler function implements default drag and drop behaviour, which
737is to load the first dropped file into the control.
738
739\wxheading{Parameters}
740
741\docparam{event}{The drop files event.}
742
71777e2c
HH
743\wxheading{Remarks}
744
b2cf617c 745This is not implemented on non-Windows platforms.
71777e2c 746
a660d684
KB
747\wxheading{See also}
748
749\helpref{wxDropFilesEvent}{wxdropfilesevent}
750
efe66bbc 751
a660d684
KB
752\membersection{wxTextCtrl::Paste}\label{wxtextctrlpaste}
753
754\func{virtual void}{Paste}{\void}
755
756Pastes text from the clipboard to the text item.
757
efe66bbc 758
a660d684
KB
759\membersection{wxTextCtrl::PositionToXY}\label{wxtextctrlpositiontoxy}
760
0efe5ba7 761\constfunc{bool}{PositionToXY}{\param{long }{pos}, \param{long *}{x}, \param{long *}{y}}
a660d684 762
71777e2c 763Converts given position to a zero-based column, line number pair.
a660d684
KB
764
765\wxheading{Parameters}
766
767\docparam{pos}{Position.}
768
71777e2c 769\docparam{x}{Receives zero based column number.}
a660d684 770
71777e2c
HH
771\docparam{y}{Receives zero based line number.}
772
773\wxheading{Return value}
774
cc81d32f 775{\tt true} on success, {\tt false} on failure (most likely due to a too large position
71777e2c 776parameter).
a660d684
KB
777
778\wxheading{See also}
779
780\helpref{wxTextCtrl::XYToPosition}{wxtextctrlxytoposition}
781
71777e2c
HH
782\pythonnote{In Python, PositionToXY() returns a tuple containing the x and
783y values, so (x,y) = PositionToXY() is equivalent to the call described
784above.}
785
5873607e
VZ
786\perlnote{In wxPerl this method only takes the {\tt pos} parameter, and
787returns a 2-element list {\tt ( x, y )}.}
788
efe66bbc 789
ca8b28f2
JS
790\membersection{wxTextCtrl::Redo}\label{wxtextctrlredo}
791
792\func{virtual void}{Redo}{\void}
793
794If there is a redo facility and the last operation can be redone, redoes the last operation. Does nothing
795if there is no redo facility.
796
efe66bbc 797
a660d684
KB
798\membersection{wxTextCtrl::Remove}\label{wxtextctrlremove}
799
eaaa6a06 800\func{virtual void}{Remove}{\param{long}{ from}, \param{long}{ to}}
a660d684 801
71777e2c
HH
802Removes the text starting at the first given position up to (but not including)
803the character at the last position.
a660d684
KB
804
805\wxheading{Parameters}
806
807\docparam{from}{The first position.}
808
809\docparam{to}{The last position.}
810
efe66bbc 811
a660d684
KB
812\membersection{wxTextCtrl::Replace}\label{wxtextctrlreplace}
813
eaaa6a06 814\func{virtual void}{Replace}{\param{long}{ from}, \param{long}{ to}, \param{const wxString\& }{value}}
a660d684 815
86975656 816Replaces the text starting at the first position up to (but not including)
71777e2c 817the character at the last position with the given text.
a660d684
KB
818
819\wxheading{Parameters}
820
821\docparam{from}{The first position.}
822
823\docparam{to}{The last position.}
824
825\docparam{value}{The value to replace the existing text with.}
826
efe66bbc 827
a660d684
KB
828\membersection{wxTextCtrl::SaveFile}\label{wxtextctrlsavefile}
829
3306aec1 830\func{bool}{SaveFile}{\param{const wxString\& }{ filename}, \param{int }{fileType = wxTEXT\_TYPE\_ANY}}
a660d684
KB
831
832Saves the contents of the control in a text file.
833
834\wxheading{Parameters}
835
71777e2c 836\docparam{filename}{The name of the file in which to save the text.}
a660d684 837
3306aec1
JS
838\docparam{fileType}{The type of file to save. This is currently ignored in wxTextCtrl.}
839
a660d684
KB
840\wxheading{Return value}
841
cc81d32f 842{\tt true} if the operation was successful, {\tt false} otherwise.
a660d684 843
efe66bbc 844
eda40bfc
VZ
845\membersection{wxTextCtrl::SetDefaultStyle}\label{wxtextctrlsetdefaultstyle}
846
847\func{bool}{SetDefaultStyle}{\param{const wxTextAttr\& }{style}}
848
849Changes the default style to use for the new text which is going to be added
850to the control using \helpref{WriteText}{wxtextctrlwritetext} or\rtfsp
851\helpref{AppendText}{wxtextctrlappendtext}.
852
853If either of the font, foreground, or background colour is not set in\rtfsp
854{\it style}, the values of the previous default style are used for them. If
855the previous default style didn't set them neither, the global font or colours
856of the text control itself are used as fall back.
857
c598f225
VZ
858However if the {\it style} parameter is the default wxTextAttr, then the
859default style is just reset (instead of being combined with the new style which
860wouldn't change it at all).
861
eda40bfc
VZ
862\wxheading{Parameters}
863
864\docparam{style}{The style for the new text.}
865
866\wxheading{Return value}
867
43e8916f 868{\tt true} on success, {\tt false} if an error occurred - may also mean that
eda40bfc
VZ
869the styles are not supported under this platform.
870
871\wxheading{See also}
872
873\helpref{GetDefaultStyle}{wxtextctrlgetdefaultstyle}
874
efe66bbc 875
a660d684
KB
876\membersection{wxTextCtrl::SetEditable}\label{wxtextctrlseteditable}
877
878\func{virtual void}{SetEditable}{\param{const bool}{ editable}}
879
b2cf617c 880Makes the text item editable or read-only, overriding the {\bf wxTE\_READONLY} flag.
a660d684
KB
881
882\wxheading{Parameters}
883
cc81d32f 884\docparam{editable}{If {\tt true}, the control is editable. If {\tt false}, the control is read-only.}
a660d684 885
9e3229b7
VZ
886\wxheading{See also}
887
888\helpref{IsEditable}{wxtextctrliseditable}
889
efe66bbc 890
a660d684
KB
891\membersection{wxTextCtrl::SetInsertionPoint}\label{wxtextctrlsetinsertionpoint}
892
eaaa6a06 893\func{virtual void}{SetInsertionPoint}{\param{long}{ pos}}
a660d684 894
71777e2c 895Sets the insertion point at the given position.
a660d684
KB
896
897\wxheading{Parameters}
898
899\docparam{pos}{Position to set.}
900
efe66bbc 901
a660d684
KB
902\membersection{wxTextCtrl::SetInsertionPointEnd}\label{wxtextctrlsetinsertionpointend}
903
904\func{virtual void}{SetInsertionPointEnd}{\void}
905
71777e2c
HH
906Sets the insertion point at the end of the text control. This is equivalent
907to \helpref{SetInsertionPoint}{wxtextctrlsetinsertionpoint}(\helpref{GetLastPosition}{wxtextctrlgetlastposition}()).
a660d684 908
efe66bbc 909
d7eee191
VZ
910\membersection{wxTextCtrl::SetMaxLength}\label{wxtextctrlsetmaxlength}
911
912\func{virtual void}{SetMaxLength}{\param{unsigned long }{len}}
913
914This function sets the maximum number of characters the user can enter into the
915control. In other words, it allows to limit the text value length to {\it len}
916not counting the terminating {\tt NUL} character.
917
2edb0bde 918If {\it len} is $0$, the previously set max length limit, if any, is discarded
5949fba6
VZ
919and the user may enter as much text as the underlying native text control
920widget supports (typically at least 32Kb).
921
d7eee191 922If the user tries to enter more characters into the text control when it
eef97940 923already is filled up to the maximal length, a
d7eee191
VZ
924{\tt wxEVT\_COMMAND\_TEXT\_MAXLEN} event is sent to notify the program about it
925(giving it the possibility to show an explanatory message, for example) and the
926extra input is discarded.
927
4a82116e 928Note that under GTK+, this function may only be used with single line text controls.
d7eee191
VZ
929
930\wxheading{Compatibility}
931
fc2171bd 932Only implemented in wxMSW/wxGTK starting with wxWidgets 2.3.2.
d7eee191 933
efe66bbc 934
be0ac181
VZ
935\membersection{wxTextCtrl::SetModified}\label{wxtextctrlsetmodified}
936
937\func{void}{SetModified}{\param{bool }{modified}}
938
939Marks the control as being modified by the user or not.
940
941\wxheading{See also}
942
943\helpref{MarkDirty}{wxtextctrlmarkdirty}, \helpref{DiscardEdits}{wxtextctrldiscardedits}
944
945
a660d684
KB
946\membersection{wxTextCtrl::SetSelection}\label{wxtextctrlsetselection}
947
eaaa6a06 948\func{virtual void}{SetSelection}{\param{long}{ from}, \param{long}{ to}}
a660d684 949
4d7b7fc2
VZ
950Selects the text starting at the first position up to (but not including) the
951character at the last position. If both parameters are equal to $-1$ all text
952in the control is selected.
a660d684
KB
953
954\wxheading{Parameters}
955
956\docparam{from}{The first position.}
957
958\docparam{to}{The last position.}
959
efe66bbc 960
eda40bfc
VZ
961\membersection{wxTextCtrl::SetStyle}\label{wxtextctrlsetstyle}
962
963\func{bool}{SetStyle}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttr\& }{style}}
964
e00a5d3c 965Changes the style of the given range. If any attribute within {\it style} is
dbd94b75 966not set, the corresponding attribute from \helpref{GetDefaultStyle()}{wxtextctrlgetdefaultstyle} is used.
eda40bfc
VZ
967
968\wxheading{Parameters}
969
e00a5d3c 970\docparam{start}{The start of the range to change.}
eda40bfc 971
e00a5d3c 972\docparam{end}{The end of the range to change.}
eda40bfc 973
e00a5d3c 974\docparam{style}{The new style for the range.}
eda40bfc
VZ
975
976\wxheading{Return value}
977
43e8916f 978{\tt true} on success, {\tt false} if an error occurred - it may also mean that
eda40bfc
VZ
979the styles are not supported under this platform.
980
e00a5d3c
JS
981\wxheading{See also}
982
983\helpref{wxTextCtrl::GetStyle}{wxtextctrlgetstyle}, \helpref{wxTextAttr}{wxtextattr}
984
efe66bbc 985
a660d684
KB
986\membersection{wxTextCtrl::SetValue}\label{wxtextctrlsetvalue}
987
988\func{virtual void}{SetValue}{\param{const wxString\& }{ value}}
989
7d8268a1 990Sets the text value and marks the control as not-modified (which means that
cc81d32f 991\helpref{IsModified}{wxtextctrlismodified} would return {\tt false} immediately
29e1cfc2 992after the call to SetValue).
a660d684 993
674c474f
VZ
994Note that this function will generate a {\tt wxEVT\_COMMAND\_TEXT\_UPDATED}
995event.
996
f6519b40
VZ
997This function is deprecated and should not be used in new code. Please use the
998\helpref{ChangeValue}{wxtextctrlchangevalue} function instead.
999
1000\wxheading{Parameters}
1001
1002\docparam{value}{The new value to set. It may contain newline characters if the text control is multi-line.}
1003
1004
1005\membersection{wxTextCtrl::ChangeValue}\label{wxtextctrlchangevalue}
1006
1007\func{virtual void}{ChangeValue}{\param{const wxString\& }{ value}}
1008
1009Sets the text value and marks the control as not-modified (which means that
1010\helpref{IsModified}{wxtextctrlismodified} would return {\tt false} immediately
1011after the call to SetValue).
1012
1013Note that this function will \emph{not} generate the {\tt wxEVT\_COMMAND\_TEXT\_UPDATED}
1014event.
1015This is the only difference with \helpref{SetValue}{wxtextctrlsetvalue}.
b42a3531
VZ
1016See \helpref{this topic}{progevent} for more information.
1017
1018\newsince{2.7.1}
f6519b40 1019
a660d684
KB
1020\wxheading{Parameters}
1021
1022\docparam{value}{The new value to set. It may contain newline characters if the text control is multi-line.}
1023
efe66bbc 1024
a660d684
KB
1025\membersection{wxTextCtrl::ShowPosition}\label{wxtextctrlshowposition}
1026
eaaa6a06 1027\func{void}{ShowPosition}{\param{long}{ pos}}
a660d684
KB
1028
1029Makes the line containing the given position visible.
1030
1031\wxheading{Parameters}
1032
1033\docparam{pos}{The position that should be visible.}
1034
efe66bbc 1035
ca8b28f2
JS
1036\membersection{wxTextCtrl::Undo}\label{wxtextctrlundo}
1037
1038\func{virtual void}{Undo}{\void}
1039
1040If there is an undo facility and the last operation can be undone, undoes the last operation. Does nothing
1041if there is no undo facility.
1042
efe66bbc 1043
a660d684
KB
1044\membersection{wxTextCtrl::WriteText}\label{wxtextctrlwritetext}
1045
1046\func{void}{WriteText}{\param{const wxString\& }{ text}}
1047
86975656 1048Writes the text into the text control at the current insertion position.
a660d684
KB
1049
1050\wxheading{Parameters}
1051
1052\docparam{text}{Text to write to the text control.}
1053
1054\wxheading{Remarks}
1055
1056Newlines in the text string
1057are the only control characters allowed, and they will cause appropriate
abaa2936 1058line breaks. See \helpref{wxTextCtrl::\cinsert}{wxtextctrlinsert} and \helpref{wxTextCtrl::AppendText}{wxtextctrlappendtext} for more convenient ways of writing to the window.
71777e2c
HH
1059
1060After the write operation, the insertion point will be at the end of the inserted text, so subsequent write operations will be appended. To append text after the user may have interacted with the control, call \helpref{wxTextCtrl::SetInsertionPointEnd}{wxtextctrlsetinsertionpointend} before writing.
a660d684 1061
efe66bbc 1062
a660d684
KB
1063\membersection{wxTextCtrl::XYToPosition}\label{wxtextctrlxytoposition}
1064
eaaa6a06 1065\func{long}{XYToPosition}{\param{long}{ x}, \param{long}{ y}}
a660d684 1066
71777e2c 1067Converts the given zero based column and line number to a position.
a660d684
KB
1068
1069\wxheading{Parameters}
1070
71777e2c 1071\docparam{x}{The column number.}
a660d684 1072
71777e2c 1073\docparam{y}{The line number.}
a660d684
KB
1074
1075\wxheading{Return value}
1076
21d23b88 1077The position value, or -1 if {\tt x} or {\tt y} was invalid.
a660d684 1078
efe66bbc 1079
a660d684
KB
1080\membersection{wxTextCtrl::operator \cinsert}\label{wxtextctrlinsert}
1081
1082\func{wxTextCtrl\&}{operator \cinsert}{\param{const wxString\& }{s}}
1083
1084\func{wxTextCtrl\&}{operator \cinsert}{\param{int}{ i}}
1085
1086\func{wxTextCtrl\&}{operator \cinsert}{\param{long}{ i}}
1087
1088\func{wxTextCtrl\&}{operator \cinsert}{\param{float}{ f}}
1089
1090\func{wxTextCtrl\&}{operator \cinsert}{\param{double}{ d}}
1091
1092\func{wxTextCtrl\&}{operator \cinsert}{\param{char}{ c}}
1093
abaa2936 1094Operator definitions for appending to a text control, for example:
a660d684
KB
1095
1096\begin{verbatim}
1097 wxTextCtrl *wnd = new wxTextCtrl(my_frame);
1098
1099 (*wnd) << "Welcome to text control number " << 1 << ".\n";
1100\end{verbatim}
1101