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