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