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