]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/richtextctrl.tex
ability to create tab mdi children without activating page
[wxWidgets.git] / docs / latex / wx / richtextctrl.tex
1 \section{\class{wxRichTextCtrl}}\label{wxrichtextctrl}
2
3 wxRichTextCtrl provides a generic, ground-up implementation of a text control
4 capable of showing multiple styles and images.
5
6 \wxheading{Derived from}
7
8 wxTextCtrlBase
9
10 \wxheading{Include files}
11
12 <wx/richtext/richtextctrl.h>
13
14 \wxheading{Data structures}
15
16 \latexignore{\rtfignore{\wxheading{Members}}}
17
18 \membersection{wxRichTextCtrl::wxRichTextCtrl}\label{wxrichtextctrlwxrichtextctrl}
19
20 \func{}{wxRichTextCtrl}{\void}
21
22 \func{}{wxRichTextCtrl}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxString\& }{value = wxEmptyString},
23 \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxRE\_MULTILINE},
24 \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxTextCtrlNameStr}}
25
26 Constructors.
27
28 \membersection{wxRichTextCtrl::\destruct{wxRichTextCtrl}}\label{wxrichtextctrldtor}
29
30 \func{}{\destruct{wxRichTextCtrl}}{\void}
31
32 Destructor.
33
34 \membersection{wxRichTextCtrl::AddImage}\label{wxrichtextctrladdimage}
35
36 \func{wxRichTextRange}{AddImage}{\param{const wxImage\& }{image}}
37
38 Adds an image to the control's buffer.
39
40 \membersection{wxRichTextCtrl::AddParagraph}\label{wxrichtextctrladdparagraph}
41
42 \func{wxRichTextRange}{AddParagraph}{\param{const wxString\& }{text}}
43
44 Adds a new paragraph of text to the end of the buffer.
45
46 \membersection{wxRichTextCtrl::AppendText}\label{wxrichtextctrlappendtext}
47
48 \func{void}{AppendText}{\param{const wxString\& }{text}}
49
50 Sets the insertion point to the end of the buffer and writes the text.
51
52 \membersection{wxRichTextCtrl::ApplyAlignmentToSelection}\label{wxrichtextctrlapplyalignmenttoselection}
53
54 \func{bool}{ApplyAlignmentToSelection}{\param{wxTextAttrAlignment }{alignment}}
55
56 Applies the given alignment to the selection (undoable).
57
58 For alignment values, see \helpref{wxTextAttrEx}{wxtextattrex}.
59
60 \membersection{wxRichTextCtrl::ApplyBoldToSelection}\label{wxrichtextctrlapplyboldtoselection}
61
62 \func{bool}{ApplyBoldToSelection}{\void}
63
64 Apples bold to the selection (undoable).
65
66 \membersection{wxRichTextCtrl::ApplyItalicToSelection}\label{wxrichtextctrlapplyitalictoselection}
67
68 \func{bool}{ApplyItalicToSelection}{\void}
69
70 Applies italic to the selection (undoable).
71
72 \membersection{wxRichTextCtrl::ApplyStyle}\label{wxrichtextctrlapplystyle}
73
74 \func{bool}{ApplyStyle}{\param{wxRichTextStyleDefinition*}{ def}}
75
76 Applies the given style to the selection.
77
78 \membersection{wxRichTextCtrl::ApplyStyleSheet}\label{wxrichtextctrlapplystylesheet}
79
80 \func{bool}{ApplyStyleSheet}{\param{wxRichTextStyleSheet*}{ sheet $=$ NULL}}
81
82 Applies the style sheet to the buffer, matching paragraph styles in the sheet against named styles
83 in the buffer. This might be useful if the styles have changed. If {\it sheet} is NULL, the
84 sheet set with SetStyleSheet is used.
85
86 Currently this applies paragraph styles only.
87
88 \membersection{wxRichTextCtrl::ApplyUnderlineToSelection}\label{wxrichtextctrlapplyunderlinetoselection}
89
90 \func{bool}{ApplyUnderlineToSelection}{\void}
91
92 Applies underline to the selection (undoable).
93
94 \membersection{wxRichTextCtrl::BatchingUndo}\label{wxrichtextctrlbatchingundo}
95
96 \constfunc{bool}{BatchingUndo}{\void}
97
98 Returns \true if undo commands are being batched.
99
100 \membersection{wxRichTextCtrl::BeginAlignment}\label{wxrichtextctrlbeginalignment}
101
102 \func{bool}{BeginAlignment}{\param{wxTextAttrAlignment }{alignment}}
103
104 Begins using alignment
105
106 For alignment values, see \helpref{wxTextAttrEx}{wxtextattrex}.
107
108 \membersection{wxRichTextCtrl::BeginBatchUndo}\label{wxrichtextctrlbeginbatchundo}
109
110 \func{bool}{BeginBatchUndo}{\param{const wxString\& }{cmdName}}
111
112 Starts batching undo history for commands.
113
114 \membersection{wxRichTextCtrl::BeginBold}\label{wxrichtextctrlbeginbold}
115
116 \func{bool}{BeginBold}{\void}
117
118 Begins using bold.
119
120 \membersection{wxRichTextCtrl::BeginCharacterStyle}\label{wxrichtextctrlbegincharacterstyle}
121
122 \func{bool}{BeginCharacterStyle}{\param{const wxString\& }{characterStyle}}
123
124 Begins using the named character style.
125
126 \membersection{wxRichTextCtrl::BeginFont}\label{wxrichtextctrlbeginfont}
127
128 \func{bool}{BeginFont}{\param{const wxFont\& }{font}}
129
130 Begins using this font.
131
132 \membersection{wxRichTextCtrl::BeginFontSize}\label{wxrichtextctrlbeginfontsize}
133
134 \func{bool}{BeginFontSize}{\param{int }{pointSize}}
135
136 Begins using the given point size.
137
138 \membersection{wxRichTextCtrl::BeginItalic}\label{wxrichtextctrlbeginitalic}
139
140 \func{bool}{BeginItalic}{\void}
141
142 Begins using italic.
143
144 \membersection{wxRichTextCtrl::BeginLeftIndent}\label{wxrichtextctrlbeginleftindent}
145
146 \func{bool}{BeginLeftIndent}{\param{int }{leftIndent}, \param{int }{leftSubIndent = 0}}
147
148 Begins applying a left indent and subindent in tenths of a millimetre.
149
150 The sub-indent is an offset from the left of the paragraph, and is used for all but the
151 first line in a paragraph. A positive value will cause the first line to appear to the left
152 of the subsequent lines, and a negative value will cause the first line to be indented
153 relative to the subsequent lines.
154
155 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
156 the margin and the bullet. The content of the paragraph, including the first line, starts
157 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
158 left of the actual paragraph is leftSubIndent.
159
160 \membersection{wxRichTextCtrl::BeginLineSpacing}\label{wxrichtextctrlbeginlinespacing}
161
162 \func{bool}{BeginLineSpacing}{\param{int }{lineSpacing}}
163
164 Begins appling line spacing. {\it spacing} is a multiple, where 10 means single-spacing,
165 15 means 1.5 spacing, and 20 means double spacing. The following constants are
166 defined for convenience:
167
168 {\small
169 \begin{verbatim}
170 #define wxTEXT_ATTR_LINE_SPACING_NORMAL 10
171 #define wxTEXT_ATTR_LINE_SPACING_HALF 15
172 #define wxTEXT_ATTR_LINE_SPACING_TWICE 20
173 \end{verbatim}
174 }
175
176 \membersection{wxRichTextCtrl::BeginListStyle}\label{wxrichtextctrlbeginliststyle}
177
178 \func{bool}{BeginListStyle}{\param{const wxString\&}{ listStyle}, \param{int}{ level=1}, \param{int}{ number=1}}
179
180 Begins using a specified list style. Optionally, you can also pass a level and a number.
181
182 \membersection{wxRichTextCtrl::BeginNumberedBullet}\label{wxrichtextctrlbeginnumberedbullet}
183
184 \func{bool}{BeginNumberedBullet}{\param{int }{bulletNumber}, \param{int }{leftIndent}, \param{int }{leftSubIndent}, \param{int }{bulletStyle = wxTEXT\_ATTR\_BULLET\_STYLE\_ARABIC|wxTEXT\_ATTR\_BULLET\_STYLE\_PERIOD}}
185
186 Begins a numbered bullet. This call will be needed for each item in the list, and the
187 application should take care of incrementing the numbering.
188
189 {\it bulletNumber} is a number, usually starting with 1.
190
191 {\it leftIndent} and {\it leftSubIndent} are values in tenths of a millimetre.
192
193 {\it bulletStyle} is a bitlist of the following values:
194
195 {\small
196 \begin{verbatim}
197 #define wxTEXT_ATTR_BULLET_STYLE_NONE 0x00000000
198 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x00000001
199 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x00000002
200 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x00000004
201 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x00000008
202 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x00000010
203 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x00000020
204 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x00000040
205 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x00000080
206 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x00000100
207 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD 0x00000200
208 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS 0x00000400
209 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE 0x00000800
210 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT 0x00000000
211 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT 0x00001000
212 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE 0x00002000
213 \end{verbatim}
214 }
215
216 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
217 the margin and the bullet. The content of the paragraph, including the first line, starts
218 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
219 left of the actual paragraph is leftSubIndent.
220
221 \membersection{wxRichTextCtrl::BeginParagraphSpacing}\label{wxrichtextctrlbeginparagraphspacing}
222
223 \func{bool}{BeginParagraphSpacing}{\param{int }{before}, \param{int }{after}}
224
225 Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of
226 a millimetre.
227
228 \membersection{wxRichTextCtrl::BeginParagraphStyle}\label{wxrichtextctrlbeginparagraphstyle}
229
230 \func{bool}{BeginParagraphStyle}{\param{const wxString\& }{paragraphStyle}}
231
232 Begins applying the named paragraph style.
233
234 \membersection{wxRichTextCtrl::BeginRightIndent}\label{wxrichtextctrlbeginrightindent}
235
236 \func{bool}{BeginRightIndent}{\param{int }{rightIndent}}
237
238 Begins a right indent, specified in tenths of a millimetre.
239
240 \membersection{wxRichTextCtrl::BeginStyle}\label{wxrichtextctrlbeginstyle}
241
242 \func{bool}{BeginStyle}{\param{const wxTextAttrEx\& }{style}}
243
244 Begins applying a style.
245
246 \membersection{wxRichTextCtrl::BeginSuppressUndo}\label{wxrichtextctrlbeginsuppressundo}
247
248 \func{bool}{BeginSuppressUndo}{\void}
249
250 Starts suppressing undo history for commands.
251
252 \membersection{wxRichTextCtrl::BeginSymbolBullet}\label{wxrichtextctrlbeginsymbolbullet}
253
254 \func{bool}{BeginSymbolBullet}{\param{wxChar }{symbol}, \param{int }{leftIndent}, \param{int }{leftSubIndent}, \param{int }{bulletStyle = wxTEXT\_ATTR\_BULLET\_STYLE\_SYMBOL}}
255
256 Begins applying a symbol bullet, using a character from the current font. See \helpref{BeginNumberedBullet}{wxrichtextctrlbeginnumberedbullet} for
257 an explanation of how indentation is used to render the bulleted paragraph.
258
259 \membersection{wxRichTextCtrl::BeginTextColour}\label{wxrichtextctrlbegintextcolour}
260
261 \func{bool}{BeginTextColour}{\param{const wxColour\& }{colour}}
262
263 Begins using this colour.
264
265 \membersection{wxRichTextCtrl::BeginUnderline}\label{wxrichtextctrlbeginunderline}
266
267 \func{bool}{BeginUnderline}{\void}
268
269 Begins using underlining.
270
271 \membersection{wxRichTextCtrl::BeginURL}\label{wxrichtextctrlbeginurl}
272
273 \func{bool}{BeginURL}{\param{const wxString\&}{ url}, \param{const wxString\&}{ characterStyle = wxEmptyString}}
274
275 Begins applying wxTEXT\_ATTR\_URL to the content. Pass a URL and optionally, a character style to apply,
276 since it is common to mark a URL with a familiar style such as blue text with underlining.
277
278 \membersection{wxRichTextCtrl::CanCopy}\label{wxrichtextctrlcancopy}
279
280 \constfunc{bool}{CanCopy}{\void}
281
282 Returns \true if selected content can be copied to the clipboard.
283
284 \membersection{wxRichTextCtrl::CanCut}\label{wxrichtextctrlcancut}
285
286 \constfunc{bool}{CanCut}{\void}
287
288 Returns \true if selected content can be copied to the clipboard and deleted.
289
290 \membersection{wxRichTextCtrl::CanDeleteSelection}\label{wxrichtextctrlcandeleteselection}
291
292 \constfunc{bool}{CanDeleteSelection}{\void}
293
294 Returns \true if selected content can be deleted.
295
296 \membersection{wxRichTextCtrl::CanPaste}\label{wxrichtextctrlcanpaste}
297
298 \constfunc{bool}{CanPaste}{\void}
299
300 Returns \true if the clipboard content can be pasted to the buffer.
301
302 \membersection{wxRichTextCtrl::CanRedo}\label{wxrichtextctrlcanredo}
303
304 \constfunc{bool}{CanRedo}{\void}
305
306 Returns \true if there is a command in the command history that can be redone.
307
308 \membersection{wxRichTextCtrl::CanUndo}\label{wxrichtextctrlcanundo}
309
310 \constfunc{bool}{CanUndo}{\void}
311
312 Returns \true if there is a command in the command history that can be undone.
313
314 \membersection{wxRichTextCtrl::Clear}\label{wxrichtextctrlclear}
315
316 \func{void}{Clear}{\void}
317
318 Clears the buffer content, leaving a single empty paragraph. Cannot be undone.
319
320 \membersection{wxRichTextCtrl::ClearListStyle}\label{wxrichtextctrlclearliststyle}
321
322 \func{bool}{ClearListStyle}{\param{const wxRichTextRange\& }{range}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
323
324 \func{bool}{ClearListStyle}{\param{const wxRichTextRange\& }{range}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
325
326 Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph.
327
328 {\it flags} is a bit list of the following:
329
330 \begin{itemize}\itemsep=0pt
331 \item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
332 \end{itemize}
333
334 See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlsetliststyle}, \helpref{wxRichTextCtrl::PromoteList}{wxrichtextctrlpromotelist}, \helpref{wxRichTextCtrl::NumberList}{wxrichtextctrlnumberlist}.
335
336 \membersection{wxRichTextCtrl::Command}\label{wxrichtextctrlcommand}
337
338 \func{void}{Command}{\param{wxCommandEvent\& }{event}}
339
340 Sends the event to the control.
341
342 \membersection{wxRichTextCtrl::Copy}\label{wxrichtextctrlcopy}
343
344 \func{void}{Copy}{\void}
345
346 Copies the selected content (if any) to the clipboard.
347
348 \membersection{wxRichTextCtrl::Create}\label{wxrichtextctrlcreate}
349
350 \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxString\& }{value = wxEmptyString},
351 \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxRE\_MULTILINE},
352 \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxTextCtrlNameStr}}
353
354 Creates the underlying window.
355
356 \membersection{wxRichTextCtrl::Cut}\label{wxrichtextctrlcut}
357
358 \func{void}{Cut}{\void}
359
360 Copies the selected content (if any) to the clipboard and deletes the selection.
361 This is undoable.
362
363 \membersection{wxRichTextCtrl::DeleteSelectedContent}\label{wxrichtextctrldeleteselectedcontent}
364
365 \func{bool}{DeleteSelectedContent}{\param{long* }{newPos = NULL}}
366
367 Deletes content if there is a selection, e.g. when pressing a key.
368 Returns the new caret position in {\it newPos}, or leaves it if there
369 was no action. This is undoable.
370
371 \membersection{wxRichTextCtrl::DeleteSelection}\label{wxrichtextctrldeleteselection}
372
373 \func{void}{DeleteSelection}{\void}
374
375 Deletes the content in the selection, if any. This is undoable.
376
377 \membersection{wxRichTextCtrl::DiscardEdits}\label{wxrichtextctrldiscardedits}
378
379 \func{void}{DiscardEdits}{\void}
380
381 Sets the buffer's modified status to \false, and clears the buffer's command history.
382
383 \membersection{wxRichTextCtrl::DoGetBestSize}\label{wxrichtextctrldogetbestsize}
384
385 \constfunc{wxSize}{DoGetBestSize}{\void}
386
387 Currently this simply returns {\tt wxSize(10, 10)}.
388
389 \membersection{wxRichTextCtrl::EndAlignment}\label{wxrichtextctrlendalignment}
390
391 \func{bool}{EndAlignment}{\void}
392
393 Ends alignment.
394
395 \membersection{wxRichTextCtrl::EndAllStyles}\label{wxrichtextctrlendallstyles}
396
397 \func{bool}{EndAllStyles}{\void}
398
399 Ends application of all styles in the current style stack.
400
401 \membersection{wxRichTextCtrl::EndBatchUndo}\label{wxrichtextctrlendbatchundo}
402
403 \func{bool}{EndBatchUndo}{\void}
404
405 Ends batching undo command history.
406
407 \membersection{wxRichTextCtrl::EndBold}\label{wxrichtextctrlendbold}
408
409 \func{bool}{EndBold}{\void}
410
411 Ends using bold.
412
413 \membersection{wxRichTextCtrl::EndCharacterStyle}\label{wxrichtextctrlendcharacterstyle}
414
415 \func{bool}{EndCharacterStyle}{\void}
416
417 Ends application of a named character style.
418
419 \membersection{wxRichTextCtrl::EndFont}\label{wxrichtextctrlendfont}
420
421 \func{bool}{EndFont}{\void}
422
423 Ends using a font.
424
425 \membersection{wxRichTextCtrl::EndFontSize}\label{wxrichtextctrlendfontsize}
426
427 \func{bool}{EndFontSize}{\void}
428
429 Ends using a point size.
430
431 \membersection{wxRichTextCtrl::EndItalic}\label{wxrichtextctrlenditalic}
432
433 \func{bool}{EndItalic}{\void}
434
435 Ends using italic.
436
437 \membersection{wxRichTextCtrl::EndLeftIndent}\label{wxrichtextctrlendleftindent}
438
439 \func{bool}{EndLeftIndent}{\void}
440
441 Ends left indent.
442
443 \membersection{wxRichTextCtrl::EndLineSpacing}\label{wxrichtextctrlendlinespacing}
444
445 \func{bool}{EndLineSpacing}{\void}
446
447 Ends line spacing.
448
449 \membersection{wxRichTextCtrl::EndListStyle}\label{wxrichtextctrlendliststyle}
450
451 \func{bool}{EndListStyle}{\void}
452
453 Ends using a specified list style.
454
455 \membersection{wxRichTextCtrl::EndNumberedBullet}\label{wxrichtextctrlendnumberedbullet}
456
457 \func{bool}{EndNumberedBullet}{\void}
458
459 Ends application of a numbered bullet.
460
461 \membersection{wxRichTextCtrl::EndParagraphSpacing}\label{wxrichtextctrlendparagraphspacing}
462
463 \func{bool}{EndParagraphSpacing}{\void}
464
465 Ends paragraph spacing.
466
467 \membersection{wxRichTextCtrl::EndParagraphStyle}\label{wxrichtextctrlendparagraphstyle}
468
469 \func{bool}{EndParagraphStyle}{\void}
470
471 Ends application of a named character style.
472
473 \membersection{wxRichTextCtrl::EndRightIndent}\label{wxrichtextctrlendrightindent}
474
475 \func{bool}{EndRightIndent}{\void}
476
477 Ends right indent.
478
479 \membersection{wxRichTextCtrl::EndStyle}\label{wxrichtextctrlendstyle}
480
481 \func{bool}{EndStyle}{\void}
482
483 Ends the current style.
484
485 \membersection{wxRichTextCtrl::EndSuppressUndo}\label{wxrichtextctrlendsuppressundo}
486
487 \func{bool}{EndSuppressUndo}{\void}
488
489 Ends suppressing undo command history.
490
491 \membersection{wxRichTextCtrl::EndSymbolBullet}\label{wxrichtextctrlendsymbolbullet}
492
493 \func{bool}{EndSymbolBullet}{\void}
494
495 Ends applying a symbol bullet.
496
497 \membersection{wxRichTextCtrl::EndTextColour}\label{wxrichtextctrlendtextcolour}
498
499 \func{bool}{EndTextColour}{\void}
500
501 Ends applying a text colour.
502
503 \membersection{wxRichTextCtrl::EndUnderline}\label{wxrichtextctrlendunderline}
504
505 \func{bool}{EndUnderline}{\void}
506
507 End applying underlining.
508
509 \membersection{wxRichTextCtrl::EndURL}\label{wxrichtextctrlendurl}
510
511 \func{bool}{EndURL}{\void}
512
513 Ends applying a URL.
514
515 \membersection{wxRichTextCtrl::ExtendSelection}\label{wxrichtextctrlextendselection}
516
517 \func{bool}{ExtendSelection}{\param{long }{oldPosition}, \param{long }{newPosition}, \param{int }{flags}}
518
519 Helper function for extending the selection, returning \true if the selection was
520 changed. Selections are in caret positions.
521
522 \membersection{wxRichTextCtrl::FindNextWordPosition}\label{wxrichtextctrlfindnextwordposition}
523
524 \constfunc{long}{FindNextWordPosition}{\param{int }{direction = 1}}
525
526 Helper function for finding the caret position for the next word. Direction
527 is 1 (forward) or -1 (backwards).
528
529 \membersection{wxRichTextCtrl::Freeze}\label{wxrichtextctrlfreeze}
530
531 \func{void}{Freeze}{\void}
532
533 Call this function to prevent refresh and allow fast updates, and then \helpref{Thaw}{wxrichtextctrlthaw} to
534 refresh the control.
535
536 \membersection{wxRichTextCtrl::GetBasicStyle}\label{wxrichtextctrlgetbasicstyle}
537
538 \constfunc{const wxTextAttrEx\&}{GetBasicStyle}{\void}
539
540 Gets the basic (overall) style. This is the style of the whole
541 buffer before further styles are applied, unlike the default style, which
542 only affects the style currently being applied (for example, setting the default
543 style to bold will cause subsequently inserted text to be bold).
544
545 \membersection{wxRichTextCtrl::GetBuffer}\label{wxrichtextctrlgetbuffer}
546
547 \constfunc{const wxRichTextBuffer\&}{GetBuffer}{\void}
548
549 \func{wxRichTextBuffer\&}{GetBuffer}{\void}
550
551 Returns the buffer associated with the control.
552
553 \membersection{wxRichTextCtrl::GetCaretPosition}\label{wxrichtextctrlgetcaretposition}
554
555 \constfunc{long}{GetCaretPosition}{\void}
556
557 Returns the current caret position.
558
559 \membersection{wxRichTextCtrl::GetCaretPositionForIndex}\label{wxrichtextctrlgetcaretpositionforindex}
560
561 \func{bool}{GetCaretPositionForIndex}{\param{long }{position}, \param{wxRect\& }{rect}}
562
563 Returns the caret height and position for the given character position
564
565 \membersection{wxRichTextCtrl::GetCommandProcessor}\label{wxrichtextctrlgetcommandprocessor}
566
567 \constfunc{wxCommandProcessor*}{GetCommandProcessor}{\void}
568
569 Gets the command processor associated with the control's buffer.
570
571 \membersection{wxRichTextCtrl::GetDefaultStyleEx}\label{wxrichtextctrlgetdefaultstyleex}
572
573 \constfunc{const wxTextAttrEx\&}{GetDefaultStyleEx}{\void}
574
575 Returns the current default style, which can be used to change how subsequently inserted
576 text is displayed. When wxTextAttrEx is merged with wxTextAttr, this function
577 will become GetDefaultStyle.
578
579 \membersection{wxRichTextCtrl::GetDelayedLayoutThreshold}\label{wxrichtextctrlgetdelayedlayoutthreshold}
580
581 \constfunc{long}{GetDelayedLayoutThreshold}{\void}
582
583 Gets the size of the buffer beyond which layout is delayed during resizing.
584 This optimizes sizing for large buffers. The default is 20000.
585
586 \membersection{wxRichTextCtrl::GetFilename}\label{wxrichtextctrlgetfilename}
587
588 \constfunc{wxString}{GetFilename}{\void}
589
590 Gets the current filename associated with the control.
591
592 \membersection{wxRichTextCtrl::GetFirstVisiblePosition}\label{wxrichtextctrlgetfirstvisibleposition}
593
594 \constfunc{long}{GetFirstVisiblePosition}{\void}
595
596 Returns the first visible position in the current view.
597
598 \membersection{wxRichTextCtrl::GetHandlerFlags}\label{wxrichtextfilehandlergethandlerflags}
599
600 \constfunc{int}{GetHandlerFlags}{\void}
601
602 Returns flags that change the behaviour of loading or saving. See the documentation for each
603 handler class to see what flags are relevant for each handler.
604
605 \membersection{wxRichTextCtrl::GetInsertionPoint}\label{wxrichtextctrlgetinsertionpoint}
606
607 \constfunc{long}{GetInsertionPoint}{\void}
608
609 Returns the current insertion point.
610
611 \membersection{wxRichTextCtrl::GetLastPosition}\label{wxrichtextctrlgetlastposition}
612
613 \constfunc{wxTextPos}{GetLastPosition}{\void}
614
615 Returns the last position in the buffer.
616
617 \membersection{wxRichTextCtrl::GetLineLength}\label{wxrichtextctrlgetlinelength}
618
619 \constfunc{int}{GetLineLength}{\param{long }{lineNo}}
620
621 Returns the length of the specified line in characters.
622
623 \membersection{wxRichTextCtrl::GetLineText}\label{wxrichtextctrlgetlinetext}
624
625 \constfunc{wxString}{GetLineText}{\param{long }{lineNo}}
626
627 Returns the text for the given line.
628
629 \membersection{wxRichTextCtrl::GetLogicalPoint}\label{wxrichtextctrlgetlogicalpoint}
630
631 \constfunc{wxPoint}{GetLogicalPoint}{\param{const wxPoint\& }{ptPhysical}}
632
633 Transforms physical window position to logical (unscrolled) position.
634
635 \membersection{wxRichTextCtrl::GetNumberOfLines}\label{wxrichtextctrlgetnumberoflines}
636
637 \constfunc{int}{GetNumberOfLines}{\void}
638
639 Returns the number of lines in the buffer.
640
641 \membersection{wxRichTextCtrl::GetPhysicalPoint}\label{wxrichtextctrlgetphysicalpoint}
642
643 \constfunc{wxPoint}{GetPhysicalPoint}{\param{const wxPoint\& }{ptLogical}}
644
645 Transforms logical (unscrolled) position to physical window position.
646
647 \membersection{wxRichTextCtrl::GetRange}\label{wxrichtextctrlgetrange}
648
649 \constfunc{wxString}{GetRange}{\param{long }{from}, \param{long }{to}}
650
651 Gets the text for the given range.
652
653 The end point of range is specified as the last character position of the span of text, plus one.
654
655 \membersection{wxRichTextCtrl::GetSelection}\label{wxrichtextctrlgetselection}
656
657 \constfunc{void}{GetSelection}{\param{long* }{from}, \param{long* }{to}}
658
659 Returns the range of the current selection.
660
661 The end point of range is specified as the last character position of the span of text, plus one.
662
663 If the return values {\it from} and {\it to} are the same, there is no selection.
664
665 \membersection{wxRichTextCtrl::GetSelectionRange}\label{wxrichtextctrlgetselectionrange}
666
667 \constfunc{const wxRichTextRange\&}{GetSelectionRange}{\void}
668
669 Returns the selection range in character positions. -1, -1 means no selection.
670
671 \membersection{wxRichTextCtrl::GetStringSelection}\label{wxrichtextctrlgetstringselection}
672
673 \constfunc{wxString}{GetStringSelection}{\void}
674
675 Returns the text within the current selection range, if any.
676
677 \membersection{wxRichTextCtrl::GetStyle}\label{wxrichtextctrlgetstyle}
678
679 \func{bool}{GetStyle}{\param{long }{position}, \param{wxRichTextAttr\& }{style}}
680
681 \func{bool}{GetStyle}{\param{long }{position}, \param{wxTextAttrEx\& }{style}}
682
683 \func{bool}{GetStyle}{\param{long }{position}, \param{wxTextAttr\& }{style}}
684
685 Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
686 because it does not use wxFont objects.
687
688 This function gets the combined style - that is, the style you see on the screen as a result
689 of combining base style, paragraph style and character style attributes. To get the character
690 or paragraph style alone, use \helpref{GetUncombinedStyle}{wxrichtextctrlgetuncombinedstyle}.
691
692 \membersection{wxRichTextCtrl::GetStyleSheet}\label{wxrichtextctrlgetstylesheet}
693
694 \constfunc{wxRichTextStyleSheet*}{GetStyleSheet}{\void}
695
696 Returns the style sheet associated with the control, if any. A style sheet allows named
697 character and paragraph styles to be applied.
698
699 \membersection{wxRichTextCtrl::GetUncombinedStyle}\label{wxrichtextctrlgetuncombinedstyle}
700
701 \func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxRichTextAttr\& }{style}}
702
703 \func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxTextAttrEx\& }{style}}
704
705 \func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxTextAttr\& }{style}}
706
707 Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
708 because it does not use wxFont objects.
709
710 This function gets the {\it uncombined style} - that is, the attributes associated with the
711 paragraph or character content, and not necessarily the combined attributes you see on the
712 screen. To get the combined attributes, use \helpref{GetStyle}{wxrichtextctrlgetstyle}.
713
714 If you specify (any) paragraph attribute in {\it style}'s flags, this function will fetch
715 the paragraph attributes. Otherwise, it will return the character attributes.
716
717 \membersection{wxRichTextCtrl::GetValue}\label{wxrichtextctrlgetvalue}
718
719 \constfunc{wxString}{GetValue}{\void}
720
721 Returns the content of the entire control as a string.
722
723 \membersection{wxRichTextCtrl::GetVisibleLineForCaretPosition}\label{wxrichtextctrlgetvisiblelineforcaretposition}
724
725 \constfunc{wxRichTextLine*}{GetVisibleLineForCaretPosition}{\param{long }{caretPosition}}
726
727 Internal helper function returning the line for the visible caret position. If the caret is
728 shown at the very end of the line, it means the next character is actually
729 on the following line. So this function gets the line we're expecting to find
730 if this is the case.
731
732 \membersection{wxRichTextCtrl::HasCharacterAttributes}\label{wxrichtextctrlhascharacterattributes}
733
734 \constfunc{bool}{HasCharacterAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}}
735
736 \constfunc{bool}{HasCharacterAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}
737
738 Test if this whole range has character attributes of the specified kind. If any
739 of the attributes are different within the range, the test fails. You
740 can use this to implement, for example, bold button updating. {\it style} must have
741 flags indicating which attributes are of interest.
742
743 \membersection{wxRichTextCtrl::HasParagraphAttributes}\label{wxrichtextctrlhasparagraphattributes}
744
745 \constfunc{bool}{HasParagraphAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}}
746
747 \constfunc{bool}{HasParagraphAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}
748
749 Test if this whole range has paragraph attributes of the specified kind. If any
750 of the attributes are different within the range, the test fails. You
751 can use this to implement, for example, centering button updating. {\it style} must have
752 flags indicating which attributes are of interest.
753
754 \membersection{wxRichTextCtrl::HasSelection}\label{wxrichtextctrlhasselection}
755
756 \constfunc{bool}{HasSelection}{\void}
757
758 Returns \true if there is a selection.
759
760 \membersection{wxRichTextCtrl::HitTest}\label{wxrichtextctrlhittest}
761
762 \constfunc{wxTextCtrlHitTestResult}{HitTest}{\param{const wxPoint\& }{pt}, \param{long* }{pos}}
763
764 \constfunc{wxTextCtrlHitTestResult}{HitTest}{\param{const wxPoint\& }{pt}, \param{wxTextCoord* }{col}, \param{wxTextCoord* }{row}}
765
766 Finds the character at the given position in pixels.
767
768 {\it pt} is in device coords (not adjusted for the client area origin nor for scrolling).
769
770 \membersection{wxRichTextCtrl::Init}\label{wxrichtextctrlinit}
771
772 \func{void}{Init}{\void}
773
774 Initialises the members of the control.
775
776 \membersection{wxRichTextCtrl::InitCommandEvent}\label{wxrichtextctrlinitcommandevent}
777
778 \constfunc{void}{InitCommandEvent}{\param{wxCommandEvent\& }{event}}
779
780 Initialises the command event.
781
782 \membersection{wxRichTextCtrl::IsDefaultStyleShowing}\label{wxrichtextctrlisdefaultstyleshowing}
783
784 \constfunc{bool}{IsDefaultStyleShowing}{\void}
785
786 Returns \true if the user has recently set the default style without moving the caret,
787 and therefore the UI needs to reflect the default style and not the style at the caret.
788
789 Below is an example of code that uses this function to determine whether the UI
790 should show that the current style is bold.
791
792 \begin{verbatim}
793 /// Is all of the selection bold?
794 bool wxRichTextCtrl::IsSelectionBold()
795 {
796 if (HasSelection())
797 {
798 wxRichTextAttr attr;
799 wxRichTextRange range = GetInternalSelectionRange();
800 attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
801 attr.SetFontWeight(wxBOLD);
802
803 return HasCharacterAttributes(range, attr);
804 }
805 else
806 {
807 // If no selection, then we need to combine current style with default style
808 // to see what the effect would be if we started typing.
809 wxRichTextAttr attr;
810 attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
811
812 long pos = GetAdjustedCaretPosition(GetCaretPosition());
813 if (GetStyle(pos, attr))
814 {
815 if (IsDefaultStyleShowing())
816 wxRichTextApplyStyle(attr, GetDefaultStyleEx());
817 return attr.GetFontWeight() == wxBOLD;
818 }
819 }
820 return false;
821 }
822 \end{verbatim}
823
824 See also \helpref{SetAndShowDefaultStyle}{wxrichtextctrlsetandshowdefaultstyle}.
825
826 \membersection{wxRichTextCtrl::IsEditable}\label{wxrichtextctrliseditable}
827
828 \constfunc{bool}{IsEditable}{\void}
829
830 Returns \true if the control is editable.
831
832 \membersection{wxRichTextCtrl::IsFrozen}\label{wxrichtextctrlisfrozen}
833
834 \constfunc{bool}{IsFrozen}{\void}
835
836 Returns \true if Freeze has been called without a Thaw.
837
838 \membersection{wxRichTextCtrl::IsModified}\label{wxrichtextctrlismodified}
839
840 \constfunc{bool}{IsModified}{\void}
841
842 Returns \true if the buffer has been modified.
843
844 \membersection{wxRichTextCtrl::IsMultiLine}\label{wxrichtextctrlismultiline}
845
846 \constfunc{bool}{IsMultiLine}{\void}
847
848 Returns \true if the control is multiline.
849
850 \membersection{wxRichTextCtrl::IsPositionVisible}\label{wxrichtextctrlispositionvisible}
851
852 \constfunc{bool}{IsPositionVisible}{\param{long }{pos}}
853
854 Returns \true if the given position is visible on the screen.
855
856 \membersection{wxRichTextCtrl::IsSelectionAligned}\label{wxrichtextctrlisselectionaligned}
857
858 \constfunc{bool}{IsSelectionAligned}{\param{wxTextAttrAlignment }{alignment}}
859
860 Returns \true if all of the selection is aligned according to the specified flag.
861
862 \membersection{wxRichTextCtrl::IsSelectionBold}\label{wxrichtextctrlisselectionbold}
863
864 \constfunc{bool}{IsSelectionBold}{\void}
865
866 Returns \true if all of the selection is bold.
867
868 \membersection{wxRichTextCtrl::IsSelectionItalics}\label{wxrichtextctrlisselectionitalics}
869
870 \constfunc{bool}{IsSelectionItalics}{\void}
871
872 Returns \true if all of the selection is italic.
873
874 \membersection{wxRichTextCtrl::IsSelectionUnderlined}\label{wxrichtextctrlisselectionunderlined}
875
876 \constfunc{bool}{IsSelectionUnderlined}{\void}
877
878 Returns \true if all of the selection is underlined.
879
880 \membersection{wxRichTextCtrl::IsSingleLine}\label{wxrichtextctrlissingleline}
881
882 \constfunc{bool}{IsSingleLine}{\void}
883
884 Returns \true if the control is single-line. Currently wxRichTextCtrl does not
885 support single-line editing.
886
887 \membersection{wxRichTextCtrl::KeyboardNavigate}\label{wxrichtextctrlkeyboardnavigate}
888
889 \func{bool}{KeyboardNavigate}{\param{int }{keyCode}, \param{int }{flags}}
890
891 Helper function implementing keyboard navigation.
892
893 \membersection{wxRichTextCtrl::LayoutContent}\label{wxrichtextctrllayoutcontent}
894
895 \func{bool}{LayoutContent}{\param{bool }{onlyVisibleRect = false}}
896
897 Lays out the buffer, which must be done before certain operations, such as
898 setting the caret position. This function should not normally be required by the
899 application.
900
901 \membersection{wxRichTextCtrl::LoadFile}\label{wxrichtextctrlloadfile}
902
903 \func{bool}{LoadFile}{\param{const wxString\& }{file}, \param{int }{type = wxRICHTEXT\_TYPE\_ANY}}
904
905 Loads content into the control's buffer using the given type. If the specified type
906 is wxRICHTEXT\_TYPE\_ANY, the type is deduced from the filename extension.
907
908 This function looks for a suitable \helpref{wxRichTextFileHandler}{wxrichtextfilehandler} object.
909
910 \membersection{wxRichTextCtrl::MarkDirty}\label{wxrichtextctrlmarkdirty}
911
912 \func{void}{MarkDirty}{\void}
913
914 Marks the buffer as modified.
915
916 \membersection{wxRichTextCtrl::MoveCaret}\label{wxrichtextctrlmovecaret}
917
918 \func{bool}{MoveCaret}{\param{long }{pos}, \param{bool }{showAtLineStart = false}}
919
920 Move the caret to the given character position.
921
922 \membersection{wxRichTextCtrl::MoveCaretBack}\label{wxrichtextctrlmovecaretback}
923
924 \func{void}{MoveCaretBack}{\param{long }{oldPosition}}
925
926 Move the caret one visual step forward: this may mean setting a flag
927 and keeping the same position if we're going from the end of one line
928 to the start of the next, which may be the exact same caret position.
929
930 \membersection{wxRichTextCtrl::MoveCaretForward}\label{wxrichtextctrlmovecaretforward}
931
932 \func{void}{MoveCaretForward}{\param{long }{oldPosition}}
933
934 Move the caret one visual step forward: this may mean setting a flag
935 and keeping the same position if we're going from the end of one line
936 to the start of the next, which may be the exact same caret position.
937
938 \membersection{wxRichTextCtrl::MoveDown}\label{wxrichtextctrlmovedown}
939
940 \func{bool}{MoveDown}{\param{int }{noLines = 1}, \param{int }{flags = 0}}
941
942 Moves the caret down.
943
944 \membersection{wxRichTextCtrl::MoveEnd}\label{wxrichtextctrlmoveend}
945
946 \func{bool}{MoveEnd}{\param{int }{flags = 0}}
947
948 Moves to the end of the buffer.
949
950 \membersection{wxRichTextCtrl::MoveHome}\label{wxrichtextctrlmovehome}
951
952 \func{bool}{MoveHome}{\param{int }{flags = 0}}
953
954 Moves to the start of the buffer.
955
956 \membersection{wxRichTextCtrl::MoveLeft}\label{wxrichtextctrlmoveleft}
957
958 \func{bool}{MoveLeft}{\param{int }{noPositions = 1}, \param{int }{flags = 0}}
959
960 Moves left.
961
962 \membersection{wxRichTextCtrl::MoveRight}\label{wxrichtextctrlmoveright}
963
964 \func{bool}{MoveRight}{\param{int }{noPositions = 1}, \param{int }{flags = 0}}
965
966 Moves right.
967
968 \membersection{wxRichTextCtrl::MoveToLineEnd}\label{wxrichtextctrlmovetolineend}
969
970 \func{bool}{MoveToLineEnd}{\param{int }{flags = 0}}
971
972 Moves to the end of the line.
973
974 \membersection{wxRichTextCtrl::MoveToLineStart}\label{wxrichtextctrlmovetolinestart}
975
976 \func{bool}{MoveToLineStart}{\param{int }{flags = 0}}
977
978 Moves to the start of the line.
979
980 \membersection{wxRichTextCtrl::MoveToParagraphEnd}\label{wxrichtextctrlmovetoparagraphend}
981
982 \func{bool}{MoveToParagraphEnd}{\param{int }{flags = 0}}
983
984 Moves to the end of the paragraph.
985
986 \membersection{wxRichTextCtrl::MoveToParagraphStart}\label{wxrichtextctrlmovetoparagraphstart}
987
988 \func{bool}{MoveToParagraphStart}{\param{int }{flags = 0}}
989
990 Moves to the start of the paragraph.
991
992 \membersection{wxRichTextCtrl::MoveUp}\label{wxrichtextctrlmoveup}
993
994 \func{bool}{MoveUp}{\param{int }{noLines = 1}, \param{int }{flags = 0}}
995
996 Moves up.
997
998 \membersection{wxRichTextCtrl::Newline}\label{wxrichtextctrlnewline}
999
1000 \func{bool}{Newline}{\void}
1001
1002 Insert a newline (actually paragraph) at the current insertion point.
1003
1004 \membersection{wxRichTextCtrl::NumberList}\label{wxrichtextctrlnumberlist}
1005
1006 \func{bool}{NumberList}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextListStyleDefinition* }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ startFrom = -1}, \param{int}{ listLevel = -1}}
1007
1008 \func{bool}{Number}{\param{const wxRichTextRange\& }{range}, \param{const wxString\& }{styleName}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ startFrom = -1}, \param{int}{ listLevel = -1}}
1009
1010 Numbers the paragraphs in the given range. Pass flags to determine how the attributes are set.
1011 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1012
1013 {\it flags} is a bit list of the following:
1014
1015 \begin{itemize}\itemsep=0pt
1016 \item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1017 \item wxRICHTEXT\_SETSTYLE\_RENUMBER: specifies that numbering should start from {\it startFrom}, otherwise existing attributes are used.
1018 \item wxRICHTEXT\_SETSTYLE\_SPECIFY\_LEVEL: specifies that {\it listLevel} should be used as the level for all paragraphs, otherwise the current indentation will be used.
1019 \end{itemize}
1020
1021 See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlsetliststyle}, \helpref{wxRichTextCtrl::PromoteList}{wxrichtextctrlpromotelist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.
1022
1023 \membersection{wxRichTextCtrl::OnClear}\label{wxrichtextctrlonclear}
1024
1025 \func{void}{OnClear}{\param{wxCommandEvent\& }{event}}
1026
1027 Standard handler for the wxID\_CLEAR command.
1028
1029 \membersection{wxRichTextCtrl::OnContextMenu}\label{wxrichtextctrloncontextmenu}
1030
1031 \func{void}{OnContextMenu}{\param{wxContextMenuEvent\& }{event}}
1032
1033 Shows a standard context menu with undo, redo, cut, copy, paste, clear, and select all commands.
1034
1035 \membersection{wxRichTextCtrl::OnCopy}\label{wxrichtextctrloncopy}
1036
1037 \func{void}{OnCopy}{\param{wxCommandEvent\& }{event}}
1038
1039 Standard handler for the wxID\_COPY command.
1040
1041 \membersection{wxRichTextCtrl::OnCut}\label{wxrichtextctrloncut}
1042
1043 \func{void}{OnCut}{\param{wxCommandEvent\& }{event}}
1044
1045 Standard handler for the wxID\_CUT command.
1046
1047 \membersection{wxRichTextCtrl::OnDropFiles}\label{wxrichtextctrlondropfiles}
1048
1049 \func{void}{OnDropFiles}{\param{wxDropFilesEvent\& }{event}}
1050
1051 Loads the first dropped file.
1052
1053 \membersection{wxRichTextCtrl::OnPaste}\label{wxrichtextctrlonpaste}
1054
1055 \func{void}{OnPaste}{\param{wxCommandEvent\& }{event}}
1056
1057 Standard handler for the wxID\_PASTE command.
1058
1059 \membersection{wxRichTextCtrl::OnRedo}\label{wxrichtextctrlonredo}
1060
1061 \func{void}{OnRedo}{\param{wxCommandEvent\& }{event}}
1062
1063 Standard handler for the wxID\_REDO command.
1064
1065 \membersection{wxRichTextCtrl::OnSelectAll}\label{wxrichtextctrlonselectall}
1066
1067 \func{void}{OnSelectAll}{\param{wxCommandEvent\& }{event}}
1068
1069 Standard handler for the wxID\_SELECTALL command.
1070
1071 \membersection{wxRichTextCtrl::OnUndo}\label{wxrichtextctrlonundo}
1072
1073 \func{void}{OnUndo}{\param{wxCommandEvent\& }{event}}
1074
1075 Standard handler for the wxID\_PASTE command.
1076
1077 \membersection{wxRichTextCtrl::OnUpdateClear}\label{wxrichtextctrlonupdateclear}
1078
1079 \func{void}{OnUpdateClear}{\param{wxUpdateUIEvent\& }{event}}
1080
1081 Standard update handler for the wxID\_CLEAR command.
1082
1083 \membersection{wxRichTextCtrl::OnUpdateCopy}\label{wxrichtextctrlonupdatecopy}
1084
1085 \func{void}{OnUpdateCopy}{\param{wxUpdateUIEvent\& }{event}}
1086
1087 Standard update handler for the wxID\_COPY command.
1088
1089 \membersection{wxRichTextCtrl::OnUpdateCut}\label{wxrichtextctrlonupdatecut}
1090
1091 \func{void}{OnUpdateCut}{\param{wxUpdateUIEvent\& }{event}}
1092
1093 Standard update handler for the wxID\_CUT command.
1094
1095 \membersection{wxRichTextCtrl::OnUpdatePaste}\label{wxrichtextctrlonupdatepaste}
1096
1097 \func{void}{OnUpdatePaste}{\param{wxUpdateUIEvent\& }{event}}
1098
1099 Standard update handler for the wxID\_PASTE command.
1100
1101 \membersection{wxRichTextCtrl::OnUpdateRedo}\label{wxrichtextctrlonupdateredo}
1102
1103 \func{void}{OnUpdateRedo}{\param{wxUpdateUIEvent\& }{event}}
1104
1105 Standard update handler for the wxID\_REDO command.
1106
1107 \membersection{wxRichTextCtrl::OnUpdateSelectAll}\label{wxrichtextctrlonupdateselectall}
1108
1109 \func{void}{OnUpdateSelectAll}{\param{wxUpdateUIEvent\& }{event}}
1110
1111 Standard update handler for the wxID\_SELECTALL command.
1112
1113 \membersection{wxRichTextCtrl::OnUpdateUndo}\label{wxrichtextctrlonupdateundo}
1114
1115 \func{void}{OnUpdateUndo}{\param{wxUpdateUIEvent\& }{event}}
1116
1117 Standard update handler for the wxID\_UNDO command.
1118
1119 \membersection{wxRichTextCtrl::PageDown}\label{wxrichtextctrlpagedown}
1120
1121 \func{bool}{PageDown}{\param{int }{noPages = 1}, \param{int }{flags = 0}}
1122
1123 Moves one or more pages down.
1124
1125 \membersection{wxRichTextCtrl::PageUp}\label{wxrichtextctrlpageup}
1126
1127 \func{bool}{PageUp}{\param{int }{noPages = 1}, \param{int }{flags = 0}}
1128
1129 Moves one or more pages up.
1130
1131 \membersection{wxRichTextCtrl::PaintBackground}\label{wxrichtextctrlpaintbackground}
1132
1133 \func{void}{PaintBackground}{\param{wxDC\& }{dc}}
1134
1135 Paints the background.
1136
1137 \membersection{wxRichTextCtrl::Paste}\label{wxrichtextctrlpaste}
1138
1139 \func{void}{Paste}{\void}
1140
1141 Pastes content from the clipboard to the buffer.
1142
1143 \membersection{wxRichTextCtrl::PositionCaret}\label{wxrichtextctrlpositioncaret}
1144
1145 \func{void}{PositionCaret}{\void}
1146
1147 Internal function to position the visible caret according to the current caret position.
1148
1149 \membersection{wxRichTextCtrl::PositionToXY}\label{wxrichtextctrlpositiontoxy}
1150
1151 \constfunc{bool}{PositionToXY}{\param{long }{pos}, \param{long* }{x}, \param{long* }{y}}
1152
1153 Converts a text position to zero-based column and line numbers.
1154
1155 \membersection{wxRichTextCtrl::PromoteList}\label{wxrichtextctrlpromotelist}
1156
1157 \func{bool}{PromoteList}{\param{int}{ promoteBy}, \param{const wxRichTextRange\& }{range}, \param{const wxRichTextListStyleDefinition* }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ listLevel = -1}}
1158
1159 \func{bool}{PromoteList}{\param{int}{ promoteBy}, \param{const wxRichTextRange\& }{range}, \param{const wxString\& }{styleName}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ listLevel = -1}}
1160
1161 Promotes or demotes the paragraphs in the given range. A positive {\it promoteBy} produces a smaller indent, and a negative number
1162 produces a larger indent. Pass flags to determine how the attributes are set.
1163 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1164
1165 {\it flags} is a bit list of the following:
1166
1167 \begin{itemize}\itemsep=0pt
1168 \item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1169 \item wxRICHTEXT\_SETSTYLE\_RENUMBER: specifies that numbering should start from {\it startFrom}, otherwise existing attributes are used.
1170 \item wxRICHTEXT\_SETSTYLE\_SPECIFY\_LEVEL: specifies that {\it listLevel} should be used as the level for all paragraphs, otherwise the current indentation will be used.
1171 \end{itemize}
1172
1173 See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlsetliststyle}, See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlnumberlist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.
1174
1175 \membersection{wxRichTextCtrl::Redo}\label{wxrichtextctrlredo}
1176
1177 \func{void}{Redo}{\void}
1178
1179 Redoes the current command.
1180
1181 \membersection{wxRichTextCtrl::Remove}\label{wxrichtextctrlremove}
1182
1183 \func{void}{Remove}{\param{long }{from}, \param{long }{to}}
1184
1185 Removes the content in the specified range.
1186
1187 \membersection{wxRichTextCtrl::Replace}\label{wxrichtextctrlreplace}
1188
1189 \func{void}{Replace}{\param{long }{from}, \param{long }{to}, \param{const wxString\& }{value}}
1190
1191 Replaces the content in the specified range with the string specified by {\it value}.
1192
1193 \membersection{wxRichTextCtrl::SaveFile}\label{wxrichtextctrlsavefile}
1194
1195 \func{bool}{SaveFile}{\param{const wxString\& }{file = wxEmptyString}, \param{int }{type = wxRICHTEXT\_TYPE\_ANY}}
1196
1197 Saves the buffer content using the given type. If the specified type
1198 is wxRICHTEXT\_TYPE\_ANY, the type is deduced from the filename extension.
1199
1200 This function looks for a suitable \helpref{wxRichTextFileHandler}{wxrichtextfilehandler} object.
1201
1202 \membersection{wxRichTextCtrl::ScrollIntoView}\label{wxrichtextctrlscrollintoview}
1203
1204 \func{bool}{ScrollIntoView}{\param{long }{position}, \param{int }{keyCode}}
1205
1206 Scrolls {\it position} into view. This function takes a caret position.
1207
1208 \membersection{wxRichTextCtrl::SelectAll}\label{wxrichtextctrlselectall}
1209
1210 \func{void}{SelectAll}{\void}
1211
1212 Selects all the text in the buffer.
1213
1214 \membersection{wxRichTextCtrl::SelectNone}\label{wxrichtextctrlselectnone}
1215
1216 \func{void}{SelectNone}{\void}
1217
1218 Cancels any selection.
1219
1220 \membersection{wxRichTextCtrl::SetAndShowDefaultStyle}\label{wxrichtextctrlsetandshowdefaultstyle}
1221
1222 \func{void}{SetAndShowDefaultStyle}{\param{const wxRichTextAttr\& }{attr}}
1223
1224 Sets {\it attr} as the default style and tells the control that the UI should reflect
1225 this attribute until the user moves the caret.
1226
1227 See also \helpref{IsDefaultStyleShowing}{wxrichtextctrlisdefaultstyleshowing}.
1228
1229 \membersection{wxRichTextCtrl::SetBasicStyle}\label{wxrichtextctrlsetbasicstyle}
1230
1231 \func{void}{SetBasicStyle}{\param{const wxRichTextAttr\& }{style}}
1232
1233 \func{void}{SetBasicStyle}{\param{const wxTextAttrEx\& }{style}}
1234
1235 Sets the basic (overall) style. This is the style of the whole
1236 buffer before further styles are applied, unlike the default style, which
1237 only affects the style currently being applied (for example, setting the default
1238 style to bold will cause subsequently inserted text to be bold).
1239
1240 \membersection{wxRichTextCtrl::SetCaretPosition}\label{wxrichtextctrlsetcaretposition}
1241
1242 \func{void}{SetCaretPosition}{\param{long }{position}, \param{bool }{showAtLineStart = false}}
1243
1244 The caret position is the character position just before the caret.
1245 A value of -1 means the caret is at the start of the buffer.
1246
1247 \membersection{wxRichTextCtrl::SetDefaultStyle}\label{wxrichtextctrlsetdefaultstyle}
1248
1249 \func{bool}{SetDefaultStyle}{\param{const wxTextAttrEx\& }{style}}
1250
1251 Sets the current default style, which can be used to change how subsequently inserted
1252 text is displayed.
1253
1254 \membersection{wxRichTextCtrl::SetDefaultStyleToCursorStyle}\label{wxrichtextctrlsetdefaultstyletocursorstyle}
1255
1256 \func{bool}{SetDefaultStyleToCursorStyle}{\void}
1257
1258 Sets the default style to the style under the cursor.
1259
1260 \membersection{wxRichTextCtrl::SetDelayedLayoutThreshold}\label{wxrichtextctrlsetdelayedlayoutthreshold}
1261
1262 \func{void}{SetDelayedLayoutThreshold}{\param{long }{threshold}}
1263
1264 Sets the size of the buffer beyond which layout is delayed during resizing.
1265 This optimizes sizing for large buffers. The default is 20000.
1266
1267 \membersection{wxRichTextCtrl::SetEditable}\label{wxrichtextctrlseteditable}
1268
1269 \func{void}{SetEditable}{\param{bool }{editable}}
1270
1271 Makes the control editable, or not.
1272
1273 \membersection{wxRichTextCtrl::SetFilename}\label{wxrichtextctrlsetfilename}
1274
1275 \func{void}{SetFilename}{\param{const wxString\& }{filename}}
1276
1277 Sets the current filename.
1278
1279 \membersection{wxRichTextCtrl::SetFont}\label{wxrichtextctrlsetfont}
1280
1281 \func{bool}{SetFont}{\param{const wxFont\& }{font}}
1282
1283 Sets the font, and also the basic and default attributes (see \helpref{SetDefaultStyle}{wxrichtextctrlsetdefaultstyle}).
1284
1285 \membersection{wxRichTextCtrl::SetHandlerFlags}\label{wxrichtextctrlsethandlerflags}
1286
1287 \func{void}{SetHandlerFlags}{\param{int }{flags}}
1288
1289 Sets flags that change the behaviour of loading or saving. See the documentation for each
1290 handler class to see what flags are relevant for each handler.
1291
1292 \membersection{wxRichTextCtrl::SetInsertionPoint}\label{wxrichtextctrlsetinsertionpoint}
1293
1294 \func{void}{SetInsertionPoint}{\param{long }{pos}}
1295
1296 Sets the insertion point.
1297
1298 \membersection{wxRichTextCtrl::SetInsertionPointEnd}\label{wxrichtextctrlsetinsertionpointend}
1299
1300 \func{void}{SetInsertionPointEnd}{\void}
1301
1302 Sets the insertion point to the end of the text control.
1303
1304 \membersection{wxRichTextCtrl::SetListStyle}\label{wxrichtextctrlsetliststyle}
1305
1306 \func{bool}{SetListStyle}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextListStyleDefinition* }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ startFrom = -1}, \param{int}{ listLevel = -1}}
1307
1308 \func{bool}{SetListStyle}{\param{const wxRichTextRange\& }{range}, \param{const wxString\& }{styleName}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ startFrom = -1}, \param{int}{ listLevel = -1}}
1309
1310 Sets the list attributes for the given range, passing flags to determine how the attributes are set.
1311 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1312
1313 {\it flags} is a bit list of the following:
1314
1315 \begin{itemize}\itemsep=0pt
1316 \item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1317 \item wxRICHTEXT\_SETSTYLE\_RENUMBER: specifies that numbering should start from {\it startFrom}, otherwise existing attributes are used.
1318 \item wxRICHTEXT\_SETSTYLE\_SPECIFY\_LEVEL: specifies that {\it listLevel} should be used as the level for all paragraphs, otherwise the current indentation will be used.
1319 \end{itemize}
1320
1321 See also \helpref{wxRichTextCtrl::NumberList}{wxrichtextctrlnumberlist}, \helpref{wxRichTextCtrl::PromoteList}{wxrichtextctrlpromotelist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.
1322
1323 \membersection{wxRichTextCtrl::SetSelection}\label{wxrichtextctrlsetselection}
1324
1325 \func{void}{SetSelection}{\param{long }{from}, \param{long }{to}}
1326
1327 Sets the selection to the given range.
1328
1329 The end point of range is specified as the last character position of the span of text, plus one.
1330 So, for example, to set the style for a character at position 5, use the range (5,6).
1331
1332 \membersection{wxRichTextCtrl::SetSelectionRange}\label{wxrichtextctrlsetselectionrange}
1333
1334 \func{void}{SetSelectionRange}{\param{const wxRichTextRange\& }{range}}
1335
1336 Sets the selection to the given range.
1337
1338 The end point of range is specified as the last character position of the span of text, plus one.
1339 So, for example, to set the style for a character at position 5, use the range (5,6).
1340
1341 \membersection{wxRichTextCtrl::SetStyle}\label{wxrichtextctrlsetstyle}
1342
1343 \func{bool}{SetStyle}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}
1344
1345 \func{bool}{SetStyle}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttrEx\& }{style}}
1346
1347 \func{bool}{SetStyle}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttr\& }{style}}
1348
1349 Sets the attributes for the given range. The wxRichTextAttr version is more efficient
1350 because it does not use wxFont objects.
1351
1352 The end point of range is specified as the last character position of the span of text, plus one.
1353 So, for example, to set the style for a character at position 5, use the range (5,6).
1354
1355 \membersection{wxRichTextCtrl::SetStyleEx}\label{wxrichtextctrlsetstyleex}
1356
1357 \func{bool}{SetStyleEx}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
1358
1359 \func{bool}{SetStyleEx}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
1360
1361 \func{bool}{SetStyleEx}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttrEx\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
1362
1363 Sets the attributes for the given range, passing flags to determine how the attributes are set. The wxRichTextAttr version is more efficient
1364 because it does not use wxFont objects.
1365
1366 The end point of range is specified as the last character position of the span of text, plus one.
1367 So, for example, to set the style for a character at position 5, use the range (5,6).
1368
1369 {\it flags} may contain a bit list of the following values:
1370
1371 \begin{itemize}\itemsep=0pt
1372 \item wxRICHTEXT\_SETSTYLE\_NONE: no style flag.
1373 \item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this operation should be undoable.
1374 \item wxRICHTEXT\_SETSTYLE\_OPTIMIZE: specifies that the style should not be applied if the
1375 combined style at this point is already the style in question.
1376 \item define wxRICHTEXT\_SETSTYLE\_PARAGRAPHS\_ONLY: specifies that the style should only be applied to paragraphs,
1377 and not the content. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
1378 \item wxRICHTEXT\_SETSTYLE\_CHARACTERS\_ONLY: specifies that the style should only be applied to characters,
1379 and not the paragraph. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
1380 \end{itemize}
1381
1382 \membersection{wxRichTextCtrl::SetStyleSheet}\label{wxrichtextctrlsetstylesheet}
1383
1384 \func{void}{SetStyleSheet}{\param{wxRichTextStyleSheet* }{styleSheet}}
1385
1386 Sets the style sheet associated with the control. A style sheet allows named
1387 character and paragraph styles to be applied.
1388
1389 \membersection{wxRichTextCtrl::SetValue}\label{wxrichtextctrlsetvalue}
1390
1391 \func{void}{SetValue}{\param{const wxString\& }{value}}
1392
1393 Replaces existing content with the given text.
1394
1395 \membersection{wxRichTextCtrl::SetupScrollbars}\label{wxrichtextctrlsetupscrollbars}
1396
1397 \func{void}{SetupScrollbars}{\param{bool }{atTop = false}}
1398
1399 A helper function setting up scrollbars, for example after a resize.
1400
1401 \membersection{wxRichTextCtrl::ShowPosition}\label{wxrichtextctrlshowposition}
1402
1403 \func{void}{ShowPosition}{\param{long }{pos}}
1404
1405 Scrolls the buffer so that the given position is in view.
1406
1407 \membersection{wxRichTextCtrl::SuppressingUndo}\label{wxrichtextctrlsuppressingundo}
1408
1409 \constfunc{bool}{SuppressingUndo}{\void}
1410
1411 Returns \true if undo history suppression is on.
1412
1413 \membersection{wxRichTextCtrl::Thaw}\label{wxrichtextctrlthaw}
1414
1415 \func{void}{Thaw}{\void}
1416
1417 Call this function to end a Freeze and refresh the display.
1418
1419 \membersection{wxRichTextCtrl::Undo}\label{wxrichtextctrlundo}
1420
1421 \func{void}{Undo}{\void}
1422
1423 Undoes the command at the top of the command history, if there is one.
1424
1425 \membersection{wxRichTextCtrl::WordLeft}\label{wxrichtextctrlwordleft}
1426
1427 \func{bool}{WordLeft}{\param{int }{noWords = 1}, \param{int }{flags = 0}}
1428
1429 Moves a number of words to the left.
1430
1431 \membersection{wxRichTextCtrl::WordRight}\label{wxrichtextctrlwordright}
1432
1433 \func{bool}{WordRight}{\param{int }{noWords = 1}, \param{int }{flags = 0}}
1434
1435 Move a nuber of words to the right.
1436
1437 \membersection{wxRichTextCtrl::WriteImage}\label{wxrichtextctrlwriteimage}
1438
1439 \func{bool}{WriteImage}{\param{const wxString\& }{filename}, \param{int }{bitmapType}}
1440
1441 Loads an image from a file and writes it at the current insertion point.
1442
1443 \func{bool}{WriteImage}{\param{const wxRichTextImageBlock\& }{imageBlock}}
1444
1445 Writes an image block at the current insertion point.
1446
1447 \func{bool}{WriteImage}{\param{const wxBitmap\& }{bitmap}, \param{int }{bitmapType = wxBITMAP\_TYPE\_PNG}}
1448
1449 \func{bool}{WriteImage}{\param{const wxImage\& }{image}, \param{int }{bitmapType = wxBITMAP\_TYPE\_PNG}}
1450
1451 Write a bitmap or image at the current insertion point. Supply an optional type to use
1452 for internal and file storage of the raw data.
1453
1454 \membersection{wxRichTextCtrl::WriteText}\label{wxrichtextctrlwritetext}
1455
1456 \func{void}{WriteText}{\param{const wxString\& }{text}}
1457
1458 Writes text at the current position.
1459
1460 \membersection{wxRichTextCtrl::XYToPosition}\label{wxrichtextctrlxytoposition}
1461
1462 \constfunc{long}{XYToPosition}{\param{long }{x}, \param{long }{y}}
1463
1464 Translates from column and line number to position.
1465