Further wxRTC doc additions
[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::Delete}\label{wxrichtextctrldelete}
364
365 \func{bool}{Delete}{\param{const wxRichTextRange\&}{ range}}
366
367 Deletes the content within the given range.
368
369 \membersection{wxRichTextCtrl::DeleteSelectedContent}\label{wxrichtextctrldeleteselectedcontent}
370
371 \func{bool}{DeleteSelectedContent}{\param{long* }{newPos = NULL}}
372
373 Deletes content if there is a selection, e.g. when pressing a key.
374 Returns the new caret position in {\it newPos}, or leaves it if there
375 was no action. This is undoable.
376
377 \membersection{wxRichTextCtrl::DeleteSelection}\label{wxrichtextctrldeleteselection}
378
379 \func{void}{DeleteSelection}{\void}
380
381 Deletes the content in the selection, if any. This is undoable.
382
383 \membersection{wxRichTextCtrl::DiscardEdits}\label{wxrichtextctrldiscardedits}
384
385 \func{void}{DiscardEdits}{\void}
386
387 Sets the buffer's modified status to \false, and clears the buffer's command history.
388
389 \membersection{wxRichTextCtrl::DoGetBestSize}\label{wxrichtextctrldogetbestsize}
390
391 \constfunc{wxSize}{DoGetBestSize}{\void}
392
393 Currently this simply returns {\tt wxSize(10, 10)}.
394
395 \membersection{wxRichTextCtrl::EndAlignment}\label{wxrichtextctrlendalignment}
396
397 \func{bool}{EndAlignment}{\void}
398
399 Ends alignment.
400
401 \membersection{wxRichTextCtrl::EndAllStyles}\label{wxrichtextctrlendallstyles}
402
403 \func{bool}{EndAllStyles}{\void}
404
405 Ends application of all styles in the current style stack.
406
407 \membersection{wxRichTextCtrl::EndBatchUndo}\label{wxrichtextctrlendbatchundo}
408
409 \func{bool}{EndBatchUndo}{\void}
410
411 Ends batching undo command history.
412
413 \membersection{wxRichTextCtrl::EndBold}\label{wxrichtextctrlendbold}
414
415 \func{bool}{EndBold}{\void}
416
417 Ends using bold.
418
419 \membersection{wxRichTextCtrl::EndCharacterStyle}\label{wxrichtextctrlendcharacterstyle}
420
421 \func{bool}{EndCharacterStyle}{\void}
422
423 Ends application of a named character style.
424
425 \membersection{wxRichTextCtrl::EndFont}\label{wxrichtextctrlendfont}
426
427 \func{bool}{EndFont}{\void}
428
429 Ends using a font.
430
431 \membersection{wxRichTextCtrl::EndFontSize}\label{wxrichtextctrlendfontsize}
432
433 \func{bool}{EndFontSize}{\void}
434
435 Ends using a point size.
436
437 \membersection{wxRichTextCtrl::EndItalic}\label{wxrichtextctrlenditalic}
438
439 \func{bool}{EndItalic}{\void}
440
441 Ends using italic.
442
443 \membersection{wxRichTextCtrl::EndLeftIndent}\label{wxrichtextctrlendleftindent}
444
445 \func{bool}{EndLeftIndent}{\void}
446
447 Ends left indent.
448
449 \membersection{wxRichTextCtrl::EndLineSpacing}\label{wxrichtextctrlendlinespacing}
450
451 \func{bool}{EndLineSpacing}{\void}
452
453 Ends line spacing.
454
455 \membersection{wxRichTextCtrl::EndListStyle}\label{wxrichtextctrlendliststyle}
456
457 \func{bool}{EndListStyle}{\void}
458
459 Ends using a specified list style.
460
461 \membersection{wxRichTextCtrl::EndNumberedBullet}\label{wxrichtextctrlendnumberedbullet}
462
463 \func{bool}{EndNumberedBullet}{\void}
464
465 Ends application of a numbered bullet.
466
467 \membersection{wxRichTextCtrl::EndParagraphSpacing}\label{wxrichtextctrlendparagraphspacing}
468
469 \func{bool}{EndParagraphSpacing}{\void}
470
471 Ends paragraph spacing.
472
473 \membersection{wxRichTextCtrl::EndParagraphStyle}\label{wxrichtextctrlendparagraphstyle}
474
475 \func{bool}{EndParagraphStyle}{\void}
476
477 Ends application of a named character style.
478
479 \membersection{wxRichTextCtrl::EndRightIndent}\label{wxrichtextctrlendrightindent}
480
481 \func{bool}{EndRightIndent}{\void}
482
483 Ends right indent.
484
485 \membersection{wxRichTextCtrl::EndStyle}\label{wxrichtextctrlendstyle}
486
487 \func{bool}{EndStyle}{\void}
488
489 Ends the current style.
490
491 \membersection{wxRichTextCtrl::EndSuppressUndo}\label{wxrichtextctrlendsuppressundo}
492
493 \func{bool}{EndSuppressUndo}{\void}
494
495 Ends suppressing undo command history.
496
497 \membersection{wxRichTextCtrl::EndSymbolBullet}\label{wxrichtextctrlendsymbolbullet}
498
499 \func{bool}{EndSymbolBullet}{\void}
500
501 Ends applying a symbol bullet.
502
503 \membersection{wxRichTextCtrl::EndTextColour}\label{wxrichtextctrlendtextcolour}
504
505 \func{bool}{EndTextColour}{\void}
506
507 Ends applying a text colour.
508
509 \membersection{wxRichTextCtrl::EndUnderline}\label{wxrichtextctrlendunderline}
510
511 \func{bool}{EndUnderline}{\void}
512
513 End applying underlining.
514
515 \membersection{wxRichTextCtrl::EndURL}\label{wxrichtextctrlendurl}
516
517 \func{bool}{EndURL}{\void}
518
519 Ends applying a URL.
520
521 \membersection{wxRichTextCtrl::ExtendSelection}\label{wxrichtextctrlextendselection}
522
523 \func{bool}{ExtendSelection}{\param{long }{oldPosition}, \param{long }{newPosition}, \param{int }{flags}}
524
525 Helper function for extending the selection, returning \true if the selection was
526 changed. Selections are in caret positions.
527
528 \membersection{wxRichTextCtrl::FindNextWordPosition}\label{wxrichtextctrlfindnextwordposition}
529
530 \constfunc{long}{FindNextWordPosition}{\param{int }{direction = 1}}
531
532 Helper function for finding the caret position for the next word. Direction
533 is 1 (forward) or -1 (backwards).
534
535 \membersection{wxRichTextCtrl::Freeze}\label{wxrichtextctrlfreeze}
536
537 \func{void}{Freeze}{\void}
538
539 Call this function to prevent refresh and allow fast updates, and then \helpref{Thaw}{wxrichtextctrlthaw} to
540 refresh the control.
541
542 \membersection{wxRichTextCtrl::GetBasicStyle}\label{wxrichtextctrlgetbasicstyle}
543
544 \constfunc{const wxTextAttrEx\&}{GetBasicStyle}{\void}
545
546 Gets the basic (overall) style. This is the style of the whole
547 buffer before further styles are applied, unlike the default style, which
548 only affects the style currently being applied (for example, setting the default
549 style to bold will cause subsequently inserted text to be bold).
550
551 \membersection{wxRichTextCtrl::GetBuffer}\label{wxrichtextctrlgetbuffer}
552
553 \constfunc{const wxRichTextBuffer\&}{GetBuffer}{\void}
554
555 \func{wxRichTextBuffer\&}{GetBuffer}{\void}
556
557 Returns the buffer associated with the control.
558
559 \membersection{wxRichTextCtrl::GetCaretPosition}\label{wxrichtextctrlgetcaretposition}
560
561 \constfunc{long}{GetCaretPosition}{\void}
562
563 Returns the current caret position.
564
565 \membersection{wxRichTextCtrl::GetCaretPositionForIndex}\label{wxrichtextctrlgetcaretpositionforindex}
566
567 \func{bool}{GetCaretPositionForIndex}{\param{long }{position}, \param{wxRect\& }{rect}}
568
569 Returns the caret height and position for the given character position
570
571 \membersection{wxRichTextCtrl::GetCommandProcessor}\label{wxrichtextctrlgetcommandprocessor}
572
573 \constfunc{wxCommandProcessor*}{GetCommandProcessor}{\void}
574
575 Gets the command processor associated with the control's buffer.
576
577 \membersection{wxRichTextCtrl::GetDefaultStyleEx}\label{wxrichtextctrlgetdefaultstyleex}
578
579 \constfunc{const wxTextAttrEx\&}{GetDefaultStyleEx}{\void}
580
581 Returns the current default style, which can be used to change how subsequently inserted
582 text is displayed. When wxTextAttrEx is merged with wxTextAttr, this function
583 will become GetDefaultStyle.
584
585 \membersection{wxRichTextCtrl::GetDelayedLayoutThreshold}\label{wxrichtextctrlgetdelayedlayoutthreshold}
586
587 \constfunc{long}{GetDelayedLayoutThreshold}{\void}
588
589 Gets the size of the buffer beyond which layout is delayed during resizing.
590 This optimizes sizing for large buffers. The default is 20000.
591
592 \membersection{wxRichTextCtrl::GetFilename}\label{wxrichtextctrlgetfilename}
593
594 \constfunc{wxString}{GetFilename}{\void}
595
596 Gets the current filename associated with the control.
597
598 \membersection{wxRichTextCtrl::GetFirstVisiblePosition}\label{wxrichtextctrlgetfirstvisibleposition}
599
600 \constfunc{long}{GetFirstVisiblePosition}{\void}
601
602 Returns the first visible position in the current view.
603
604 \membersection{wxRichTextCtrl::GetHandlerFlags}\label{wxrichtextfilehandlergethandlerflags}
605
606 \constfunc{int}{GetHandlerFlags}{\void}
607
608 Returns flags that change the behaviour of loading or saving. See the documentation for each
609 handler class to see what flags are relevant for each handler.
610
611 \membersection{wxRichTextCtrl::GetInsertionPoint}\label{wxrichtextctrlgetinsertionpoint}
612
613 \constfunc{long}{GetInsertionPoint}{\void}
614
615 Returns the current insertion point.
616
617 \membersection{wxRichTextCtrl::GetLastPosition}\label{wxrichtextctrlgetlastposition}
618
619 \constfunc{wxTextPos}{GetLastPosition}{\void}
620
621 Returns the last position in the buffer.
622
623 \membersection{wxRichTextCtrl::GetLineLength}\label{wxrichtextctrlgetlinelength}
624
625 \constfunc{int}{GetLineLength}{\param{long }{lineNo}}
626
627 Returns the length of the specified line in characters.
628
629 \membersection{wxRichTextCtrl::GetLineText}\label{wxrichtextctrlgetlinetext}
630
631 \constfunc{wxString}{GetLineText}{\param{long }{lineNo}}
632
633 Returns the text for the given line.
634
635 \membersection{wxRichTextCtrl::GetLogicalPoint}\label{wxrichtextctrlgetlogicalpoint}
636
637 \constfunc{wxPoint}{GetLogicalPoint}{\param{const wxPoint\& }{ptPhysical}}
638
639 Transforms physical window position to logical (unscrolled) position.
640
641 \membersection{wxRichTextCtrl::GetNumberOfLines}\label{wxrichtextctrlgetnumberoflines}
642
643 \constfunc{int}{GetNumberOfLines}{\void}
644
645 Returns the number of lines in the buffer.
646
647 \membersection{wxRichTextCtrl::GetPhysicalPoint}\label{wxrichtextctrlgetphysicalpoint}
648
649 \constfunc{wxPoint}{GetPhysicalPoint}{\param{const wxPoint\& }{ptLogical}}
650
651 Transforms logical (unscrolled) position to physical window position.
652
653 \membersection{wxRichTextCtrl::GetRange}\label{wxrichtextctrlgetrange}
654
655 \constfunc{wxString}{GetRange}{\param{long }{from}, \param{long }{to}}
656
657 Gets the text for the given range.
658
659 The end point of range is specified as the last character position of the span of text, plus one.
660
661 \membersection{wxRichTextCtrl::GetSelection}\label{wxrichtextctrlgetselection}
662
663 \constfunc{void}{GetSelection}{\param{long* }{from}, \param{long* }{to}}
664
665 Returns the range of the current selection.
666
667 The end point of range is specified as the last character position of the span of text, plus one.
668
669 If the return values {\it from} and {\it to} are the same, there is no selection.
670
671 \membersection{wxRichTextCtrl::GetSelectionRange}\label{wxrichtextctrlgetselectionrange}
672
673 \constfunc{const wxRichTextRange\&}{GetSelectionRange}{\void}
674
675 Returns the selection range in character positions. -1, -1 means no selection.
676
677 \membersection{wxRichTextCtrl::GetStringSelection}\label{wxrichtextctrlgetstringselection}
678
679 \constfunc{wxString}{GetStringSelection}{\void}
680
681 Returns the text within the current selection range, if any.
682
683 \membersection{wxRichTextCtrl::GetStyle}\label{wxrichtextctrlgetstyle}
684
685 \func{bool}{GetStyle}{\param{long }{position}, \param{wxRichTextAttr\& }{style}}
686
687 \func{bool}{GetStyle}{\param{long }{position}, \param{wxTextAttrEx\& }{style}}
688
689 \func{bool}{GetStyle}{\param{long }{position}, \param{wxTextAttr\& }{style}}
690
691 Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
692 because it does not use wxFont objects.
693
694 This function gets the combined style - that is, the style you see on the screen as a result
695 of combining base style, paragraph style and character style attributes. To get the character
696 or paragraph style alone, use \helpref{GetUncombinedStyle}{wxrichtextctrlgetuncombinedstyle}.
697
698 \membersection{wxRichTextCtrl::GetStyleForRange}\label{wxrichtextctrlgetstyleforrange}
699
700 \func{bool}{GetStyleForRange}{\param{const wxRichTextRange\& }{range}, \param{wxRichTextAttr\& }{style}}
701
702 \func{bool}{GetStyleForRange}{\param{const wxRichTextRange\& }{range}, \param{wxTextAttrEx\& }{style}}
703
704 Gets the attributes common to the specified range. Attributes that differ in value within the range will
705 not be included in {\it style}'s flags.
706
707 \membersection{wxRichTextCtrl::GetStyleSheet}\label{wxrichtextctrlgetstylesheet}
708
709 \constfunc{wxRichTextStyleSheet*}{GetStyleSheet}{\void}
710
711 Returns the style sheet associated with the control, if any. A style sheet allows named
712 character and paragraph styles to be applied.
713
714 \membersection{wxRichTextCtrl::GetUncombinedStyle}\label{wxrichtextctrlgetuncombinedstyle}
715
716 \func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxRichTextAttr\& }{style}}
717
718 \func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxTextAttrEx\& }{style}}
719
720 \func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxTextAttr\& }{style}}
721
722 Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
723 because it does not use wxFont objects.
724
725 This function gets the {\it uncombined style} - that is, the attributes associated with the
726 paragraph or character content, and not necessarily the combined attributes you see on the
727 screen. To get the combined attributes, use \helpref{GetStyle}{wxrichtextctrlgetstyle}.
728
729 If you specify (any) paragraph attribute in {\it style}'s flags, this function will fetch
730 the paragraph attributes. Otherwise, it will return the character attributes.
731
732 \membersection{wxRichTextCtrl::GetValue}\label{wxrichtextctrlgetvalue}
733
734 \constfunc{wxString}{GetValue}{\void}
735
736 Returns the content of the entire control as a string.
737
738 \membersection{wxRichTextCtrl::GetVisibleLineForCaretPosition}\label{wxrichtextctrlgetvisiblelineforcaretposition}
739
740 \constfunc{wxRichTextLine*}{GetVisibleLineForCaretPosition}{\param{long }{caretPosition}}
741
742 Internal helper function returning the line for the visible caret position. If the caret is
743 shown at the very end of the line, it means the next character is actually
744 on the following line. So this function gets the line we're expecting to find
745 if this is the case.
746
747 \membersection{wxRichTextCtrl::HasCharacterAttributes}\label{wxrichtextctrlhascharacterattributes}
748
749 \constfunc{bool}{HasCharacterAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}}
750
751 \constfunc{bool}{HasCharacterAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}
752
753 Test if this whole range has character attributes of the specified kind. If any
754 of the attributes are different within the range, the test fails. You
755 can use this to implement, for example, bold button updating. {\it style} must have
756 flags indicating which attributes are of interest.
757
758 \membersection{wxRichTextCtrl::HasParagraphAttributes}\label{wxrichtextctrlhasparagraphattributes}
759
760 \constfunc{bool}{HasParagraphAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}}
761
762 \constfunc{bool}{HasParagraphAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}
763
764 Test if this whole range has paragraph attributes of the specified kind. If any
765 of the attributes are different within the range, the test fails. You
766 can use this to implement, for example, centering button updating. {\it style} must have
767 flags indicating which attributes are of interest.
768
769 \membersection{wxRichTextCtrl::HasSelection}\label{wxrichtextctrlhasselection}
770
771 \constfunc{bool}{HasSelection}{\void}
772
773 Returns \true if there is a selection.
774
775 \membersection{wxRichTextCtrl::HitTest}\label{wxrichtextctrlhittest}
776
777 \constfunc{wxTextCtrlHitTestResult}{HitTest}{\param{const wxPoint\& }{pt}, \param{long* }{pos}}
778
779 \constfunc{wxTextCtrlHitTestResult}{HitTest}{\param{const wxPoint\& }{pt}, \param{wxTextCoord* }{col}, \param{wxTextCoord* }{row}}
780
781 Finds the character at the given position in pixels.
782
783 {\it pt} is in device coords (not adjusted for the client area origin nor for scrolling).
784
785 \membersection{wxRichTextCtrl::Init}\label{wxrichtextctrlinit}
786
787 \func{void}{Init}{\void}
788
789 Initialises the members of the control.
790
791 \membersection{wxRichTextCtrl::InitCommandEvent}\label{wxrichtextctrlinitcommandevent}
792
793 \constfunc{void}{InitCommandEvent}{\param{wxCommandEvent\& }{event}}
794
795 Initialises the command event.
796
797 \membersection{wxRichTextCtrl::IsDefaultStyleShowing}\label{wxrichtextctrlisdefaultstyleshowing}
798
799 \constfunc{bool}{IsDefaultStyleShowing}{\void}
800
801 Returns \true if the user has recently set the default style without moving the caret,
802 and therefore the UI needs to reflect the default style and not the style at the caret.
803
804 Below is an example of code that uses this function to determine whether the UI
805 should show that the current style is bold.
806
807 \begin{verbatim}
808 /// Is all of the selection bold?
809 bool wxRichTextCtrl::IsSelectionBold()
810 {
811 if (HasSelection())
812 {
813 wxRichTextAttr attr;
814 wxRichTextRange range = GetInternalSelectionRange();
815 attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
816 attr.SetFontWeight(wxBOLD);
817
818 return HasCharacterAttributes(range, attr);
819 }
820 else
821 {
822 // If no selection, then we need to combine current style with default style
823 // to see what the effect would be if we started typing.
824 wxRichTextAttr attr;
825 attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
826
827 long pos = GetAdjustedCaretPosition(GetCaretPosition());
828 if (GetStyle(pos, attr))
829 {
830 if (IsDefaultStyleShowing())
831 wxRichTextApplyStyle(attr, GetDefaultStyleEx());
832 return attr.GetFontWeight() == wxBOLD;
833 }
834 }
835 return false;
836 }
837 \end{verbatim}
838
839 See also \helpref{SetAndShowDefaultStyle}{wxrichtextctrlsetandshowdefaultstyle}.
840
841 \membersection{wxRichTextCtrl::IsEditable}\label{wxrichtextctrliseditable}
842
843 \constfunc{bool}{IsEditable}{\void}
844
845 Returns \true if the control is editable.
846
847 \membersection{wxRichTextCtrl::IsFrozen}\label{wxrichtextctrlisfrozen}
848
849 \constfunc{bool}{IsFrozen}{\void}
850
851 Returns \true if Freeze has been called without a Thaw.
852
853 \membersection{wxRichTextCtrl::IsModified}\label{wxrichtextctrlismodified}
854
855 \constfunc{bool}{IsModified}{\void}
856
857 Returns \true if the buffer has been modified.
858
859 \membersection{wxRichTextCtrl::IsMultiLine}\label{wxrichtextctrlismultiline}
860
861 \constfunc{bool}{IsMultiLine}{\void}
862
863 Returns \true if the control is multiline.
864
865 \membersection{wxRichTextCtrl::IsPositionVisible}\label{wxrichtextctrlispositionvisible}
866
867 \constfunc{bool}{IsPositionVisible}{\param{long }{pos}}
868
869 Returns \true if the given position is visible on the screen.
870
871 \membersection{wxRichTextCtrl::IsSelectionAligned}\label{wxrichtextctrlisselectionaligned}
872
873 \constfunc{bool}{IsSelectionAligned}{\param{wxTextAttrAlignment }{alignment}}
874
875 Returns \true if all of the selection is aligned according to the specified flag.
876
877 \membersection{wxRichTextCtrl::IsSelectionBold}\label{wxrichtextctrlisselectionbold}
878
879 \constfunc{bool}{IsSelectionBold}{\void}
880
881 Returns \true if all of the selection is bold.
882
883 \membersection{wxRichTextCtrl::IsSelectionItalics}\label{wxrichtextctrlisselectionitalics}
884
885 \constfunc{bool}{IsSelectionItalics}{\void}
886
887 Returns \true if all of the selection is italic.
888
889 \membersection{wxRichTextCtrl::IsSelectionUnderlined}\label{wxrichtextctrlisselectionunderlined}
890
891 \constfunc{bool}{IsSelectionUnderlined}{\void}
892
893 Returns \true if all of the selection is underlined.
894
895 \membersection{wxRichTextCtrl::IsSingleLine}\label{wxrichtextctrlissingleline}
896
897 \constfunc{bool}{IsSingleLine}{\void}
898
899 Returns \true if the control is single-line. Currently wxRichTextCtrl does not
900 support single-line editing.
901
902 \membersection{wxRichTextCtrl::KeyboardNavigate}\label{wxrichtextctrlkeyboardnavigate}
903
904 \func{bool}{KeyboardNavigate}{\param{int }{keyCode}, \param{int }{flags}}
905
906 Helper function implementing keyboard navigation.
907
908 \membersection{wxRichTextCtrl::LayoutContent}\label{wxrichtextctrllayoutcontent}
909
910 \func{bool}{LayoutContent}{\param{bool }{onlyVisibleRect = false}}
911
912 Lays out the buffer, which must be done before certain operations, such as
913 setting the caret position. This function should not normally be required by the
914 application.
915
916 \membersection{wxRichTextCtrl::LineBreak}\label{wxrichtextctrllinebreak}
917
918 \func{bool}{LineBreak}{\void}
919
920 Inserts a line break at the current insertion point. A line break forces wrapping within a paragraph, and
921 can be introduced by using this function, by appending the wxChar value {\bf wxRichTextLineBreakChar} to text content,
922 or by typing Shift-Return.
923
924 \membersection{wxRichTextCtrl::LoadFile}\label{wxrichtextctrlloadfile}
925
926 \func{bool}{LoadFile}{\param{const wxString\& }{file}, \param{int }{type = wxRICHTEXT\_TYPE\_ANY}}
927
928 Loads content into the control's buffer using the given type. If the specified type
929 is wxRICHTEXT\_TYPE\_ANY, the type is deduced from the filename extension.
930
931 This function looks for a suitable \helpref{wxRichTextFileHandler}{wxrichtextfilehandler} object.
932
933 \membersection{wxRichTextCtrl::MarkDirty}\label{wxrichtextctrlmarkdirty}
934
935 \func{void}{MarkDirty}{\void}
936
937 Marks the buffer as modified.
938
939 \membersection{wxRichTextCtrl::MoveCaret}\label{wxrichtextctrlmovecaret}
940
941 \func{bool}{MoveCaret}{\param{long }{pos}, \param{bool }{showAtLineStart = false}}
942
943 Move the caret to the given character position.
944
945 \membersection{wxRichTextCtrl::MoveCaretBack}\label{wxrichtextctrlmovecaretback}
946
947 \func{void}{MoveCaretBack}{\param{long }{oldPosition}}
948
949 Move the caret one visual step forward: this may mean setting a flag
950 and keeping the same position if we're going from the end of one line
951 to the start of the next, which may be the exact same caret position.
952
953 \membersection{wxRichTextCtrl::MoveCaretForward}\label{wxrichtextctrlmovecaretforward}
954
955 \func{void}{MoveCaretForward}{\param{long }{oldPosition}}
956
957 Move the caret one visual step forward: this may mean setting a flag
958 and keeping the same position if we're going from the end of one line
959 to the start of the next, which may be the exact same caret position.
960
961 \membersection{wxRichTextCtrl::MoveDown}\label{wxrichtextctrlmovedown}
962
963 \func{bool}{MoveDown}{\param{int }{noLines = 1}, \param{int }{flags = 0}}
964
965 Moves the caret down.
966
967 \membersection{wxRichTextCtrl::MoveEnd}\label{wxrichtextctrlmoveend}
968
969 \func{bool}{MoveEnd}{\param{int }{flags = 0}}
970
971 Moves to the end of the buffer.
972
973 \membersection{wxRichTextCtrl::MoveHome}\label{wxrichtextctrlmovehome}
974
975 \func{bool}{MoveHome}{\param{int }{flags = 0}}
976
977 Moves to the start of the buffer.
978
979 \membersection{wxRichTextCtrl::MoveLeft}\label{wxrichtextctrlmoveleft}
980
981 \func{bool}{MoveLeft}{\param{int }{noPositions = 1}, \param{int }{flags = 0}}
982
983 Moves left.
984
985 \membersection{wxRichTextCtrl::MoveRight}\label{wxrichtextctrlmoveright}
986
987 \func{bool}{MoveRight}{\param{int }{noPositions = 1}, \param{int }{flags = 0}}
988
989 Moves right.
990
991 \membersection{wxRichTextCtrl::MoveToLineEnd}\label{wxrichtextctrlmovetolineend}
992
993 \func{bool}{MoveToLineEnd}{\param{int }{flags = 0}}
994
995 Moves to the end of the line.
996
997 \membersection{wxRichTextCtrl::MoveToLineStart}\label{wxrichtextctrlmovetolinestart}
998
999 \func{bool}{MoveToLineStart}{\param{int }{flags = 0}}
1000
1001 Moves to the start of the line.
1002
1003 \membersection{wxRichTextCtrl::MoveToParagraphEnd}\label{wxrichtextctrlmovetoparagraphend}
1004
1005 \func{bool}{MoveToParagraphEnd}{\param{int }{flags = 0}}
1006
1007 Moves to the end of the paragraph.
1008
1009 \membersection{wxRichTextCtrl::MoveToParagraphStart}\label{wxrichtextctrlmovetoparagraphstart}
1010
1011 \func{bool}{MoveToParagraphStart}{\param{int }{flags = 0}}
1012
1013 Moves to the start of the paragraph.
1014
1015 \membersection{wxRichTextCtrl::MoveUp}\label{wxrichtextctrlmoveup}
1016
1017 \func{bool}{MoveUp}{\param{int }{noLines = 1}, \param{int }{flags = 0}}
1018
1019 Moves up.
1020
1021 \membersection{wxRichTextCtrl::Newline}\label{wxrichtextctrlnewline}
1022
1023 \func{bool}{Newline}{\void}
1024
1025 Inserts a new paragraph at the current insertion point. See also \helpref{wxRichTextCtrl::LineBreak}{wxrichtextctrllinebreak}.
1026
1027 \membersection{wxRichTextCtrl::NumberList}\label{wxrichtextctrlnumberlist}
1028
1029 \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}}
1030
1031 \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}}
1032
1033 Numbers the paragraphs in the given range. Pass flags to determine how the attributes are set.
1034 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1035
1036 {\it flags} is a bit list of the following:
1037
1038 \begin{itemize}\itemsep=0pt
1039 \item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1040 \item wxRICHTEXT\_SETSTYLE\_RENUMBER: specifies that numbering should start from {\it startFrom}, otherwise existing attributes are used.
1041 \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.
1042 \end{itemize}
1043
1044 See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlsetliststyle}, \helpref{wxRichTextCtrl::PromoteList}{wxrichtextctrlpromotelist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.
1045
1046 \membersection{wxRichTextCtrl::OnClear}\label{wxrichtextctrlonclear}
1047
1048 \func{void}{OnClear}{\param{wxCommandEvent\& }{event}}
1049
1050 Standard handler for the wxID\_CLEAR command.
1051
1052 \membersection{wxRichTextCtrl::OnContextMenu}\label{wxrichtextctrloncontextmenu}
1053
1054 \func{void}{OnContextMenu}{\param{wxContextMenuEvent\& }{event}}
1055
1056 Shows a standard context menu with undo, redo, cut, copy, paste, clear, and select all commands.
1057
1058 \membersection{wxRichTextCtrl::OnCopy}\label{wxrichtextctrloncopy}
1059
1060 \func{void}{OnCopy}{\param{wxCommandEvent\& }{event}}
1061
1062 Standard handler for the wxID\_COPY command.
1063
1064 \membersection{wxRichTextCtrl::OnCut}\label{wxrichtextctrloncut}
1065
1066 \func{void}{OnCut}{\param{wxCommandEvent\& }{event}}
1067
1068 Standard handler for the wxID\_CUT command.
1069
1070 \membersection{wxRichTextCtrl::OnDropFiles}\label{wxrichtextctrlondropfiles}
1071
1072 \func{void}{OnDropFiles}{\param{wxDropFilesEvent\& }{event}}
1073
1074 Loads the first dropped file.
1075
1076 \membersection{wxRichTextCtrl::OnPaste}\label{wxrichtextctrlonpaste}
1077
1078 \func{void}{OnPaste}{\param{wxCommandEvent\& }{event}}
1079
1080 Standard handler for the wxID\_PASTE command.
1081
1082 \membersection{wxRichTextCtrl::OnRedo}\label{wxrichtextctrlonredo}
1083
1084 \func{void}{OnRedo}{\param{wxCommandEvent\& }{event}}
1085
1086 Standard handler for the wxID\_REDO command.
1087
1088 \membersection{wxRichTextCtrl::OnSelectAll}\label{wxrichtextctrlonselectall}
1089
1090 \func{void}{OnSelectAll}{\param{wxCommandEvent\& }{event}}
1091
1092 Standard handler for the wxID\_SELECTALL command.
1093
1094 \membersection{wxRichTextCtrl::OnUndo}\label{wxrichtextctrlonundo}
1095
1096 \func{void}{OnUndo}{\param{wxCommandEvent\& }{event}}
1097
1098 Standard handler for the wxID\_PASTE command.
1099
1100 \membersection{wxRichTextCtrl::OnUpdateClear}\label{wxrichtextctrlonupdateclear}
1101
1102 \func{void}{OnUpdateClear}{\param{wxUpdateUIEvent\& }{event}}
1103
1104 Standard update handler for the wxID\_CLEAR command.
1105
1106 \membersection{wxRichTextCtrl::OnUpdateCopy}\label{wxrichtextctrlonupdatecopy}
1107
1108 \func{void}{OnUpdateCopy}{\param{wxUpdateUIEvent\& }{event}}
1109
1110 Standard update handler for the wxID\_COPY command.
1111
1112 \membersection{wxRichTextCtrl::OnUpdateCut}\label{wxrichtextctrlonupdatecut}
1113
1114 \func{void}{OnUpdateCut}{\param{wxUpdateUIEvent\& }{event}}
1115
1116 Standard update handler for the wxID\_CUT command.
1117
1118 \membersection{wxRichTextCtrl::OnUpdatePaste}\label{wxrichtextctrlonupdatepaste}
1119
1120 \func{void}{OnUpdatePaste}{\param{wxUpdateUIEvent\& }{event}}
1121
1122 Standard update handler for the wxID\_PASTE command.
1123
1124 \membersection{wxRichTextCtrl::OnUpdateRedo}\label{wxrichtextctrlonupdateredo}
1125
1126 \func{void}{OnUpdateRedo}{\param{wxUpdateUIEvent\& }{event}}
1127
1128 Standard update handler for the wxID\_REDO command.
1129
1130 \membersection{wxRichTextCtrl::OnUpdateSelectAll}\label{wxrichtextctrlonupdateselectall}
1131
1132 \func{void}{OnUpdateSelectAll}{\param{wxUpdateUIEvent\& }{event}}
1133
1134 Standard update handler for the wxID\_SELECTALL command.
1135
1136 \membersection{wxRichTextCtrl::OnUpdateUndo}\label{wxrichtextctrlonupdateundo}
1137
1138 \func{void}{OnUpdateUndo}{\param{wxUpdateUIEvent\& }{event}}
1139
1140 Standard update handler for the wxID\_UNDO command.
1141
1142 \membersection{wxRichTextCtrl::PageDown}\label{wxrichtextctrlpagedown}
1143
1144 \func{bool}{PageDown}{\param{int }{noPages = 1}, \param{int }{flags = 0}}
1145
1146 Moves one or more pages down.
1147
1148 \membersection{wxRichTextCtrl::PageUp}\label{wxrichtextctrlpageup}
1149
1150 \func{bool}{PageUp}{\param{int }{noPages = 1}, \param{int }{flags = 0}}
1151
1152 Moves one or more pages up.
1153
1154 \membersection{wxRichTextCtrl::PaintBackground}\label{wxrichtextctrlpaintbackground}
1155
1156 \func{void}{PaintBackground}{\param{wxDC\& }{dc}}
1157
1158 Paints the background.
1159
1160 \membersection{wxRichTextCtrl::Paste}\label{wxrichtextctrlpaste}
1161
1162 \func{void}{Paste}{\void}
1163
1164 Pastes content from the clipboard to the buffer.
1165
1166 \membersection{wxRichTextCtrl::PositionCaret}\label{wxrichtextctrlpositioncaret}
1167
1168 \func{void}{PositionCaret}{\void}
1169
1170 Internal function to position the visible caret according to the current caret position.
1171
1172 \membersection{wxRichTextCtrl::PositionToXY}\label{wxrichtextctrlpositiontoxy}
1173
1174 \constfunc{bool}{PositionToXY}{\param{long }{pos}, \param{long* }{x}, \param{long* }{y}}
1175
1176 Converts a text position to zero-based column and line numbers.
1177
1178 \membersection{wxRichTextCtrl::PromoteList}\label{wxrichtextctrlpromotelist}
1179
1180 \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}}
1181
1182 \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}}
1183
1184 Promotes or demotes the paragraphs in the given range. A positive {\it promoteBy} produces a smaller indent, and a negative number
1185 produces a larger indent. Pass flags to determine how the attributes are set.
1186 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1187
1188 {\it flags} is a bit list of the following:
1189
1190 \begin{itemize}\itemsep=0pt
1191 \item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1192 \item wxRICHTEXT\_SETSTYLE\_RENUMBER: specifies that numbering should start from {\it startFrom}, otherwise existing attributes are used.
1193 \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.
1194 \end{itemize}
1195
1196 See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlsetliststyle}, See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlnumberlist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.
1197
1198 \membersection{wxRichTextCtrl::Redo}\label{wxrichtextctrlredo}
1199
1200 \func{void}{Redo}{\void}
1201
1202 Redoes the current command.
1203
1204 \membersection{wxRichTextCtrl::Remove}\label{wxrichtextctrlremove}
1205
1206 \func{void}{Remove}{\param{long }{from}, \param{long }{to}}
1207
1208 Removes the content in the specified range.
1209
1210 \membersection{wxRichTextCtrl::Replace}\label{wxrichtextctrlreplace}
1211
1212 \func{void}{Replace}{\param{long }{from}, \param{long }{to}, \param{const wxString\& }{value}}
1213
1214 Replaces the content in the specified range with the string specified by {\it value}.
1215
1216 \membersection{wxRichTextCtrl::SaveFile}\label{wxrichtextctrlsavefile}
1217
1218 \func{bool}{SaveFile}{\param{const wxString\& }{file = wxEmptyString}, \param{int }{type = wxRICHTEXT\_TYPE\_ANY}}
1219
1220 Saves the buffer content using the given type. If the specified type
1221 is wxRICHTEXT\_TYPE\_ANY, the type is deduced from the filename extension.
1222
1223 This function looks for a suitable \helpref{wxRichTextFileHandler}{wxrichtextfilehandler} object.
1224
1225 \membersection{wxRichTextCtrl::ScrollIntoView}\label{wxrichtextctrlscrollintoview}
1226
1227 \func{bool}{ScrollIntoView}{\param{long }{position}, \param{int }{keyCode}}
1228
1229 Scrolls {\it position} into view. This function takes a caret position.
1230
1231 \membersection{wxRichTextCtrl::SelectAll}\label{wxrichtextctrlselectall}
1232
1233 \func{void}{SelectAll}{\void}
1234
1235 Selects all the text in the buffer.
1236
1237 \membersection{wxRichTextCtrl::SelectNone}\label{wxrichtextctrlselectnone}
1238
1239 \func{void}{SelectNone}{\void}
1240
1241 Cancels any selection.
1242
1243 \membersection{wxRichTextCtrl::SetAndShowDefaultStyle}\label{wxrichtextctrlsetandshowdefaultstyle}
1244
1245 \func{void}{SetAndShowDefaultStyle}{\param{const wxRichTextAttr\& }{attr}}
1246
1247 Sets {\it attr} as the default style and tells the control that the UI should reflect
1248 this attribute until the user moves the caret.
1249
1250 See also \helpref{IsDefaultStyleShowing}{wxrichtextctrlisdefaultstyleshowing}.
1251
1252 \membersection{wxRichTextCtrl::SetBasicStyle}\label{wxrichtextctrlsetbasicstyle}
1253
1254 \func{void}{SetBasicStyle}{\param{const wxRichTextAttr\& }{style}}
1255
1256 \func{void}{SetBasicStyle}{\param{const wxTextAttrEx\& }{style}}
1257
1258 Sets the basic (overall) style. This is the style of the whole
1259 buffer before further styles are applied, unlike the default style, which
1260 only affects the style currently being applied (for example, setting the default
1261 style to bold will cause subsequently inserted text to be bold).
1262
1263 \membersection{wxRichTextCtrl::SetCaretPosition}\label{wxrichtextctrlsetcaretposition}
1264
1265 \func{void}{SetCaretPosition}{\param{long }{position}, \param{bool }{showAtLineStart = false}}
1266
1267 The caret position is the character position just before the caret.
1268 A value of -1 means the caret is at the start of the buffer.
1269
1270 \membersection{wxRichTextCtrl::SetDefaultStyle}\label{wxrichtextctrlsetdefaultstyle}
1271
1272 \func{bool}{SetDefaultStyle}{\param{const wxTextAttrEx\& }{style}}
1273
1274 Sets the current default style, which can be used to change how subsequently inserted
1275 text is displayed.
1276
1277 \membersection{wxRichTextCtrl::SetDefaultStyleToCursorStyle}\label{wxrichtextctrlsetdefaultstyletocursorstyle}
1278
1279 \func{bool}{SetDefaultStyleToCursorStyle}{\void}
1280
1281 Sets the default style to the style under the cursor.
1282
1283 \membersection{wxRichTextCtrl::SetDelayedLayoutThreshold}\label{wxrichtextctrlsetdelayedlayoutthreshold}
1284
1285 \func{void}{SetDelayedLayoutThreshold}{\param{long }{threshold}}
1286
1287 Sets the size of the buffer beyond which layout is delayed during resizing.
1288 This optimizes sizing for large buffers. The default is 20000.
1289
1290 \membersection{wxRichTextCtrl::SetEditable}\label{wxrichtextctrlseteditable}
1291
1292 \func{void}{SetEditable}{\param{bool }{editable}}
1293
1294 Makes the control editable, or not.
1295
1296 \membersection{wxRichTextCtrl::SetFilename}\label{wxrichtextctrlsetfilename}
1297
1298 \func{void}{SetFilename}{\param{const wxString\& }{filename}}
1299
1300 Sets the current filename.
1301
1302 \membersection{wxRichTextCtrl::SetFont}\label{wxrichtextctrlsetfont}
1303
1304 \func{bool}{SetFont}{\param{const wxFont\& }{font}}
1305
1306 Sets the font, and also the basic and default attributes (see \helpref{SetDefaultStyle}{wxrichtextctrlsetdefaultstyle}).
1307
1308 \membersection{wxRichTextCtrl::SetHandlerFlags}\label{wxrichtextctrlsethandlerflags}
1309
1310 \func{void}{SetHandlerFlags}{\param{int }{flags}}
1311
1312 Sets flags that change the behaviour of loading or saving. See the documentation for each
1313 handler class to see what flags are relevant for each handler.
1314
1315 \membersection{wxRichTextCtrl::SetInsertionPoint}\label{wxrichtextctrlsetinsertionpoint}
1316
1317 \func{void}{SetInsertionPoint}{\param{long }{pos}}
1318
1319 Sets the insertion point.
1320
1321 \membersection{wxRichTextCtrl::SetInsertionPointEnd}\label{wxrichtextctrlsetinsertionpointend}
1322
1323 \func{void}{SetInsertionPointEnd}{\void}
1324
1325 Sets the insertion point to the end of the text control.
1326
1327 \membersection{wxRichTextCtrl::SetListStyle}\label{wxrichtextctrlsetliststyle}
1328
1329 \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}}
1330
1331 \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}}
1332
1333 Sets the list attributes for the given range, passing flags to determine how the attributes are set.
1334 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1335
1336 {\it flags} is a bit list of the following:
1337
1338 \begin{itemize}\itemsep=0pt
1339 \item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1340 \item wxRICHTEXT\_SETSTYLE\_RENUMBER: specifies that numbering should start from {\it startFrom}, otherwise existing attributes are used.
1341 \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.
1342 \end{itemize}
1343
1344 See also \helpref{wxRichTextCtrl::NumberList}{wxrichtextctrlnumberlist}, \helpref{wxRichTextCtrl::PromoteList}{wxrichtextctrlpromotelist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.
1345
1346 \membersection{wxRichTextCtrl::SetSelection}\label{wxrichtextctrlsetselection}
1347
1348 \func{void}{SetSelection}{\param{long }{from}, \param{long }{to}}
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 style for a character at position 5, use the range (5,6).
1354
1355 \membersection{wxRichTextCtrl::SetSelectionRange}\label{wxrichtextctrlsetselectionrange}
1356
1357 \func{void}{SetSelectionRange}{\param{const wxRichTextRange\& }{range}}
1358
1359 Sets the selection to the given range.
1360
1361 The end point of range is specified as the last character position of the span of text, plus one.
1362 So, for example, to set the style for a character at position 5, use the range (5,6).
1363
1364 \membersection{wxRichTextCtrl::SetStyle}\label{wxrichtextctrlsetstyle}
1365
1366 \func{bool}{SetStyle}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}
1367
1368 \func{bool}{SetStyle}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttrEx\& }{style}}
1369
1370 \func{bool}{SetStyle}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttr\& }{style}}
1371
1372 Sets the attributes for the given range. The wxRichTextAttr version is more efficient
1373 because it does not use wxFont objects.
1374
1375 The end point of range is specified as the last character position of the span of text, plus one.
1376 So, for example, to set the style for a character at position 5, use the range (5,6).
1377
1378 \membersection{wxRichTextCtrl::SetStyleEx}\label{wxrichtextctrlsetstyleex}
1379
1380 \func{bool}{SetStyleEx}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
1381
1382 \func{bool}{SetStyleEx}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
1383
1384 \func{bool}{SetStyleEx}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttrEx\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
1385
1386 Sets the attributes for the given range, passing flags to determine how the attributes are set. The wxRichTextAttr version is more efficient
1387 because it does not use wxFont objects.
1388
1389 The end point of range is specified as the last character position of the span of text, plus one.
1390 So, for example, to set the style for a character at position 5, use the range (5,6).
1391
1392 {\it flags} may contain a bit list of the following values:
1393
1394 \begin{itemize}\itemsep=0pt
1395 \item wxRICHTEXT\_SETSTYLE\_NONE: no style flag.
1396 \item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this operation should be undoable.
1397 \item wxRICHTEXT\_SETSTYLE\_OPTIMIZE: specifies that the style should not be applied if the
1398 combined style at this point is already the style in question.
1399 \item wxRICHTEXT\_SETSTYLE\_PARAGRAPHS\_ONLY: specifies that the style should only be applied to paragraphs,
1400 and not the content. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
1401 \item wxRICHTEXT\_SETSTYLE\_CHARACTERS\_ONLY: specifies that the style should only be applied to characters,
1402 and not the paragraph. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
1403 \item wxRICHTEXT\_SETSTYLE\_RESET: resets (clears) the existing style before applying the new style.
1404 \end{itemize}
1405
1406 \membersection{wxRichTextCtrl::SetStyleSheet}\label{wxrichtextctrlsetstylesheet}
1407
1408 \func{void}{SetStyleSheet}{\param{wxRichTextStyleSheet* }{styleSheet}}
1409
1410 Sets the style sheet associated with the control. A style sheet allows named
1411 character and paragraph styles to be applied.
1412
1413 \membersection{wxRichTextCtrl::SetValue}\label{wxrichtextctrlsetvalue}
1414
1415 \func{void}{SetValue}{\param{const wxString\& }{value}}
1416
1417 Replaces existing content with the given text.
1418
1419 \membersection{wxRichTextCtrl::SetupScrollbars}\label{wxrichtextctrlsetupscrollbars}
1420
1421 \func{void}{SetupScrollbars}{\param{bool }{atTop = false}}
1422
1423 A helper function setting up scrollbars, for example after a resize.
1424
1425 \membersection{wxRichTextCtrl::ShowPosition}\label{wxrichtextctrlshowposition}
1426
1427 \func{void}{ShowPosition}{\param{long }{pos}}
1428
1429 Scrolls the buffer so that the given position is in view.
1430
1431 \membersection{wxRichTextCtrl::SuppressingUndo}\label{wxrichtextctrlsuppressingundo}
1432
1433 \constfunc{bool}{SuppressingUndo}{\void}
1434
1435 Returns \true if undo history suppression is on.
1436
1437 \membersection{wxRichTextCtrl::Thaw}\label{wxrichtextctrlthaw}
1438
1439 \func{void}{Thaw}{\void}
1440
1441 Call this function to end a Freeze and refresh the display.
1442
1443 \membersection{wxRichTextCtrl::Undo}\label{wxrichtextctrlundo}
1444
1445 \func{void}{Undo}{\void}
1446
1447 Undoes the command at the top of the command history, if there is one.
1448
1449 \membersection{wxRichTextCtrl::WordLeft}\label{wxrichtextctrlwordleft}
1450
1451 \func{bool}{WordLeft}{\param{int }{noWords = 1}, \param{int }{flags = 0}}
1452
1453 Moves a number of words to the left.
1454
1455 \membersection{wxRichTextCtrl::WordRight}\label{wxrichtextctrlwordright}
1456
1457 \func{bool}{WordRight}{\param{int }{noWords = 1}, \param{int }{flags = 0}}
1458
1459 Move a nuber of words to the right.
1460
1461 \membersection{wxRichTextCtrl::WriteImage}\label{wxrichtextctrlwriteimage}
1462
1463 \func{bool}{WriteImage}{\param{const wxString\& }{filename}, \param{int }{bitmapType}}
1464
1465 Loads an image from a file and writes it at the current insertion point.
1466
1467 \func{bool}{WriteImage}{\param{const wxRichTextImageBlock\& }{imageBlock}}
1468
1469 Writes an image block at the current insertion point.
1470
1471 \func{bool}{WriteImage}{\param{const wxBitmap\& }{bitmap}, \param{int }{bitmapType = wxBITMAP\_TYPE\_PNG}}
1472
1473 \func{bool}{WriteImage}{\param{const wxImage\& }{image}, \param{int }{bitmapType = wxBITMAP\_TYPE\_PNG}}
1474
1475 Write a bitmap or image at the current insertion point. Supply an optional type to use
1476 for internal and file storage of the raw data.
1477
1478 \membersection{wxRichTextCtrl::WriteText}\label{wxrichtextctrlwritetext}
1479
1480 \func{void}{WriteText}{\param{const wxString\& }{text}}
1481
1482 Writes text at the current position.
1483
1484 \membersection{wxRichTextCtrl::XYToPosition}\label{wxrichtextctrlxytoposition}
1485
1486 \constfunc{long}{XYToPosition}{\param{long }{x}, \param{long }{y}}
1487
1488 Translates from column and line number to position.
1489