1 \section{\class{wxRichTextCtrl
}}\label{wxrichtextctrl
}
3 wxRichTextCtrl provides a generic, ground-up implementation of a text control
4 capable of showing multiple styles and images.
6 wxRichTextCtrl sends notification events: see
\helpref{wxRichTextEvent
}{wxrichtextevent
}.
7 It also sends the standard wxTextCtrl events wxEVT
\_COMMAND\_TEXT\_ENTER and wxEVT
\_COMMAND\_TEXT\_UPDATED,
8 and wxTextUrlEvent when URL content is clicked.
10 For more information, see the
\helpref{wxRichTextCtrl overview
}{wxrichtextctrloverview
}.
12 \wxheading{Derived from
}
16 \wxheading{Include files
}
18 <wx/richtext/richtextctrl.h>
22 \helpref{wxRichtext
}{librarieslist
}
24 \wxheading{Data structures
}
26 \latexignore{\rtfignore{\wxheading{Members
}}}
28 \membersection{wxRichTextCtrl::wxRichTextCtrl
}\label{wxrichtextctrlwxrichtextctrl
}
30 \func{}{wxRichTextCtrl
}{\void}
32 \func{}{wxRichTextCtrl
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id = wxID
\_ANY},
\param{const wxString\&
}{value = wxEmptyString
},
33 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\param{long
}{style = wxRE
\_MULTILINE},
34 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\param{const wxString\&
}{name = wxTextCtrlNameStr
}}
38 \membersection{wxRichTextCtrl::
\destruct{wxRichTextCtrl
}}\label{wxrichtextctrldtor
}
40 \func{}{\destruct{wxRichTextCtrl
}}{\void}
44 \membersection{wxRichTextCtrl::AddImage
}\label{wxrichtextctrladdimage
}
46 \func{wxRichTextRange
}{AddImage
}{\param{const wxImage\&
}{image
}}
48 Adds an image to the control's buffer.
50 \membersection{wxRichTextCtrl::AddParagraph
}\label{wxrichtextctrladdparagraph
}
52 \func{wxRichTextRange
}{AddParagraph
}{\param{const wxString\&
}{text
}}
54 Adds a new paragraph of text to the end of the buffer.
56 \membersection{wxRichTextCtrl::AppendText
}\label{wxrichtextctrlappendtext
}
58 \func{void
}{AppendText
}{\param{const wxString\&
}{text
}}
60 Sets the insertion point to the end of the buffer and writes the text.
62 \membersection{wxRichTextCtrl::ApplyAlignmentToSelection
}\label{wxrichtextctrlapplyalignmenttoselection
}
64 \func{bool
}{ApplyAlignmentToSelection
}{\param{wxTextAttrAlignment
}{alignment
}}
66 Applies the given alignment to the selection (undoable).
68 For alignment values, see
\helpref{wxTextAttrEx
}{wxtextattrex
}.
70 \membersection{wxRichTextCtrl::ApplyBoldToSelection
}\label{wxrichtextctrlapplyboldtoselection
}
72 \func{bool
}{ApplyBoldToSelection
}{\void}
74 Apples bold to the selection (undoable).
76 \membersection{wxRichTextCtrl::ApplyItalicToSelection
}\label{wxrichtextctrlapplyitalictoselection
}
78 \func{bool
}{ApplyItalicToSelection
}{\void}
80 Applies italic to the selection (undoable).
82 \membersection{wxRichTextCtrl::ApplyStyle
}\label{wxrichtextctrlapplystyle
}
84 \func{bool
}{ApplyStyle
}{\param{wxRichTextStyleDefinition*
}{ def
}}
86 Applies the given style to the selection.
88 \membersection{wxRichTextCtrl::ApplyStyleSheet
}\label{wxrichtextctrlapplystylesheet
}
90 \func{bool
}{ApplyStyleSheet
}{\param{wxRichTextStyleSheet*
}{ sheet $=$ NULL
}}
92 Applies the style sheet to the buffer, matching paragraph styles in the sheet against named styles
93 in the buffer. This might be useful if the styles have changed. If
{\it sheet
} is NULL, the
94 sheet set with SetStyleSheet is used.
96 Currently this applies paragraph styles only.
98 \membersection{wxRichTextCtrl::ApplyUnderlineToSelection
}\label{wxrichtextctrlapplyunderlinetoselection
}
100 \func{bool
}{ApplyUnderlineToSelection
}{\void}
102 Applies underline to the selection (undoable).
104 \membersection{wxRichTextCtrl::BatchingUndo
}\label{wxrichtextctrlbatchingundo
}
106 \constfunc{bool
}{BatchingUndo
}{\void}
108 Returns
\true if undo commands are being batched.
110 \membersection{wxRichTextCtrl::BeginAlignment
}\label{wxrichtextctrlbeginalignment
}
112 \func{bool
}{BeginAlignment
}{\param{wxTextAttrAlignment
}{alignment
}}
114 Begins using alignment
116 For alignment values, see
\helpref{wxTextAttrEx
}{wxtextattrex
}.
118 \membersection{wxRichTextCtrl::BeginBatchUndo
}\label{wxrichtextctrlbeginbatchundo
}
120 \func{bool
}{BeginBatchUndo
}{\param{const wxString\&
}{cmdName
}}
122 Starts batching undo history for commands.
124 \membersection{wxRichTextCtrl::BeginBold
}\label{wxrichtextctrlbeginbold
}
126 \func{bool
}{BeginBold
}{\void}
130 \membersection{wxRichTextCtrl::BeginCharacterStyle
}\label{wxrichtextctrlbegincharacterstyle
}
132 \func{bool
}{BeginCharacterStyle
}{\param{const wxString\&
}{characterStyle
}}
134 Begins using the named character style.
136 \membersection{wxRichTextCtrl::BeginFont
}\label{wxrichtextctrlbeginfont
}
138 \func{bool
}{BeginFont
}{\param{const wxFont\&
}{font
}}
140 Begins using this font.
142 \membersection{wxRichTextCtrl::BeginFontSize
}\label{wxrichtextctrlbeginfontsize
}
144 \func{bool
}{BeginFontSize
}{\param{int
}{pointSize
}}
146 Begins using the given point size.
148 \membersection{wxRichTextCtrl::BeginItalic
}\label{wxrichtextctrlbeginitalic
}
150 \func{bool
}{BeginItalic
}{\void}
154 \membersection{wxRichTextCtrl::BeginLeftIndent
}\label{wxrichtextctrlbeginleftindent
}
156 \func{bool
}{BeginLeftIndent
}{\param{int
}{leftIndent
},
\param{int
}{leftSubIndent =
0}}
158 Begins applying a left indent and subindent in tenths of a millimetre.
160 The sub-indent is an offset from the left of the paragraph, and is used for all but the
161 first line in a paragraph. A positive value will cause the first line to appear to the left
162 of the subsequent lines, and a negative value will cause the first line to be indented
163 relative to the subsequent lines.
165 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
166 the margin and the bullet. The content of the paragraph, including the first line, starts
167 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
168 left of the actual paragraph is leftSubIndent.
170 \membersection{wxRichTextCtrl::BeginLineSpacing
}\label{wxrichtextctrlbeginlinespacing
}
172 \func{bool
}{BeginLineSpacing
}{\param{int
}{lineSpacing
}}
174 Begins appling line spacing.
{\it spacing
} is a multiple, where
10 means single-spacing,
175 15 means
1.5 spacing, and
20 means double spacing. The following constants are
176 defined for convenience:
180 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
181 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
182 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
186 \membersection{wxRichTextCtrl::BeginListStyle
}\label{wxrichtextctrlbeginliststyle
}
188 \func{bool
}{BeginListStyle
}{\param{const wxString\&
}{ listStyle
},
\param{int
}{ level=
1},
\param{int
}{ number=
1}}
190 Begins using a specified list style. Optionally, you can also pass a level and a number.
192 \membersection{wxRichTextCtrl::BeginNumberedBullet
}\label{wxrichtextctrlbeginnumberedbullet
}
194 \func{bool
}{BeginNumberedBullet
}{\param{int
}{bulletNumber
},
\param{int
}{leftIndent
},
\param{int
}{leftSubIndent
},
\param{int
}{bulletStyle = wxTEXT
\_ATTR\_BULLET\_STYLE\_ARABIC|wxTEXT
\_ATTR\_BULLET\_STYLE\_PERIOD}}
196 Begins a numbered bullet. This call will be needed for each item in the list, and the
197 application should take care of incrementing the numbering.
199 {\it bulletNumber
} is a number, usually starting with
1.
201 {\it leftIndent
} and
{\it leftSubIndent
} are values in tenths of a millimetre.
203 {\it bulletStyle
} is a bitlist of the following values:
207 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
208 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
209 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
210 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
211 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
212 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
213 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
214 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
215 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
216 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
217 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
218 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
219 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
220 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
221 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
222 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
226 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
227 the margin and the bullet. The content of the paragraph, including the first line, starts
228 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
229 left of the actual paragraph is leftSubIndent.
231 \membersection{wxRichTextCtrl::BeginParagraphSpacing
}\label{wxrichtextctrlbeginparagraphspacing
}
233 \func{bool
}{BeginParagraphSpacing
}{\param{int
}{before
},
\param{int
}{after
}}
235 Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of
238 \membersection{wxRichTextCtrl::BeginParagraphStyle
}\label{wxrichtextctrlbeginparagraphstyle
}
240 \func{bool
}{BeginParagraphStyle
}{\param{const wxString\&
}{paragraphStyle
}}
242 Begins applying the named paragraph style.
244 \membersection{wxRichTextCtrl::BeginRightIndent
}\label{wxrichtextctrlbeginrightindent
}
246 \func{bool
}{BeginRightIndent
}{\param{int
}{rightIndent
}}
248 Begins a right indent, specified in tenths of a millimetre.
250 \membersection{wxRichTextCtrl::BeginStyle
}\label{wxrichtextctrlbeginstyle
}
252 \func{bool
}{BeginStyle
}{\param{const wxTextAttrEx\&
}{style
}}
254 Begins applying a style.
256 \membersection{wxRichTextCtrl::BeginSuppressUndo
}\label{wxrichtextctrlbeginsuppressundo
}
258 \func{bool
}{BeginSuppressUndo
}{\void}
260 Starts suppressing undo history for commands.
262 \membersection{wxRichTextCtrl::BeginSymbolBullet
}\label{wxrichtextctrlbeginsymbolbullet
}
264 \func{bool
}{BeginSymbolBullet
}{\param{wxChar
}{symbol
},
\param{int
}{leftIndent
},
\param{int
}{leftSubIndent
},
\param{int
}{bulletStyle = wxTEXT
\_ATTR\_BULLET\_STYLE\_SYMBOL}}
266 Begins applying a symbol bullet, using a character from the current font. See
\helpref{BeginNumberedBullet
}{wxrichtextctrlbeginnumberedbullet
} for
267 an explanation of how indentation is used to render the bulleted paragraph.
269 \membersection{wxRichTextCtrl::BeginTextColour
}\label{wxrichtextctrlbegintextcolour
}
271 \func{bool
}{BeginTextColour
}{\param{const wxColour\&
}{colour
}}
273 Begins using this colour.
275 \membersection{wxRichTextCtrl::BeginUnderline
}\label{wxrichtextctrlbeginunderline
}
277 \func{bool
}{BeginUnderline
}{\void}
279 Begins using underlining.
281 \membersection{wxRichTextCtrl::BeginURL
}\label{wxrichtextctrlbeginurl
}
283 \func{bool
}{BeginURL
}{\param{const wxString\&
}{ url
},
\param{const wxString\&
}{ characterStyle = wxEmptyString
}}
285 Begins applying wxTEXT
\_ATTR\_URL to the content. Pass a URL and optionally, a character style to apply,
286 since it is common to mark a URL with a familiar style such as blue text with underlining.
288 \membersection{wxRichTextCtrl::CanCopy
}\label{wxrichtextctrlcancopy
}
290 \constfunc{bool
}{CanCopy
}{\void}
292 Returns
\true if selected content can be copied to the clipboard.
294 \membersection{wxRichTextCtrl::CanCut
}\label{wxrichtextctrlcancut
}
296 \constfunc{bool
}{CanCut
}{\void}
298 Returns
\true if selected content can be copied to the clipboard and deleted.
300 \membersection{wxRichTextCtrl::CanDeleteSelection
}\label{wxrichtextctrlcandeleteselection
}
302 \constfunc{bool
}{CanDeleteSelection
}{\void}
304 Returns
\true if selected content can be deleted.
306 \membersection{wxRichTextCtrl::CanPaste
}\label{wxrichtextctrlcanpaste
}
308 \constfunc{bool
}{CanPaste
}{\void}
310 Returns
\true if the clipboard content can be pasted to the buffer.
312 \membersection{wxRichTextCtrl::CanRedo
}\label{wxrichtextctrlcanredo
}
314 \constfunc{bool
}{CanRedo
}{\void}
316 Returns
\true if there is a command in the command history that can be redone.
318 \membersection{wxRichTextCtrl::CanUndo
}\label{wxrichtextctrlcanundo
}
320 \constfunc{bool
}{CanUndo
}{\void}
322 Returns
\true if there is a command in the command history that can be undone.
324 \membersection{wxRichTextCtrl::Clear
}\label{wxrichtextctrlclear
}
326 \func{void
}{Clear
}{\void}
328 Clears the buffer content, leaving a single empty paragraph. Cannot be undone.
330 \membersection{wxRichTextCtrl::ClearListStyle
}\label{wxrichtextctrlclearliststyle
}
332 \func{bool
}{ClearListStyle
}{\param{const wxRichTextRange\&
}{range
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
334 \func{bool
}{ClearListStyle
}{\param{const wxRichTextRange\&
}{range
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
336 Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph.
338 {\it flags
} is a bit list of the following:
340 \begin{itemize
}\itemsep=
0pt
341 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
344 See also
\helpref{wxRichTextCtrl::SetListStyle
}{wxrichtextctrlsetliststyle
},
\helpref{wxRichTextCtrl::PromoteList
}{wxrichtextctrlpromotelist
},
\helpref{wxRichTextCtrl::NumberList
}{wxrichtextctrlnumberlist
}.
346 \membersection{wxRichTextCtrl::Command
}\label{wxrichtextctrlcommand
}
348 \func{void
}{Command
}{\param{wxCommandEvent\&
}{event
}}
350 Sends the event to the control.
352 \membersection{wxRichTextCtrl::Copy
}\label{wxrichtextctrlcopy
}
354 \func{void
}{Copy
}{\void}
356 Copies the selected content (if any) to the clipboard.
358 \membersection{wxRichTextCtrl::Create
}\label{wxrichtextctrlcreate
}
360 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id = wxID
\_ANY},
\param{const wxString\&
}{value = wxEmptyString
},
361 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\param{long
}{style = wxRE
\_MULTILINE},
362 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\param{const wxString\&
}{name = wxTextCtrlNameStr
}}
364 Creates the underlying window.
366 \membersection{wxRichTextCtrl::Cut
}\label{wxrichtextctrlcut
}
368 \func{void
}{Cut
}{\void}
370 Copies the selected content (if any) to the clipboard and deletes the selection.
373 \membersection{wxRichTextCtrl::Delete
}\label{wxrichtextctrldelete
}
375 \func{bool
}{Delete
}{\param{const wxRichTextRange\&
}{ range
}}
377 Deletes the content within the given range.
379 \membersection{wxRichTextCtrl::DeleteSelectedContent
}\label{wxrichtextctrldeleteselectedcontent
}
381 \func{bool
}{DeleteSelectedContent
}{\param{long*
}{newPos = NULL
}}
383 Deletes content if there is a selection, e.g. when pressing a key.
384 Returns the new caret position in
{\it newPos
}, or leaves it if there
385 was no action. This is undoable.
387 \membersection{wxRichTextCtrl::DeleteSelection
}\label{wxrichtextctrldeleteselection
}
389 \func{void
}{DeleteSelection
}{\void}
391 Deletes the content in the selection, if any. This is undoable.
393 \membersection{wxRichTextCtrl::DiscardEdits
}\label{wxrichtextctrldiscardedits
}
395 \func{void
}{DiscardEdits
}{\void}
397 Sets the buffer's modified status to
\false, and clears the buffer's command history.
399 \membersection{wxRichTextCtrl::DoGetBestSize
}\label{wxrichtextctrldogetbestsize
}
401 \constfunc{wxSize
}{DoGetBestSize
}{\void}
403 Currently this simply returns
{\tt wxSize(
10,
10)
}.
405 \membersection{wxRichTextCtrl::EndAlignment
}\label{wxrichtextctrlendalignment
}
407 \func{bool
}{EndAlignment
}{\void}
411 \membersection{wxRichTextCtrl::EndAllStyles
}\label{wxrichtextctrlendallstyles
}
413 \func{bool
}{EndAllStyles
}{\void}
415 Ends application of all styles in the current style stack.
417 \membersection{wxRichTextCtrl::EndBatchUndo
}\label{wxrichtextctrlendbatchundo
}
419 \func{bool
}{EndBatchUndo
}{\void}
421 Ends batching undo command history.
423 \membersection{wxRichTextCtrl::EndBold
}\label{wxrichtextctrlendbold
}
425 \func{bool
}{EndBold
}{\void}
429 \membersection{wxRichTextCtrl::EndCharacterStyle
}\label{wxrichtextctrlendcharacterstyle
}
431 \func{bool
}{EndCharacterStyle
}{\void}
433 Ends application of a named character style.
435 \membersection{wxRichTextCtrl::EndFont
}\label{wxrichtextctrlendfont
}
437 \func{bool
}{EndFont
}{\void}
441 \membersection{wxRichTextCtrl::EndFontSize
}\label{wxrichtextctrlendfontsize
}
443 \func{bool
}{EndFontSize
}{\void}
445 Ends using a point size.
447 \membersection{wxRichTextCtrl::EndItalic
}\label{wxrichtextctrlenditalic
}
449 \func{bool
}{EndItalic
}{\void}
453 \membersection{wxRichTextCtrl::EndLeftIndent
}\label{wxrichtextctrlendleftindent
}
455 \func{bool
}{EndLeftIndent
}{\void}
459 \membersection{wxRichTextCtrl::EndLineSpacing
}\label{wxrichtextctrlendlinespacing
}
461 \func{bool
}{EndLineSpacing
}{\void}
465 \membersection{wxRichTextCtrl::EndListStyle
}\label{wxrichtextctrlendliststyle
}
467 \func{bool
}{EndListStyle
}{\void}
469 Ends using a specified list style.
471 \membersection{wxRichTextCtrl::EndNumberedBullet
}\label{wxrichtextctrlendnumberedbullet
}
473 \func{bool
}{EndNumberedBullet
}{\void}
475 Ends application of a numbered bullet.
477 \membersection{wxRichTextCtrl::EndParagraphSpacing
}\label{wxrichtextctrlendparagraphspacing
}
479 \func{bool
}{EndParagraphSpacing
}{\void}
481 Ends paragraph spacing.
483 \membersection{wxRichTextCtrl::EndParagraphStyle
}\label{wxrichtextctrlendparagraphstyle
}
485 \func{bool
}{EndParagraphStyle
}{\void}
487 Ends application of a named character style.
489 \membersection{wxRichTextCtrl::EndRightIndent
}\label{wxrichtextctrlendrightindent
}
491 \func{bool
}{EndRightIndent
}{\void}
495 \membersection{wxRichTextCtrl::EndStyle
}\label{wxrichtextctrlendstyle
}
497 \func{bool
}{EndStyle
}{\void}
499 Ends the current style.
501 \membersection{wxRichTextCtrl::EndSuppressUndo
}\label{wxrichtextctrlendsuppressundo
}
503 \func{bool
}{EndSuppressUndo
}{\void}
505 Ends suppressing undo command history.
507 \membersection{wxRichTextCtrl::EndSymbolBullet
}\label{wxrichtextctrlendsymbolbullet
}
509 \func{bool
}{EndSymbolBullet
}{\void}
511 Ends applying a symbol bullet.
513 \membersection{wxRichTextCtrl::EndTextColour
}\label{wxrichtextctrlendtextcolour
}
515 \func{bool
}{EndTextColour
}{\void}
517 Ends applying a text colour.
519 \membersection{wxRichTextCtrl::EndUnderline
}\label{wxrichtextctrlendunderline
}
521 \func{bool
}{EndUnderline
}{\void}
523 End applying underlining.
525 \membersection{wxRichTextCtrl::EndURL
}\label{wxrichtextctrlendurl
}
527 \func{bool
}{EndURL
}{\void}
531 \membersection{wxRichTextCtrl::ExtendSelection
}\label{wxrichtextctrlextendselection
}
533 \func{bool
}{ExtendSelection
}{\param{long
}{oldPosition
},
\param{long
}{newPosition
},
\param{int
}{flags
}}
535 Helper function for extending the selection, returning
\true if the selection was
536 changed. Selections are in caret positions.
538 \membersection{wxRichTextCtrl::FindNextWordPosition
}\label{wxrichtextctrlfindnextwordposition
}
540 \constfunc{long
}{FindNextWordPosition
}{\param{int
}{direction =
1}}
542 Helper function for finding the caret position for the next word. Direction
543 is
1 (forward) or -
1 (backwards).
545 \membersection{wxRichTextCtrl::Freeze
}\label{wxrichtextctrlfreeze
}
547 \func{void
}{Freeze
}{\void}
549 Call this function to prevent refresh and allow fast updates, and then
\helpref{Thaw
}{wxrichtextctrlthaw
} to
552 \membersection{wxRichTextCtrl::GetBasicStyle
}\label{wxrichtextctrlgetbasicstyle
}
554 \constfunc{const wxTextAttrEx\&
}{GetBasicStyle
}{\void}
556 Gets the basic (overall) style. This is the style of the whole
557 buffer before further styles are applied, unlike the default style, which
558 only affects the style currently being applied (for example, setting the default
559 style to bold will cause subsequently inserted text to be bold).
561 \membersection{wxRichTextCtrl::GetBuffer
}\label{wxrichtextctrlgetbuffer
}
563 \constfunc{const wxRichTextBuffer\&
}{GetBuffer
}{\void}
565 \func{wxRichTextBuffer\&
}{GetBuffer
}{\void}
567 Returns the buffer associated with the control.
569 \membersection{wxRichTextCtrl::GetCaretPosition
}\label{wxrichtextctrlgetcaretposition
}
571 \constfunc{long
}{GetCaretPosition
}{\void}
573 Returns the current caret position.
575 \membersection{wxRichTextCtrl::GetCaretPositionForIndex
}\label{wxrichtextctrlgetcaretpositionforindex
}
577 \func{bool
}{GetCaretPositionForIndex
}{\param{long
}{position
},
\param{wxRect\&
}{rect
}}
579 Returns the caret height and position for the given character position
581 \membersection{wxRichTextCtrl::GetCommandProcessor
}\label{wxrichtextctrlgetcommandprocessor
}
583 \constfunc{wxCommandProcessor*
}{GetCommandProcessor
}{\void}
585 Gets the command processor associated with the control's buffer.
587 \membersection{wxRichTextCtrl::GetDefaultStyleEx
}\label{wxrichtextctrlgetdefaultstyleex
}
589 \constfunc{const wxTextAttrEx\&
}{GetDefaultStyleEx
}{\void}
591 Returns the current default style, which can be used to change how subsequently inserted
592 text is displayed. When wxTextAttrEx is merged with wxTextAttr, this function
593 will become GetDefaultStyle.
595 \membersection{wxRichTextCtrl::GetDelayedLayoutThreshold
}\label{wxrichtextctrlgetdelayedlayoutthreshold
}
597 \constfunc{long
}{GetDelayedLayoutThreshold
}{\void}
599 Gets the size of the buffer beyond which layout is delayed during resizing.
600 This optimizes sizing for large buffers. The default is
20000.
602 \membersection{wxRichTextCtrl::GetFilename
}\label{wxrichtextctrlgetfilename
}
604 \constfunc{wxString
}{GetFilename
}{\void}
606 Gets the current filename associated with the control.
608 \membersection{wxRichTextCtrl::GetFirstVisiblePosition
}\label{wxrichtextctrlgetfirstvisibleposition
}
610 \constfunc{long
}{GetFirstVisiblePosition
}{\void}
612 Returns the first visible position in the current view.
614 \membersection{wxRichTextCtrl::GetHandlerFlags
}\label{wxrichtextfilehandlergethandlerflags
}
616 \constfunc{int
}{GetHandlerFlags
}{\void}
618 Returns flags that change the behaviour of loading or saving. See the documentation for each
619 handler class to see what flags are relevant for each handler.
621 \membersection{wxRichTextCtrl::GetInsertionPoint
}\label{wxrichtextctrlgetinsertionpoint
}
623 \constfunc{long
}{GetInsertionPoint
}{\void}
625 Returns the current insertion point.
627 \membersection{wxRichTextCtrl::GetLastPosition
}\label{wxrichtextctrlgetlastposition
}
629 \constfunc{wxTextPos
}{GetLastPosition
}{\void}
631 Returns the last position in the buffer.
633 \membersection{wxRichTextCtrl::GetLineLength
}\label{wxrichtextctrlgetlinelength
}
635 \constfunc{int
}{GetLineLength
}{\param{long
}{lineNo
}}
637 Returns the length of the specified line in characters.
639 \membersection{wxRichTextCtrl::GetLineText
}\label{wxrichtextctrlgetlinetext
}
641 \constfunc{wxString
}{GetLineText
}{\param{long
}{lineNo
}}
643 Returns the text for the given line.
645 \membersection{wxRichTextCtrl::GetLogicalPoint
}\label{wxrichtextctrlgetlogicalpoint
}
647 \constfunc{wxPoint
}{GetLogicalPoint
}{\param{const wxPoint\&
}{ptPhysical
}}
649 Transforms physical window position to logical (unscrolled) position.
651 \membersection{wxRichTextCtrl::GetNumberOfLines
}\label{wxrichtextctrlgetnumberoflines
}
653 \constfunc{int
}{GetNumberOfLines
}{\void}
655 Returns the number of lines in the buffer.
657 \membersection{wxRichTextCtrl::GetPhysicalPoint
}\label{wxrichtextctrlgetphysicalpoint
}
659 \constfunc{wxPoint
}{GetPhysicalPoint
}{\param{const wxPoint\&
}{ptLogical
}}
661 Transforms logical (unscrolled) position to physical window position.
663 \membersection{wxRichTextCtrl::GetRange
}\label{wxrichtextctrlgetrange
}
665 \constfunc{wxString
}{GetRange
}{\param{long
}{from
},
\param{long
}{to
}}
667 Gets the text for the given range.
669 The end point of range is specified as the last character position of the span of text, plus one.
671 \membersection{wxRichTextCtrl::GetSelection
}\label{wxrichtextctrlgetselection
}
673 \constfunc{void
}{GetSelection
}{\param{long*
}{from
},
\param{long*
}{to
}}
675 Returns the range of the current selection.
677 The end point of range is specified as the last character position of the span of text, plus one.
679 If the return values
{\it from
} and
{\it to
} are the same, there is no selection.
681 \membersection{wxRichTextCtrl::GetSelectionRange
}\label{wxrichtextctrlgetselectionrange
}
683 \constfunc{const wxRichTextRange\&
}{GetSelectionRange
}{\void}
685 Returns the selection range in character positions. -
1, -
1 means no selection.
687 \membersection{wxRichTextCtrl::GetStringSelection
}\label{wxrichtextctrlgetstringselection
}
689 \constfunc{wxString
}{GetStringSelection
}{\void}
691 Returns the text within the current selection range, if any.
693 \membersection{wxRichTextCtrl::GetStyle
}\label{wxrichtextctrlgetstyle
}
695 \func{bool
}{GetStyle
}{\param{long
}{position
},
\param{wxRichTextAttr\&
}{style
}}
697 \func{bool
}{GetStyle
}{\param{long
}{position
},
\param{wxTextAttrEx\&
}{style
}}
699 \func{bool
}{GetStyle
}{\param{long
}{position
},
\param{wxTextAttr\&
}{style
}}
701 Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
702 because it does not use wxFont objects.
704 This function gets the combined style - that is, the style you see on the screen as a result
705 of combining base style, paragraph style and character style attributes. To get the character
706 or paragraph style alone, use
\helpref{GetUncombinedStyle
}{wxrichtextctrlgetuncombinedstyle
}.
708 \membersection{wxRichTextCtrl::GetStyleForRange
}\label{wxrichtextctrlgetstyleforrange
}
710 \func{bool
}{GetStyleForRange
}{\param{const wxRichTextRange\&
}{range
},
\param{wxRichTextAttr\&
}{style
}}
712 \func{bool
}{GetStyleForRange
}{\param{const wxRichTextRange\&
}{range
},
\param{wxTextAttrEx\&
}{style
}}
714 Gets the attributes common to the specified range. Attributes that differ in value within the range will
715 not be included in
{\it style
}'s flags.
717 \membersection{wxRichTextCtrl::GetStyleSheet
}\label{wxrichtextctrlgetstylesheet
}
719 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
721 Returns the style sheet associated with the control, if any. A style sheet allows named
722 character and paragraph styles to be applied.
724 \membersection{wxRichTextCtrl::GetUncombinedStyle
}\label{wxrichtextctrlgetuncombinedstyle
}
726 \func{bool
}{GetUncombinedStyle
}{\param{long
}{position
},
\param{wxRichTextAttr\&
}{style
}}
728 \func{bool
}{GetUncombinedStyle
}{\param{long
}{position
},
\param{wxTextAttrEx\&
}{style
}}
730 \func{bool
}{GetUncombinedStyle
}{\param{long
}{position
},
\param{wxTextAttr\&
}{style
}}
732 Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
733 because it does not use wxFont objects.
735 This function gets the
{\it uncombined style
} - that is, the attributes associated with the
736 paragraph or character content, and not necessarily the combined attributes you see on the
737 screen. To get the combined attributes, use
\helpref{GetStyle
}{wxrichtextctrlgetstyle
}.
739 If you specify (any) paragraph attribute in
{\it style
}'s flags, this function will fetch
740 the paragraph attributes. Otherwise, it will return the character attributes.
742 \membersection{wxRichTextCtrl::GetValue
}\label{wxrichtextctrlgetvalue
}
744 \constfunc{wxString
}{GetValue
}{\void}
746 Returns the content of the entire control as a string.
748 \membersection{wxRichTextCtrl::GetVisibleLineForCaretPosition
}\label{wxrichtextctrlgetvisiblelineforcaretposition
}
750 \constfunc{wxRichTextLine*
}{GetVisibleLineForCaretPosition
}{\param{long
}{caretPosition
}}
752 Internal helper function returning the line for the visible caret position. If the caret is
753 shown at the very end of the line, it means the next character is actually
754 on the following line. So this function gets the line we're expecting to find
757 \membersection{wxRichTextCtrl::HasCharacterAttributes
}\label{wxrichtextctrlhascharacterattributes
}
759 \constfunc{bool
}{HasCharacterAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxTextAttrEx\&
}{style
}}
761 \constfunc{bool
}{HasCharacterAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
}}
763 Test if this whole range has character attributes of the specified kind. If any
764 of the attributes are different within the range, the test fails. You
765 can use this to implement, for example, bold button updating.
{\it style
} must have
766 flags indicating which attributes are of interest.
768 \membersection{wxRichTextCtrl::HasParagraphAttributes
}\label{wxrichtextctrlhasparagraphattributes
}
770 \constfunc{bool
}{HasParagraphAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxTextAttrEx\&
}{style
}}
772 \constfunc{bool
}{HasParagraphAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
}}
774 Test if this whole range has paragraph attributes of the specified kind. If any
775 of the attributes are different within the range, the test fails. You
776 can use this to implement, for example, centering button updating.
{\it style
} must have
777 flags indicating which attributes are of interest.
779 \membersection{wxRichTextCtrl::HasSelection
}\label{wxrichtextctrlhasselection
}
781 \constfunc{bool
}{HasSelection
}{\void}
783 Returns
\true if there is a selection.
785 \membersection{wxRichTextCtrl::HitTest
}\label{wxrichtextctrlhittest
}
787 \constfunc{wxTextCtrlHitTestResult
}{HitTest
}{\param{const wxPoint\&
}{pt
},
\param{long*
}{pos
}}
789 \constfunc{wxTextCtrlHitTestResult
}{HitTest
}{\param{const wxPoint\&
}{pt
},
\param{wxTextCoord*
}{col
},
\param{wxTextCoord*
}{row
}}
791 Finds the character at the given position in pixels.
793 {\it pt
} is in device coords (not adjusted for the client area origin nor for scrolling).
795 \membersection{wxRichTextCtrl::Init
}\label{wxrichtextctrlinit
}
797 \func{void
}{Init
}{\void}
799 Initialises the members of the control.
801 \membersection{wxRichTextCtrl::InitCommandEvent
}\label{wxrichtextctrlinitcommandevent
}
803 \constfunc{void
}{InitCommandEvent
}{\param{wxCommandEvent\&
}{event
}}
805 Initialises the command event.
807 \membersection{wxRichTextCtrl::IsDefaultStyleShowing
}\label{wxrichtextctrlisdefaultstyleshowing
}
809 \constfunc{bool
}{IsDefaultStyleShowing
}{\void}
811 Returns
\true if the user has recently set the default style without moving the caret,
812 and therefore the UI needs to reflect the default style and not the style at the caret.
814 Below is an example of code that uses this function to determine whether the UI
815 should show that the current style is bold.
818 /// Is all of the selection bold?
819 bool wxRichTextCtrl::IsSelectionBold()
824 wxRichTextRange range = GetInternalSelectionRange();
825 attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
826 attr.SetFontWeight(wxBOLD);
828 return HasCharacterAttributes(range, attr);
832 // If no selection, then we need to combine current style with default style
833 // to see what the effect would be if we started typing.
835 attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
837 long pos = GetAdjustedCaretPosition(GetCaretPosition());
838 if (GetStyle(pos, attr))
840 if (IsDefaultStyleShowing())
841 wxRichTextApplyStyle(attr, GetDefaultStyleEx());
842 return attr.GetFontWeight() == wxBOLD;
849 See also
\helpref{SetAndShowDefaultStyle
}{wxrichtextctrlsetandshowdefaultstyle
}.
851 \membersection{wxRichTextCtrl::IsEditable
}\label{wxrichtextctrliseditable
}
853 \constfunc{bool
}{IsEditable
}{\void}
855 Returns
\true if the control is editable.
857 \membersection{wxRichTextCtrl::IsFrozen
}\label{wxrichtextctrlisfrozen
}
859 \constfunc{bool
}{IsFrozen
}{\void}
861 Returns
\true if Freeze has been called without a Thaw.
863 \membersection{wxRichTextCtrl::IsModified
}\label{wxrichtextctrlismodified
}
865 \constfunc{bool
}{IsModified
}{\void}
867 Returns
\true if the buffer has been modified.
869 \membersection{wxRichTextCtrl::IsMultiLine
}\label{wxrichtextctrlismultiline
}
871 \constfunc{bool
}{IsMultiLine
}{\void}
873 Returns
\true if the control is multiline.
875 \membersection{wxRichTextCtrl::IsPositionVisible
}\label{wxrichtextctrlispositionvisible
}
877 \constfunc{bool
}{IsPositionVisible
}{\param{long
}{pos
}}
879 Returns
\true if the given position is visible on the screen.
881 \membersection{wxRichTextCtrl::IsSelectionAligned
}\label{wxrichtextctrlisselectionaligned
}
883 \constfunc{bool
}{IsSelectionAligned
}{\param{wxTextAttrAlignment
}{alignment
}}
885 Returns
\true if all of the selection is aligned according to the specified flag.
887 \membersection{wxRichTextCtrl::IsSelectionBold
}\label{wxrichtextctrlisselectionbold
}
889 \constfunc{bool
}{IsSelectionBold
}{\void}
891 Returns
\true if all of the selection is bold.
893 \membersection{wxRichTextCtrl::IsSelectionItalics
}\label{wxrichtextctrlisselectionitalics
}
895 \constfunc{bool
}{IsSelectionItalics
}{\void}
897 Returns
\true if all of the selection is italic.
899 \membersection{wxRichTextCtrl::IsSelectionUnderlined
}\label{wxrichtextctrlisselectionunderlined
}
901 \constfunc{bool
}{IsSelectionUnderlined
}{\void}
903 Returns
\true if all of the selection is underlined.
905 \membersection{wxRichTextCtrl::IsSingleLine
}\label{wxrichtextctrlissingleline
}
907 \constfunc{bool
}{IsSingleLine
}{\void}
909 Returns
\true if the control is single-line. Currently wxRichTextCtrl does not
910 support single-line editing.
912 \membersection{wxRichTextCtrl::KeyboardNavigate
}\label{wxrichtextctrlkeyboardnavigate
}
914 \func{bool
}{KeyboardNavigate
}{\param{int
}{keyCode
},
\param{int
}{flags
}}
916 Helper function implementing keyboard navigation.
918 \membersection{wxRichTextCtrl::LayoutContent
}\label{wxrichtextctrllayoutcontent
}
920 \func{bool
}{LayoutContent
}{\param{bool
}{onlyVisibleRect = false
}}
922 Lays out the buffer, which must be done before certain operations, such as
923 setting the caret position. This function should not normally be required by the
926 \membersection{wxRichTextCtrl::LineBreak
}\label{wxrichtextctrllinebreak
}
928 \func{bool
}{LineBreak
}{\void}
930 Inserts a line break at the current insertion point. A line break forces wrapping within a paragraph, and
931 can be introduced by using this function, by appending the wxChar value
{\bf wxRichTextLineBreakChar
} to text content,
932 or by typing Shift-Return.
934 \membersection{wxRichTextCtrl::LoadFile
}\label{wxrichtextctrlloadfile
}
936 \func{bool
}{LoadFile
}{\param{const wxString\&
}{file
},
\param{int
}{type = wxRICHTEXT
\_TYPE\_ANY}}
938 Loads content into the control's buffer using the given type. If the specified type
939 is wxRICHTEXT
\_TYPE\_ANY, the type is deduced from the filename extension.
941 This function looks for a suitable
\helpref{wxRichTextFileHandler
}{wxrichtextfilehandler
} object.
943 \membersection{wxRichTextCtrl::MarkDirty
}\label{wxrichtextctrlmarkdirty
}
945 \func{void
}{MarkDirty
}{\void}
947 Marks the buffer as modified.
949 \membersection{wxRichTextCtrl::MoveCaret
}\label{wxrichtextctrlmovecaret
}
951 \func{bool
}{MoveCaret
}{\param{long
}{pos
},
\param{bool
}{showAtLineStart = false
}}
953 Move the caret to the given character position.
955 \membersection{wxRichTextCtrl::MoveCaretBack
}\label{wxrichtextctrlmovecaretback
}
957 \func{void
}{MoveCaretBack
}{\param{long
}{oldPosition
}}
959 Move the caret one visual step forward: this may mean setting a flag
960 and keeping the same position if we're going from the end of one line
961 to the start of the next, which may be the exact same caret position.
963 \membersection{wxRichTextCtrl::MoveCaretForward
}\label{wxrichtextctrlmovecaretforward
}
965 \func{void
}{MoveCaretForward
}{\param{long
}{oldPosition
}}
967 Move the caret one visual step forward: this may mean setting a flag
968 and keeping the same position if we're going from the end of one line
969 to the start of the next, which may be the exact same caret position.
971 \membersection{wxRichTextCtrl::MoveDown
}\label{wxrichtextctrlmovedown
}
973 \func{bool
}{MoveDown
}{\param{int
}{noLines =
1},
\param{int
}{flags =
0}}
975 Moves the caret down.
977 \membersection{wxRichTextCtrl::MoveEnd
}\label{wxrichtextctrlmoveend
}
979 \func{bool
}{MoveEnd
}{\param{int
}{flags =
0}}
981 Moves to the end of the buffer.
983 \membersection{wxRichTextCtrl::MoveHome
}\label{wxrichtextctrlmovehome
}
985 \func{bool
}{MoveHome
}{\param{int
}{flags =
0}}
987 Moves to the start of the buffer.
989 \membersection{wxRichTextCtrl::MoveLeft
}\label{wxrichtextctrlmoveleft
}
991 \func{bool
}{MoveLeft
}{\param{int
}{noPositions =
1},
\param{int
}{flags =
0}}
995 \membersection{wxRichTextCtrl::MoveRight
}\label{wxrichtextctrlmoveright
}
997 \func{bool
}{MoveRight
}{\param{int
}{noPositions =
1},
\param{int
}{flags =
0}}
1001 \membersection{wxRichTextCtrl::MoveToLineEnd
}\label{wxrichtextctrlmovetolineend
}
1003 \func{bool
}{MoveToLineEnd
}{\param{int
}{flags =
0}}
1005 Moves to the end of the line.
1007 \membersection{wxRichTextCtrl::MoveToLineStart
}\label{wxrichtextctrlmovetolinestart
}
1009 \func{bool
}{MoveToLineStart
}{\param{int
}{flags =
0}}
1011 Moves to the start of the line.
1013 \membersection{wxRichTextCtrl::MoveToParagraphEnd
}\label{wxrichtextctrlmovetoparagraphend
}
1015 \func{bool
}{MoveToParagraphEnd
}{\param{int
}{flags =
0}}
1017 Moves to the end of the paragraph.
1019 \membersection{wxRichTextCtrl::MoveToParagraphStart
}\label{wxrichtextctrlmovetoparagraphstart
}
1021 \func{bool
}{MoveToParagraphStart
}{\param{int
}{flags =
0}}
1023 Moves to the start of the paragraph.
1025 \membersection{wxRichTextCtrl::MoveUp
}\label{wxrichtextctrlmoveup
}
1027 \func{bool
}{MoveUp
}{\param{int
}{noLines =
1},
\param{int
}{flags =
0}}
1031 \membersection{wxRichTextCtrl::Newline
}\label{wxrichtextctrlnewline
}
1033 \func{bool
}{Newline
}{\void}
1035 Inserts a new paragraph at the current insertion point. See also
\helpref{wxRichTextCtrl::LineBreak
}{wxrichtextctrllinebreak
}.
1037 \membersection{wxRichTextCtrl::NumberList
}\label{wxrichtextctrlnumberlist
}
1039 \func{bool
}{NumberList
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextListStyleDefinition*
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO},
\param{int
}{ startFrom = -
1},
\param{int
}{ listLevel = -
1}}
1041 \func{bool
}{Number
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxString\&
}{styleName
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO},
\param{int
}{ startFrom = -
1},
\param{int
}{ listLevel = -
1}}
1043 Numbers the paragraphs in the given range. Pass flags to determine how the attributes are set.
1044 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1046 {\it flags
} is a bit list of the following:
1048 \begin{itemize
}\itemsep=
0pt
1049 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1050 \item wxRICHTEXT
\_SETSTYLE\_RENUMBER: specifies that numbering should start from
{\it startFrom
}, otherwise existing attributes are used.
1051 \item wxRICHTEXT
\_SETSTYLE\_SPECIFY\_LEVEL: specifies that
{\it listLevel
} should be used as the level for all paragraphs, otherwise the current indentation will be used.
1054 See also
\helpref{wxRichTextCtrl::SetListStyle
}{wxrichtextctrlsetliststyle
},
\helpref{wxRichTextCtrl::PromoteList
}{wxrichtextctrlpromotelist
},
\helpref{wxRichTextCtrl::ClearListStyle
}{wxrichtextctrlclearliststyle
}.
1056 \membersection{wxRichTextCtrl::OnClear
}\label{wxrichtextctrlonclear
}
1058 \func{void
}{OnClear
}{\param{wxCommandEvent\&
}{event
}}
1060 Standard handler for the wxID
\_CLEAR command.
1062 \membersection{wxRichTextCtrl::OnContextMenu
}\label{wxrichtextctrloncontextmenu
}
1064 \func{void
}{OnContextMenu
}{\param{wxContextMenuEvent\&
}{event
}}
1066 Shows a standard context menu with undo, redo, cut, copy, paste, clear, and select all commands.
1068 \membersection{wxRichTextCtrl::OnCopy
}\label{wxrichtextctrloncopy
}
1070 \func{void
}{OnCopy
}{\param{wxCommandEvent\&
}{event
}}
1072 Standard handler for the wxID
\_COPY command.
1074 \membersection{wxRichTextCtrl::OnCut
}\label{wxrichtextctrloncut
}
1076 \func{void
}{OnCut
}{\param{wxCommandEvent\&
}{event
}}
1078 Standard handler for the wxID
\_CUT command.
1080 \membersection{wxRichTextCtrl::OnDropFiles
}\label{wxrichtextctrlondropfiles
}
1082 \func{void
}{OnDropFiles
}{\param{wxDropFilesEvent\&
}{event
}}
1084 Loads the first dropped file.
1086 \membersection{wxRichTextCtrl::OnPaste
}\label{wxrichtextctrlonpaste
}
1088 \func{void
}{OnPaste
}{\param{wxCommandEvent\&
}{event
}}
1090 Standard handler for the wxID
\_PASTE command.
1092 \membersection{wxRichTextCtrl::OnRedo
}\label{wxrichtextctrlonredo
}
1094 \func{void
}{OnRedo
}{\param{wxCommandEvent\&
}{event
}}
1096 Standard handler for the wxID
\_REDO command.
1098 \membersection{wxRichTextCtrl::OnSelectAll
}\label{wxrichtextctrlonselectall
}
1100 \func{void
}{OnSelectAll
}{\param{wxCommandEvent\&
}{event
}}
1102 Standard handler for the wxID
\_SELECTALL command.
1104 \membersection{wxRichTextCtrl::OnUndo
}\label{wxrichtextctrlonundo
}
1106 \func{void
}{OnUndo
}{\param{wxCommandEvent\&
}{event
}}
1108 Standard handler for the wxID
\_PASTE command.
1110 \membersection{wxRichTextCtrl::OnUpdateClear
}\label{wxrichtextctrlonupdateclear
}
1112 \func{void
}{OnUpdateClear
}{\param{wxUpdateUIEvent\&
}{event
}}
1114 Standard update handler for the wxID
\_CLEAR command.
1116 \membersection{wxRichTextCtrl::OnUpdateCopy
}\label{wxrichtextctrlonupdatecopy
}
1118 \func{void
}{OnUpdateCopy
}{\param{wxUpdateUIEvent\&
}{event
}}
1120 Standard update handler for the wxID
\_COPY command.
1122 \membersection{wxRichTextCtrl::OnUpdateCut
}\label{wxrichtextctrlonupdatecut
}
1124 \func{void
}{OnUpdateCut
}{\param{wxUpdateUIEvent\&
}{event
}}
1126 Standard update handler for the wxID
\_CUT command.
1128 \membersection{wxRichTextCtrl::OnUpdatePaste
}\label{wxrichtextctrlonupdatepaste
}
1130 \func{void
}{OnUpdatePaste
}{\param{wxUpdateUIEvent\&
}{event
}}
1132 Standard update handler for the wxID
\_PASTE command.
1134 \membersection{wxRichTextCtrl::OnUpdateRedo
}\label{wxrichtextctrlonupdateredo
}
1136 \func{void
}{OnUpdateRedo
}{\param{wxUpdateUIEvent\&
}{event
}}
1138 Standard update handler for the wxID
\_REDO command.
1140 \membersection{wxRichTextCtrl::OnUpdateSelectAll
}\label{wxrichtextctrlonupdateselectall
}
1142 \func{void
}{OnUpdateSelectAll
}{\param{wxUpdateUIEvent\&
}{event
}}
1144 Standard update handler for the wxID
\_SELECTALL command.
1146 \membersection{wxRichTextCtrl::OnUpdateUndo
}\label{wxrichtextctrlonupdateundo
}
1148 \func{void
}{OnUpdateUndo
}{\param{wxUpdateUIEvent\&
}{event
}}
1150 Standard update handler for the wxID
\_UNDO command.
1152 \membersection{wxRichTextCtrl::PageDown
}\label{wxrichtextctrlpagedown
}
1154 \func{bool
}{PageDown
}{\param{int
}{noPages =
1},
\param{int
}{flags =
0}}
1156 Moves one or more pages down.
1158 \membersection{wxRichTextCtrl::PageUp
}\label{wxrichtextctrlpageup
}
1160 \func{bool
}{PageUp
}{\param{int
}{noPages =
1},
\param{int
}{flags =
0}}
1162 Moves one or more pages up.
1164 \membersection{wxRichTextCtrl::PaintBackground
}\label{wxrichtextctrlpaintbackground
}
1166 \func{void
}{PaintBackground
}{\param{wxDC\&
}{dc
}}
1168 Paints the background.
1170 \membersection{wxRichTextCtrl::Paste
}\label{wxrichtextctrlpaste
}
1172 \func{void
}{Paste
}{\void}
1174 Pastes content from the clipboard to the buffer.
1176 \membersection{wxRichTextCtrl::PositionCaret
}\label{wxrichtextctrlpositioncaret
}
1178 \func{void
}{PositionCaret
}{\void}
1180 Internal function to position the visible caret according to the current caret position.
1182 \membersection{wxRichTextCtrl::PositionToXY
}\label{wxrichtextctrlpositiontoxy
}
1184 \constfunc{bool
}{PositionToXY
}{\param{long
}{pos
},
\param{long*
}{x
},
\param{long*
}{y
}}
1186 Converts a text position to zero-based column and line numbers.
1188 \membersection{wxRichTextCtrl::PromoteList
}\label{wxrichtextctrlpromotelist
}
1190 \func{bool
}{PromoteList
}{\param{int
}{ promoteBy
},
\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextListStyleDefinition*
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO},
\param{int
}{ listLevel = -
1}}
1192 \func{bool
}{PromoteList
}{\param{int
}{ promoteBy
},
\param{const wxRichTextRange\&
}{range
},
\param{const wxString\&
}{styleName
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO},
\param{int
}{ listLevel = -
1}}
1194 Promotes or demotes the paragraphs in the given range. A positive
{\it promoteBy
} produces a smaller indent, and a negative number
1195 produces a larger indent. Pass flags to determine how the attributes are set.
1196 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1198 {\it flags
} is a bit list of the following:
1200 \begin{itemize
}\itemsep=
0pt
1201 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1202 \item wxRICHTEXT
\_SETSTYLE\_RENUMBER: specifies that numbering should start from
{\it startFrom
}, otherwise existing attributes are used.
1203 \item wxRICHTEXT
\_SETSTYLE\_SPECIFY\_LEVEL: specifies that
{\it listLevel
} should be used as the level for all paragraphs, otherwise the current indentation will be used.
1206 See also
\helpref{wxRichTextCtrl::SetListStyle
}{wxrichtextctrlsetliststyle
}, See also
\helpref{wxRichTextCtrl::SetListStyle
}{wxrichtextctrlnumberlist
},
\helpref{wxRichTextCtrl::ClearListStyle
}{wxrichtextctrlclearliststyle
}.
1208 \membersection{wxRichTextCtrl::Redo
}\label{wxrichtextctrlredo
}
1210 \func{void
}{Redo
}{\void}
1212 Redoes the current command.
1214 \membersection{wxRichTextCtrl::Remove
}\label{wxrichtextctrlremove
}
1216 \func{void
}{Remove
}{\param{long
}{from
},
\param{long
}{to
}}
1218 Removes the content in the specified range.
1220 \membersection{wxRichTextCtrl::Replace
}\label{wxrichtextctrlreplace
}
1222 \func{void
}{Replace
}{\param{long
}{from
},
\param{long
}{to
},
\param{const wxString\&
}{value
}}
1224 Replaces the content in the specified range with the string specified by
{\it value
}.
1226 \membersection{wxRichTextCtrl::SaveFile
}\label{wxrichtextctrlsavefile
}
1228 \func{bool
}{SaveFile
}{\param{const wxString\&
}{file = wxEmptyString
},
\param{int
}{type = wxRICHTEXT
\_TYPE\_ANY}}
1230 Saves the buffer content using the given type. If the specified type
1231 is wxRICHTEXT
\_TYPE\_ANY, the type is deduced from the filename extension.
1233 This function looks for a suitable
\helpref{wxRichTextFileHandler
}{wxrichtextfilehandler
} object.
1235 \membersection{wxRichTextCtrl::ScrollIntoView
}\label{wxrichtextctrlscrollintoview
}
1237 \func{bool
}{ScrollIntoView
}{\param{long
}{position
},
\param{int
}{keyCode
}}
1239 Scrolls
{\it position
} into view. This function takes a caret position.
1241 \membersection{wxRichTextCtrl::SelectAll
}\label{wxrichtextctrlselectall
}
1243 \func{void
}{SelectAll
}{\void}
1245 Selects all the text in the buffer.
1247 \membersection{wxRichTextCtrl::SelectNone
}\label{wxrichtextctrlselectnone
}
1249 \func{void
}{SelectNone
}{\void}
1251 Cancels any selection.
1253 \membersection{wxRichTextCtrl::SetAndShowDefaultStyle
}\label{wxrichtextctrlsetandshowdefaultstyle
}
1255 \func{void
}{SetAndShowDefaultStyle
}{\param{const wxRichTextAttr\&
}{attr
}}
1257 Sets
{\it attr
} as the default style and tells the control that the UI should reflect
1258 this attribute until the user moves the caret.
1260 See also
\helpref{IsDefaultStyleShowing
}{wxrichtextctrlisdefaultstyleshowing
}.
1262 \membersection{wxRichTextCtrl::SetBasicStyle
}\label{wxrichtextctrlsetbasicstyle
}
1264 \func{void
}{SetBasicStyle
}{\param{const wxRichTextAttr\&
}{style
}}
1266 \func{void
}{SetBasicStyle
}{\param{const wxTextAttrEx\&
}{style
}}
1268 Sets the basic (overall) style. This is the style of the whole
1269 buffer before further styles are applied, unlike the default style, which
1270 only affects the style currently being applied (for example, setting the default
1271 style to bold will cause subsequently inserted text to be bold).
1273 \membersection{wxRichTextCtrl::SetCaretPosition
}\label{wxrichtextctrlsetcaretposition
}
1275 \func{void
}{SetCaretPosition
}{\param{long
}{position
},
\param{bool
}{showAtLineStart = false
}}
1277 The caret position is the character position just before the caret.
1278 A value of -
1 means the caret is at the start of the buffer.
1280 \membersection{wxRichTextCtrl::SetDefaultStyle
}\label{wxrichtextctrlsetdefaultstyle
}
1282 \func{bool
}{SetDefaultStyle
}{\param{const wxTextAttrEx\&
}{style
}}
1284 Sets the current default style, which can be used to change how subsequently inserted
1287 \membersection{wxRichTextCtrl::SetDefaultStyleToCursorStyle
}\label{wxrichtextctrlsetdefaultstyletocursorstyle
}
1289 \func{bool
}{SetDefaultStyleToCursorStyle
}{\void}
1291 Sets the default style to the style under the cursor.
1293 \membersection{wxRichTextCtrl::SetDelayedLayoutThreshold
}\label{wxrichtextctrlsetdelayedlayoutthreshold
}
1295 \func{void
}{SetDelayedLayoutThreshold
}{\param{long
}{threshold
}}
1297 Sets the size of the buffer beyond which layout is delayed during resizing.
1298 This optimizes sizing for large buffers. The default is
20000.
1300 \membersection{wxRichTextCtrl::SetEditable
}\label{wxrichtextctrlseteditable
}
1302 \func{void
}{SetEditable
}{\param{bool
}{editable
}}
1304 Makes the control editable, or not.
1306 \membersection{wxRichTextCtrl::SetFilename
}\label{wxrichtextctrlsetfilename
}
1308 \func{void
}{SetFilename
}{\param{const wxString\&
}{filename
}}
1310 Sets the current filename.
1312 \membersection{wxRichTextCtrl::SetFont
}\label{wxrichtextctrlsetfont
}
1314 \func{bool
}{SetFont
}{\param{const wxFont\&
}{font
}}
1316 Sets the font, and also the basic and default attributes (see
\helpref{SetDefaultStyle
}{wxrichtextctrlsetdefaultstyle
}).
1318 \membersection{wxRichTextCtrl::SetHandlerFlags
}\label{wxrichtextctrlsethandlerflags
}
1320 \func{void
}{SetHandlerFlags
}{\param{int
}{flags
}}
1322 Sets flags that change the behaviour of loading or saving. See the documentation for each
1323 handler class to see what flags are relevant for each handler.
1325 \membersection{wxRichTextCtrl::SetInsertionPoint
}\label{wxrichtextctrlsetinsertionpoint
}
1327 \func{void
}{SetInsertionPoint
}{\param{long
}{pos
}}
1329 Sets the insertion point.
1331 \membersection{wxRichTextCtrl::SetInsertionPointEnd
}\label{wxrichtextctrlsetinsertionpointend
}
1333 \func{void
}{SetInsertionPointEnd
}{\void}
1335 Sets the insertion point to the end of the text control.
1337 \membersection{wxRichTextCtrl::SetListStyle
}\label{wxrichtextctrlsetliststyle
}
1339 \func{bool
}{SetListStyle
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextListStyleDefinition*
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO},
\param{int
}{ startFrom = -
1},
\param{int
}{ listLevel = -
1}}
1341 \func{bool
}{SetListStyle
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxString\&
}{styleName
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO},
\param{int
}{ startFrom = -
1},
\param{int
}{ listLevel = -
1}}
1343 Sets the list attributes for the given range, passing flags to determine how the attributes are set.
1344 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1346 {\it flags
} is a bit list of the following:
1348 \begin{itemize
}\itemsep=
0pt
1349 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1350 \item wxRICHTEXT
\_SETSTYLE\_RENUMBER: specifies that numbering should start from
{\it startFrom
}, otherwise existing attributes are used.
1351 \item wxRICHTEXT
\_SETSTYLE\_SPECIFY\_LEVEL: specifies that
{\it listLevel
} should be used as the level for all paragraphs, otherwise the current indentation will be used.
1354 See also
\helpref{wxRichTextCtrl::NumberList
}{wxrichtextctrlnumberlist
},
\helpref{wxRichTextCtrl::PromoteList
}{wxrichtextctrlpromotelist
},
\helpref{wxRichTextCtrl::ClearListStyle
}{wxrichtextctrlclearliststyle
}.
1356 \membersection{wxRichTextCtrl::SetSelection
}\label{wxrichtextctrlsetselection
}
1358 \func{void
}{SetSelection
}{\param{long
}{from
},
\param{long
}{to
}}
1360 Sets the selection to the given range.
1362 The end point of range is specified as the last character position of the span of text, plus one.
1363 So, for example, to set the selection for a character at position
5, use the range (
5,
6).
1365 \membersection{wxRichTextCtrl::SetSelectionRange
}\label{wxrichtextctrlsetselectionrange
}
1367 \func{void
}{SetSelectionRange
}{\param{const wxRichTextRange\&
}{range
}}
1369 Sets the selection to the given range.
1371 The end point of range is specified as the last character position of the span of text, plus one.
1372 So, for example, to set the selection for a character at position
5, use the range (
5,
6).
1374 \membersection{wxRichTextCtrl::SetStyle
}\label{wxrichtextctrlsetstyle
}
1376 \func{bool
}{SetStyle
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
}}
1378 \func{bool
}{SetStyle
}{\param{long
}{start
},
\param{long
}{end
},
\param{const wxTextAttrEx\&
}{style
}}
1380 \func{bool
}{SetStyle
}{\param{long
}{start
},
\param{long
}{end
},
\param{const wxTextAttr\&
}{style
}}
1382 Sets the attributes for the given range. The wxRichTextAttr version is more efficient
1383 because it does not use wxFont objects.
1385 The end point of range is specified as the last character position of the span of text, plus one.
1386 So, for example, to set the style for a character at position
5, use the range (
5,
6).
1388 \membersection{wxRichTextCtrl::SetStyleEx
}\label{wxrichtextctrlsetstyleex
}
1390 \func{bool
}{SetStyleEx
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
1392 \func{bool
}{SetStyleEx
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxTextAttrEx\&
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
1394 \func{bool
}{SetStyleEx
}{\param{long
}{start
},
\param{long
}{end
},
\param{const wxTextAttrEx\&
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
1396 Sets the attributes for the given range, passing flags to determine how the attributes are set. The wxRichTextAttr version is more efficient
1397 because it does not use wxFont objects.
1399 The end point of range is specified as the last character position of the span of text, plus one.
1400 So, for example, to set the style for a character at position
5, use the range (
5,
6).
1402 {\it flags
} may contain a bit list of the following values:
1404 \begin{itemize
}\itemsep=
0pt
1405 \item wxRICHTEXT
\_SETSTYLE\_NONE: no style flag.
1406 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this operation should be undoable.
1407 \item wxRICHTEXT
\_SETSTYLE\_OPTIMIZE: specifies that the style should not be applied if the
1408 combined style at this point is already the style in question.
1409 \item wxRICHTEXT
\_SETSTYLE\_PARAGRAPHS\_ONLY: specifies that the style should only be applied to paragraphs,
1410 and not the content. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
1411 \item wxRICHTEXT
\_SETSTYLE\_CHARACTERS\_ONLY: specifies that the style should only be applied to characters,
1412 and not the paragraph. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
1413 \item wxRICHTEXT
\_SETSTYLE\_RESET: resets (clears) the existing style before applying the new style.
1414 \item wxRICHTEXT
\_SETSTYLE\_REMOVE: removes the specified style. Only the style flags are used in this operation.
1417 \membersection{wxRichTextCtrl::SetStyleSheet
}\label{wxrichtextctrlsetstylesheet
}
1419 \func{void
}{SetStyleSheet
}{\param{wxRichTextStyleSheet*
}{styleSheet
}}
1421 Sets the style sheet associated with the control. A style sheet allows named
1422 character and paragraph styles to be applied.
1424 \membersection{wxRichTextCtrl::SetValue
}\label{wxrichtextctrlsetvalue
}
1426 \func{void
}{SetValue
}{\param{const wxString\&
}{value
}}
1428 Replaces existing content with the given text.
1430 \membersection{wxRichTextCtrl::SetupScrollbars
}\label{wxrichtextctrlsetupscrollbars
}
1432 \func{void
}{SetupScrollbars
}{\param{bool
}{atTop = false
}}
1434 A helper function setting up scrollbars, for example after a resize.
1436 \membersection{wxRichTextCtrl::ShowPosition
}\label{wxrichtextctrlshowposition
}
1438 \func{void
}{ShowPosition
}{\param{long
}{pos
}}
1440 Scrolls the buffer so that the given position is in view.
1442 \membersection{wxRichTextCtrl::SuppressingUndo
}\label{wxrichtextctrlsuppressingundo
}
1444 \constfunc{bool
}{SuppressingUndo
}{\void}
1446 Returns
\true if undo history suppression is on.
1448 \membersection{wxRichTextCtrl::Thaw
}\label{wxrichtextctrlthaw
}
1450 \func{void
}{Thaw
}{\void}
1452 Call this function to end a Freeze and refresh the display.
1454 \membersection{wxRichTextCtrl::Undo
}\label{wxrichtextctrlundo
}
1456 \func{void
}{Undo
}{\void}
1458 Undoes the command at the top of the command history, if there is one.
1460 \membersection{wxRichTextCtrl::WordLeft
}\label{wxrichtextctrlwordleft
}
1462 \func{bool
}{WordLeft
}{\param{int
}{noWords =
1},
\param{int
}{flags =
0}}
1464 Moves a number of words to the left.
1466 \membersection{wxRichTextCtrl::WordRight
}\label{wxrichtextctrlwordright
}
1468 \func{bool
}{WordRight
}{\param{int
}{noWords =
1},
\param{int
}{flags =
0}}
1470 Move a nuber of words to the right.
1472 \membersection{wxRichTextCtrl::WriteImage
}\label{wxrichtextctrlwriteimage
}
1474 \func{bool
}{WriteImage
}{\param{const wxString\&
}{filename
},
\param{int
}{bitmapType
}}
1476 Loads an image from a file and writes it at the current insertion point.
1478 \func{bool
}{WriteImage
}{\param{const wxRichTextImageBlock\&
}{imageBlock
}}
1480 Writes an image block at the current insertion point.
1482 \func{bool
}{WriteImage
}{\param{const wxBitmap\&
}{bitmap
},
\param{int
}{bitmapType = wxBITMAP
\_TYPE\_PNG}}
1484 \func{bool
}{WriteImage
}{\param{const wxImage\&
}{image
},
\param{int
}{bitmapType = wxBITMAP
\_TYPE\_PNG}}
1486 Write a bitmap or image at the current insertion point. Supply an optional type to use
1487 for internal and file storage of the raw data.
1489 \membersection{wxRichTextCtrl::WriteText
}\label{wxrichtextctrlwritetext
}
1491 \func{void
}{WriteText
}{\param{const wxString\&
}{text
}}
1493 Writes text at the current position.
1495 \membersection{wxRichTextCtrl::XYToPosition
}\label{wxrichtextctrlxytoposition
}
1497 \constfunc{long
}{XYToPosition
}{\param{long
}{x
},
\param{long
}{y
}}
1499 Translates from column and line number to position.