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