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