\section{\class{wxRichTextCtrl}}\label{wxrichtextctrl}

wxRichTextCtrl provides a generic, ground-up implementation of a text control
capable of showing multiple styles and images.

wxRichTextCtrl sends notification events: see \helpref{wxRichTextEvent}{wxrichtextevent}.
It also sends the standard wxTextCtrl events wxEVT\_COMMAND\_TEXT\_ENTER and wxEVT\_COMMAND\_TEXT\_UPDATED,
and wxTextUrlEvent when URL content is clicked.

For more information, see the \helpref{wxRichTextCtrl overview}{wxrichtextctrloverview}.

\wxheading{Derived from}

wxTextCtrlBase

\wxheading{Include files}

<wx/richtext/richtextctrl.h>

\wxheading{Data structures}

\latexignore{\rtfignore{\wxheading{Members}}}

\membersection{wxRichTextCtrl::wxRichTextCtrl}\label{wxrichtextctrlwxrichtextctrl}

\func{}{wxRichTextCtrl}{\void}

\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},
 \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxTextCtrlNameStr}}

Constructors.

\membersection{wxRichTextCtrl::\destruct{wxRichTextCtrl}}\label{wxrichtextctrldtor}

\func{}{\destruct{wxRichTextCtrl}}{\void}

Destructor.

\membersection{wxRichTextCtrl::AddImage}\label{wxrichtextctrladdimage}

\func{wxRichTextRange}{AddImage}{\param{const wxImage\& }{image}}

Adds an image to the control's buffer.

\membersection{wxRichTextCtrl::AddParagraph}\label{wxrichtextctrladdparagraph}

\func{wxRichTextRange}{AddParagraph}{\param{const wxString\& }{text}}

Adds a new paragraph of text to the end of the buffer.

\membersection{wxRichTextCtrl::AppendText}\label{wxrichtextctrlappendtext}

\func{void}{AppendText}{\param{const wxString\& }{text}}

Sets the insertion point to the end of the buffer and writes the text.

\membersection{wxRichTextCtrl::ApplyAlignmentToSelection}\label{wxrichtextctrlapplyalignmenttoselection}

\func{bool}{ApplyAlignmentToSelection}{\param{wxTextAttrAlignment }{alignment}}

Applies the given alignment to the selection (undoable).

For alignment values, see \helpref{wxTextAttrEx}{wxtextattrex}.

\membersection{wxRichTextCtrl::ApplyBoldToSelection}\label{wxrichtextctrlapplyboldtoselection}

\func{bool}{ApplyBoldToSelection}{\void}

Apples bold to the selection (undoable).

\membersection{wxRichTextCtrl::ApplyItalicToSelection}\label{wxrichtextctrlapplyitalictoselection}

\func{bool}{ApplyItalicToSelection}{\void}

Applies italic to the selection (undoable).

\membersection{wxRichTextCtrl::ApplyStyle}\label{wxrichtextctrlapplystyle}

\func{bool}{ApplyStyle}{\param{wxRichTextStyleDefinition*}{ def}}

Applies the given style to the selection.

\membersection{wxRichTextCtrl::ApplyStyleSheet}\label{wxrichtextctrlapplystylesheet}

\func{bool}{ApplyStyleSheet}{\param{wxRichTextStyleSheet*}{ sheet $=$ NULL}}

Applies the style sheet to the buffer, matching paragraph styles in the sheet against named styles
in the buffer. This might be useful if the styles have changed. If {\it sheet} is NULL, the
sheet set with SetStyleSheet is used.

Currently this applies paragraph styles only.

\membersection{wxRichTextCtrl::ApplyUnderlineToSelection}\label{wxrichtextctrlapplyunderlinetoselection}

\func{bool}{ApplyUnderlineToSelection}{\void}

Applies underline to the selection (undoable).

\membersection{wxRichTextCtrl::BatchingUndo}\label{wxrichtextctrlbatchingundo}

\constfunc{bool}{BatchingUndo}{\void}

Returns \true if undo commands are being batched.

\membersection{wxRichTextCtrl::BeginAlignment}\label{wxrichtextctrlbeginalignment}

\func{bool}{BeginAlignment}{\param{wxTextAttrAlignment }{alignment}}

Begins using alignment

For alignment values, see \helpref{wxTextAttrEx}{wxtextattrex}.

\membersection{wxRichTextCtrl::BeginBatchUndo}\label{wxrichtextctrlbeginbatchundo}

\func{bool}{BeginBatchUndo}{\param{const wxString\& }{cmdName}}

Starts batching undo history for commands.

\membersection{wxRichTextCtrl::BeginBold}\label{wxrichtextctrlbeginbold}

\func{bool}{BeginBold}{\void}

Begins using bold.

\membersection{wxRichTextCtrl::BeginCharacterStyle}\label{wxrichtextctrlbegincharacterstyle}

\func{bool}{BeginCharacterStyle}{\param{const wxString\& }{characterStyle}}

Begins using the named character style.

\membersection{wxRichTextCtrl::BeginFont}\label{wxrichtextctrlbeginfont}

\func{bool}{BeginFont}{\param{const wxFont\& }{font}}

Begins using this font.

\membersection{wxRichTextCtrl::BeginFontSize}\label{wxrichtextctrlbeginfontsize}

\func{bool}{BeginFontSize}{\param{int }{pointSize}}

Begins using the given point size.

\membersection{wxRichTextCtrl::BeginItalic}\label{wxrichtextctrlbeginitalic}

\func{bool}{BeginItalic}{\void}

Begins using italic.

\membersection{wxRichTextCtrl::BeginLeftIndent}\label{wxrichtextctrlbeginleftindent}

\func{bool}{BeginLeftIndent}{\param{int }{leftIndent}, \param{int }{leftSubIndent = 0}}

Begins applying a left indent and subindent in tenths of a millimetre.

The sub-indent is an offset from the left of the paragraph, and is used for all but the
first line in a paragraph. A positive value will cause the first line to appear to the left
of the subsequent lines, and a negative value will cause the first line to be indented
relative to the subsequent lines.

wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
the margin and the bullet. The content of the paragraph, including the first line, starts
at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
left of the actual paragraph is leftSubIndent.

\membersection{wxRichTextCtrl::BeginLineSpacing}\label{wxrichtextctrlbeginlinespacing}

\func{bool}{BeginLineSpacing}{\param{int }{lineSpacing}}

Begins appling line spacing. {\it spacing} is a multiple, where 10 means single-spacing,
15 means 1.5 spacing, and 20 means double spacing. The following constants are
defined for convenience:

{\small
\begin{verbatim}
#define wxTEXT_ATTR_LINE_SPACING_NORMAL         10
#define wxTEXT_ATTR_LINE_SPACING_HALF           15
#define wxTEXT_ATTR_LINE_SPACING_TWICE          20
\end{verbatim}
}

\membersection{wxRichTextCtrl::BeginListStyle}\label{wxrichtextctrlbeginliststyle}

\func{bool}{BeginListStyle}{\param{const wxString\&}{ listStyle}, \param{int}{ level=1}, \param{int}{ number=1}}

Begins using a specified list style. Optionally, you can also pass a level and a number.

\membersection{wxRichTextCtrl::BeginNumberedBullet}\label{wxrichtextctrlbeginnumberedbullet}

\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}}

Begins a numbered bullet. This call will be needed for each item in the list, and the
application should take care of incrementing the numbering.

{\it bulletNumber} is a number, usually starting with 1.

{\it leftIndent} and {\it leftSubIndent} are values in tenths of a millimetre.

{\it bulletStyle} is a bitlist of the following values:

{\small
\begin{verbatim}
#define wxTEXT_ATTR_BULLET_STYLE_NONE               0x00000000
#define wxTEXT_ATTR_BULLET_STYLE_ARABIC             0x00000001
#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER      0x00000002
#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER      0x00000004
#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER        0x00000008
#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER        0x00000010
#define wxTEXT_ATTR_BULLET_STYLE_SYMBOL             0x00000020
#define wxTEXT_ATTR_BULLET_STYLE_BITMAP             0x00000040
#define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES        0x00000080
#define wxTEXT_ATTR_BULLET_STYLE_PERIOD             0x00000100
#define wxTEXT_ATTR_BULLET_STYLE_STANDARD           0x00000200
#define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS  0x00000400
#define wxTEXT_ATTR_BULLET_STYLE_OUTLINE            0x00000800
#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT         0x00000000
#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT        0x00001000
#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE       0x00002000
\end{verbatim}
}

wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
the margin and the bullet. The content of the paragraph, including the first line, starts
at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
left of the actual paragraph is leftSubIndent.

\membersection{wxRichTextCtrl::BeginParagraphSpacing}\label{wxrichtextctrlbeginparagraphspacing}

\func{bool}{BeginParagraphSpacing}{\param{int }{before}, \param{int }{after}}

Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of
a millimetre.

\membersection{wxRichTextCtrl::BeginParagraphStyle}\label{wxrichtextctrlbeginparagraphstyle}

\func{bool}{BeginParagraphStyle}{\param{const wxString\& }{paragraphStyle}}

Begins applying the named paragraph style.

\membersection{wxRichTextCtrl::BeginRightIndent}\label{wxrichtextctrlbeginrightindent}

\func{bool}{BeginRightIndent}{\param{int }{rightIndent}}

Begins a right indent, specified in tenths of a millimetre.

\membersection{wxRichTextCtrl::BeginStyle}\label{wxrichtextctrlbeginstyle}

\func{bool}{BeginStyle}{\param{const wxTextAttrEx\& }{style}}

Begins applying a style.

\membersection{wxRichTextCtrl::BeginSuppressUndo}\label{wxrichtextctrlbeginsuppressundo}

\func{bool}{BeginSuppressUndo}{\void}

Starts suppressing undo history for commands.

\membersection{wxRichTextCtrl::BeginSymbolBullet}\label{wxrichtextctrlbeginsymbolbullet}

\func{bool}{BeginSymbolBullet}{\param{wxChar }{symbol}, \param{int }{leftIndent}, \param{int }{leftSubIndent}, \param{int }{bulletStyle = wxTEXT\_ATTR\_BULLET\_STYLE\_SYMBOL}}

Begins applying a symbol bullet, using a character from the current font. See \helpref{BeginNumberedBullet}{wxrichtextctrlbeginnumberedbullet} for
an explanation of how indentation is used to render the bulleted paragraph.

\membersection{wxRichTextCtrl::BeginTextColour}\label{wxrichtextctrlbegintextcolour}

\func{bool}{BeginTextColour}{\param{const wxColour\& }{colour}}

Begins using this colour.

\membersection{wxRichTextCtrl::BeginUnderline}\label{wxrichtextctrlbeginunderline}

\func{bool}{BeginUnderline}{\void}

Begins using underlining.

\membersection{wxRichTextCtrl::BeginURL}\label{wxrichtextctrlbeginurl}

\func{bool}{BeginURL}{\param{const wxString\&}{ url}, \param{const wxString\&}{ characterStyle = wxEmptyString}}

Begins applying wxTEXT\_ATTR\_URL to the content. Pass a URL and optionally, a character style to apply,
since it is common to mark a URL with a familiar style such as blue text with underlining.

\membersection{wxRichTextCtrl::CanCopy}\label{wxrichtextctrlcancopy}

\constfunc{bool}{CanCopy}{\void}

Returns \true if selected content can be copied to the clipboard.

\membersection{wxRichTextCtrl::CanCut}\label{wxrichtextctrlcancut}

\constfunc{bool}{CanCut}{\void}

Returns \true if selected content can be copied to the clipboard and deleted.

\membersection{wxRichTextCtrl::CanDeleteSelection}\label{wxrichtextctrlcandeleteselection}

\constfunc{bool}{CanDeleteSelection}{\void}

Returns \true if selected content can be deleted.

\membersection{wxRichTextCtrl::CanPaste}\label{wxrichtextctrlcanpaste}

\constfunc{bool}{CanPaste}{\void}

Returns \true if the clipboard content can be pasted to the buffer.

\membersection{wxRichTextCtrl::CanRedo}\label{wxrichtextctrlcanredo}

\constfunc{bool}{CanRedo}{\void}

Returns \true if there is a command in the command history that can be redone.

\membersection{wxRichTextCtrl::CanUndo}\label{wxrichtextctrlcanundo}

\constfunc{bool}{CanUndo}{\void}

Returns \true if there is a command in the command history that can be undone.

\membersection{wxRichTextCtrl::Clear}\label{wxrichtextctrlclear}

\func{void}{Clear}{\void}

Clears the buffer content, leaving a single empty paragraph. Cannot be undone.

\membersection{wxRichTextCtrl::ClearListStyle}\label{wxrichtextctrlclearliststyle}

\func{bool}{ClearListStyle}{\param{const wxRichTextRange\& }{range}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}

\func{bool}{ClearListStyle}{\param{const wxRichTextRange\& }{range}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}

Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph.

{\it flags} is a bit list of the following:

\begin{itemize}\itemsep=0pt
\item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
\end{itemize}

See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlsetliststyle}, \helpref{wxRichTextCtrl::PromoteList}{wxrichtextctrlpromotelist}, \helpref{wxRichTextCtrl::NumberList}{wxrichtextctrlnumberlist}.

\membersection{wxRichTextCtrl::Command}\label{wxrichtextctrlcommand}

\func{void}{Command}{\param{wxCommandEvent\& }{event}}

Sends the event to the control.

\membersection{wxRichTextCtrl::Copy}\label{wxrichtextctrlcopy}

\func{void}{Copy}{\void}

Copies the selected content (if any) to the clipboard.

\membersection{wxRichTextCtrl::Create}\label{wxrichtextctrlcreate}

\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},
 \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxTextCtrlNameStr}}

Creates the underlying window.

\membersection{wxRichTextCtrl::Cut}\label{wxrichtextctrlcut}

\func{void}{Cut}{\void}

Copies the selected content (if any) to the clipboard and deletes the selection.
This is undoable.

\membersection{wxRichTextCtrl::Delete}\label{wxrichtextctrldelete}

\func{bool}{Delete}{\param{const wxRichTextRange\&}{ range}}

Deletes the content within the given range.

\membersection{wxRichTextCtrl::DeleteSelectedContent}\label{wxrichtextctrldeleteselectedcontent}

\func{bool}{DeleteSelectedContent}{\param{long* }{newPos = NULL}}

Deletes content if there is a selection, e.g. when pressing a key.
Returns the new caret position in {\it newPos}, or leaves it if there
was no action. This is undoable.

\membersection{wxRichTextCtrl::DeleteSelection}\label{wxrichtextctrldeleteselection}

\func{void}{DeleteSelection}{\void}

Deletes the content in the selection, if any. This is undoable.

\membersection{wxRichTextCtrl::DiscardEdits}\label{wxrichtextctrldiscardedits}

\func{void}{DiscardEdits}{\void}

Sets the buffer's modified status to \false, and clears the buffer's command history.

\membersection{wxRichTextCtrl::DoGetBestSize}\label{wxrichtextctrldogetbestsize}

\constfunc{wxSize}{DoGetBestSize}{\void}

Currently this simply returns {\tt wxSize(10, 10)}.

\membersection{wxRichTextCtrl::EndAlignment}\label{wxrichtextctrlendalignment}

\func{bool}{EndAlignment}{\void}

Ends alignment.

\membersection{wxRichTextCtrl::EndAllStyles}\label{wxrichtextctrlendallstyles}

\func{bool}{EndAllStyles}{\void}

Ends application of all styles in the current style stack.

\membersection{wxRichTextCtrl::EndBatchUndo}\label{wxrichtextctrlendbatchundo}

\func{bool}{EndBatchUndo}{\void}

Ends batching undo command history.

\membersection{wxRichTextCtrl::EndBold}\label{wxrichtextctrlendbold}

\func{bool}{EndBold}{\void}

Ends using bold.

\membersection{wxRichTextCtrl::EndCharacterStyle}\label{wxrichtextctrlendcharacterstyle}

\func{bool}{EndCharacterStyle}{\void}

Ends application of a named character style.

\membersection{wxRichTextCtrl::EndFont}\label{wxrichtextctrlendfont}

\func{bool}{EndFont}{\void}

Ends using a font.

\membersection{wxRichTextCtrl::EndFontSize}\label{wxrichtextctrlendfontsize}

\func{bool}{EndFontSize}{\void}

Ends using a point size.

\membersection{wxRichTextCtrl::EndItalic}\label{wxrichtextctrlenditalic}

\func{bool}{EndItalic}{\void}

Ends using italic.

\membersection{wxRichTextCtrl::EndLeftIndent}\label{wxrichtextctrlendleftindent}

\func{bool}{EndLeftIndent}{\void}

Ends left indent.

\membersection{wxRichTextCtrl::EndLineSpacing}\label{wxrichtextctrlendlinespacing}

\func{bool}{EndLineSpacing}{\void}

Ends line spacing.

\membersection{wxRichTextCtrl::EndListStyle}\label{wxrichtextctrlendliststyle}

\func{bool}{EndListStyle}{\void}

Ends using a specified list style.

\membersection{wxRichTextCtrl::EndNumberedBullet}\label{wxrichtextctrlendnumberedbullet}

\func{bool}{EndNumberedBullet}{\void}

Ends application of a numbered bullet.

\membersection{wxRichTextCtrl::EndParagraphSpacing}\label{wxrichtextctrlendparagraphspacing}

\func{bool}{EndParagraphSpacing}{\void}

Ends paragraph spacing.

\membersection{wxRichTextCtrl::EndParagraphStyle}\label{wxrichtextctrlendparagraphstyle}

\func{bool}{EndParagraphStyle}{\void}

Ends application of a named character style.

\membersection{wxRichTextCtrl::EndRightIndent}\label{wxrichtextctrlendrightindent}

\func{bool}{EndRightIndent}{\void}

Ends right indent.

\membersection{wxRichTextCtrl::EndStyle}\label{wxrichtextctrlendstyle}

\func{bool}{EndStyle}{\void}

Ends the current style.

\membersection{wxRichTextCtrl::EndSuppressUndo}\label{wxrichtextctrlendsuppressundo}

\func{bool}{EndSuppressUndo}{\void}

Ends suppressing undo command history.

\membersection{wxRichTextCtrl::EndSymbolBullet}\label{wxrichtextctrlendsymbolbullet}

\func{bool}{EndSymbolBullet}{\void}

Ends applying a symbol bullet.

\membersection{wxRichTextCtrl::EndTextColour}\label{wxrichtextctrlendtextcolour}

\func{bool}{EndTextColour}{\void}

Ends applying a text colour.

\membersection{wxRichTextCtrl::EndUnderline}\label{wxrichtextctrlendunderline}

\func{bool}{EndUnderline}{\void}

End applying underlining.

\membersection{wxRichTextCtrl::EndURL}\label{wxrichtextctrlendurl}

\func{bool}{EndURL}{\void}

Ends applying a URL.

\membersection{wxRichTextCtrl::ExtendSelection}\label{wxrichtextctrlextendselection}

\func{bool}{ExtendSelection}{\param{long }{oldPosition}, \param{long }{newPosition}, \param{int }{flags}}

Helper function for extending the selection, returning \true if the selection was
changed. Selections are in caret positions.

\membersection{wxRichTextCtrl::FindNextWordPosition}\label{wxrichtextctrlfindnextwordposition}

\constfunc{long}{FindNextWordPosition}{\param{int }{direction = 1}}

Helper function for finding the caret position for the next word. Direction
is 1 (forward) or -1 (backwards).

\membersection{wxRichTextCtrl::Freeze}\label{wxrichtextctrlfreeze}

\func{void}{Freeze}{\void}

Call this function to prevent refresh and allow fast updates, and then \helpref{Thaw}{wxrichtextctrlthaw} to
refresh the control.

\membersection{wxRichTextCtrl::GetBasicStyle}\label{wxrichtextctrlgetbasicstyle}

\constfunc{const wxTextAttrEx\&}{GetBasicStyle}{\void}

Gets the basic (overall) style. This is the style of the whole
buffer before further styles are applied, unlike the default style, which
only affects the style currently being applied (for example, setting the default
style to bold will cause subsequently inserted text to be bold).

\membersection{wxRichTextCtrl::GetBuffer}\label{wxrichtextctrlgetbuffer}

\constfunc{const wxRichTextBuffer\&}{GetBuffer}{\void}

\func{wxRichTextBuffer\&}{GetBuffer}{\void}

Returns the buffer associated with the control.

\membersection{wxRichTextCtrl::GetCaretPosition}\label{wxrichtextctrlgetcaretposition}

\constfunc{long}{GetCaretPosition}{\void}

Returns the current caret position.

\membersection{wxRichTextCtrl::GetCaretPositionForIndex}\label{wxrichtextctrlgetcaretpositionforindex}

\func{bool}{GetCaretPositionForIndex}{\param{long }{position}, \param{wxRect\& }{rect}}

Returns the caret height and position for the given character position

\membersection{wxRichTextCtrl::GetCommandProcessor}\label{wxrichtextctrlgetcommandprocessor}

\constfunc{wxCommandProcessor*}{GetCommandProcessor}{\void}

Gets the command processor associated with the control's buffer.

\membersection{wxRichTextCtrl::GetDefaultStyleEx}\label{wxrichtextctrlgetdefaultstyleex}

\constfunc{const wxTextAttrEx\&}{GetDefaultStyleEx}{\void}

Returns the current default style, which can be used to change how subsequently inserted
text is displayed. When wxTextAttrEx is merged with wxTextAttr, this function
will become GetDefaultStyle.

\membersection{wxRichTextCtrl::GetDelayedLayoutThreshold}\label{wxrichtextctrlgetdelayedlayoutthreshold}

\constfunc{long}{GetDelayedLayoutThreshold}{\void}

Gets the size of the buffer beyond which layout is delayed during resizing.
This optimizes sizing for large buffers. The default is 20000.

\membersection{wxRichTextCtrl::GetFilename}\label{wxrichtextctrlgetfilename}

\constfunc{wxString}{GetFilename}{\void}

Gets the current filename associated with the control.

\membersection{wxRichTextCtrl::GetFirstVisiblePosition}\label{wxrichtextctrlgetfirstvisibleposition}

\constfunc{long}{GetFirstVisiblePosition}{\void}

Returns the first visible position in the current view.

\membersection{wxRichTextCtrl::GetHandlerFlags}\label{wxrichtextfilehandlergethandlerflags}

\constfunc{int}{GetHandlerFlags}{\void}

Returns flags that change the behaviour of loading or saving. See the documentation for each
handler class to see what flags are relevant for each handler.

\membersection{wxRichTextCtrl::GetInsertionPoint}\label{wxrichtextctrlgetinsertionpoint}

\constfunc{long}{GetInsertionPoint}{\void}

Returns the current insertion point.

\membersection{wxRichTextCtrl::GetLastPosition}\label{wxrichtextctrlgetlastposition}

\constfunc{wxTextPos}{GetLastPosition}{\void}

Returns the last position in the buffer.

\membersection{wxRichTextCtrl::GetLineLength}\label{wxrichtextctrlgetlinelength}

\constfunc{int}{GetLineLength}{\param{long }{lineNo}}

Returns the length of the specified line in characters.

\membersection{wxRichTextCtrl::GetLineText}\label{wxrichtextctrlgetlinetext}

\constfunc{wxString}{GetLineText}{\param{long }{lineNo}}

Returns the text for the given line.

\membersection{wxRichTextCtrl::GetLogicalPoint}\label{wxrichtextctrlgetlogicalpoint}

\constfunc{wxPoint}{GetLogicalPoint}{\param{const wxPoint\& }{ptPhysical}}

Transforms physical window position to logical (unscrolled) position.

\membersection{wxRichTextCtrl::GetNumberOfLines}\label{wxrichtextctrlgetnumberoflines}

\constfunc{int}{GetNumberOfLines}{\void}

Returns the number of lines in the buffer.

\membersection{wxRichTextCtrl::GetPhysicalPoint}\label{wxrichtextctrlgetphysicalpoint}

\constfunc{wxPoint}{GetPhysicalPoint}{\param{const wxPoint\& }{ptLogical}}

Transforms logical (unscrolled) position to physical window position.

\membersection{wxRichTextCtrl::GetRange}\label{wxrichtextctrlgetrange}

\constfunc{wxString}{GetRange}{\param{long }{from}, \param{long }{to}}

Gets the text for the given range.

The end point of range is specified as the last character position of the span of text, plus one.

\membersection{wxRichTextCtrl::GetSelection}\label{wxrichtextctrlgetselection}

\constfunc{void}{GetSelection}{\param{long* }{from}, \param{long* }{to}}

Returns the range of the current selection.

The end point of range is specified as the last character position of the span of text, plus one.

If the return values {\it from} and {\it to} are the same, there is no selection.

\membersection{wxRichTextCtrl::GetSelectionRange}\label{wxrichtextctrlgetselectionrange}

\constfunc{const wxRichTextRange\&}{GetSelectionRange}{\void}

Returns the selection range in character positions. -1, -1 means no selection.

\membersection{wxRichTextCtrl::GetStringSelection}\label{wxrichtextctrlgetstringselection}

\constfunc{wxString}{GetStringSelection}{\void}

Returns the text within the current selection range, if any.

\membersection{wxRichTextCtrl::GetStyle}\label{wxrichtextctrlgetstyle}

\func{bool}{GetStyle}{\param{long }{position}, \param{wxRichTextAttr\& }{style}}

\func{bool}{GetStyle}{\param{long }{position}, \param{wxTextAttrEx\& }{style}}

\func{bool}{GetStyle}{\param{long }{position}, \param{wxTextAttr\& }{style}}

Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
because it does not use wxFont objects.

This function gets the combined style - that is, the style you see on the screen as a result
of combining base style, paragraph style and character style attributes. To get the character
or paragraph style alone, use \helpref{GetUncombinedStyle}{wxrichtextctrlgetuncombinedstyle}.

\membersection{wxRichTextCtrl::GetStyleForRange}\label{wxrichtextctrlgetstyleforrange}

\func{bool}{GetStyleForRange}{\param{const wxRichTextRange\& }{range}, \param{wxRichTextAttr\& }{style}}

\func{bool}{GetStyleForRange}{\param{const wxRichTextRange\& }{range}, \param{wxTextAttrEx\& }{style}}

Gets the attributes common to the specified range. Attributes that differ in value within the range will
not be included in {\it style}'s flags.

\membersection{wxRichTextCtrl::GetStyleSheet}\label{wxrichtextctrlgetstylesheet}

\constfunc{wxRichTextStyleSheet*}{GetStyleSheet}{\void}

Returns the style sheet associated with the control, if any. A style sheet allows named
character and paragraph styles to be applied.

\membersection{wxRichTextCtrl::GetUncombinedStyle}\label{wxrichtextctrlgetuncombinedstyle}

\func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxRichTextAttr\& }{style}}

\func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxTextAttrEx\& }{style}}

\func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxTextAttr\& }{style}}

Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
because it does not use wxFont objects.

This function gets the {\it uncombined style} - that is, the attributes associated with the
paragraph or character content, and not necessarily the combined attributes you see on the
screen. To get the combined attributes, use \helpref{GetStyle}{wxrichtextctrlgetstyle}.

If you specify (any) paragraph attribute in {\it style}'s flags, this function will fetch
the paragraph attributes. Otherwise, it will return the character attributes.

\membersection{wxRichTextCtrl::GetValue}\label{wxrichtextctrlgetvalue}

\constfunc{wxString}{GetValue}{\void}

Returns the content of the entire control as a string.

\membersection{wxRichTextCtrl::GetVisibleLineForCaretPosition}\label{wxrichtextctrlgetvisiblelineforcaretposition}

\constfunc{wxRichTextLine*}{GetVisibleLineForCaretPosition}{\param{long }{caretPosition}}

Internal helper function returning the line for the visible caret position. If the caret is
shown at the very end of the line, it means the next character is actually
on the following line. So this function gets the line we're expecting to find
if this is the case.

\membersection{wxRichTextCtrl::HasCharacterAttributes}\label{wxrichtextctrlhascharacterattributes}

\constfunc{bool}{HasCharacterAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}}

\constfunc{bool}{HasCharacterAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}

Test if this whole range has character attributes of the specified kind. If any
of the attributes are different within the range, the test fails. You
can use this to implement, for example, bold button updating. {\it style} must have
flags indicating which attributes are of interest.

\membersection{wxRichTextCtrl::HasParagraphAttributes}\label{wxrichtextctrlhasparagraphattributes}

\constfunc{bool}{HasParagraphAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}}

\constfunc{bool}{HasParagraphAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}

Test if this whole range has paragraph attributes of the specified kind. If any
of the attributes are different within the range, the test fails. You
can use this to implement, for example, centering button updating. {\it style} must have
flags indicating which attributes are of interest.

\membersection{wxRichTextCtrl::HasSelection}\label{wxrichtextctrlhasselection}

\constfunc{bool}{HasSelection}{\void}

Returns \true if there is a selection.

\membersection{wxRichTextCtrl::HitTest}\label{wxrichtextctrlhittest}

\constfunc{wxTextCtrlHitTestResult}{HitTest}{\param{const wxPoint\& }{pt}, \param{long* }{pos}}

\constfunc{wxTextCtrlHitTestResult}{HitTest}{\param{const wxPoint\& }{pt}, \param{wxTextCoord* }{col}, \param{wxTextCoord* }{row}}

Finds the character at the given position in pixels.

{\it pt} is in device coords (not adjusted for the client area origin nor for scrolling).

\membersection{wxRichTextCtrl::Init}\label{wxrichtextctrlinit}

\func{void}{Init}{\void}

Initialises the members of the control.

\membersection{wxRichTextCtrl::InitCommandEvent}\label{wxrichtextctrlinitcommandevent}

\constfunc{void}{InitCommandEvent}{\param{wxCommandEvent\& }{event}}

Initialises the command event.

\membersection{wxRichTextCtrl::IsDefaultStyleShowing}\label{wxrichtextctrlisdefaultstyleshowing}

\constfunc{bool}{IsDefaultStyleShowing}{\void}

Returns \true if the user has recently set the default style without moving the caret,
and therefore the UI needs to reflect the default style and not the style at the caret.

Below is an example of code that uses this function to determine whether the UI
should show that the current style is bold.

\begin{verbatim}
/// Is all of the selection bold?
bool wxRichTextCtrl::IsSelectionBold()
{
    if (HasSelection())
    {
        wxRichTextAttr attr;
        wxRichTextRange range = GetInternalSelectionRange();
        attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
        attr.SetFontWeight(wxBOLD);

        return HasCharacterAttributes(range, attr);
    }
    else
    {
        // If no selection, then we need to combine current style with default style
        // to see what the effect would be if we started typing.
        wxRichTextAttr attr;
        attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);

        long pos = GetAdjustedCaretPosition(GetCaretPosition());
        if (GetStyle(pos, attr))
        {
            if (IsDefaultStyleShowing())
                wxRichTextApplyStyle(attr, GetDefaultStyleEx());
            return attr.GetFontWeight() == wxBOLD;
        }
    }
    return false;
}
\end{verbatim}

See also \helpref{SetAndShowDefaultStyle}{wxrichtextctrlsetandshowdefaultstyle}.

\membersection{wxRichTextCtrl::IsEditable}\label{wxrichtextctrliseditable}

\constfunc{bool}{IsEditable}{\void}

Returns \true if the control is editable.

\membersection{wxRichTextCtrl::IsFrozen}\label{wxrichtextctrlisfrozen}

\constfunc{bool}{IsFrozen}{\void}

Returns \true if Freeze has been called without a Thaw.

\membersection{wxRichTextCtrl::IsModified}\label{wxrichtextctrlismodified}

\constfunc{bool}{IsModified}{\void}

Returns \true if the buffer has been modified.

\membersection{wxRichTextCtrl::IsMultiLine}\label{wxrichtextctrlismultiline}

\constfunc{bool}{IsMultiLine}{\void}

Returns \true if the control is multiline.

\membersection{wxRichTextCtrl::IsPositionVisible}\label{wxrichtextctrlispositionvisible}

\constfunc{bool}{IsPositionVisible}{\param{long }{pos}}

Returns \true if the given position is visible on the screen.

\membersection{wxRichTextCtrl::IsSelectionAligned}\label{wxrichtextctrlisselectionaligned}

\constfunc{bool}{IsSelectionAligned}{\param{wxTextAttrAlignment }{alignment}}

Returns \true if all of the selection is aligned according to the specified flag.

\membersection{wxRichTextCtrl::IsSelectionBold}\label{wxrichtextctrlisselectionbold}

\constfunc{bool}{IsSelectionBold}{\void}

Returns \true if all of the selection is bold.

\membersection{wxRichTextCtrl::IsSelectionItalics}\label{wxrichtextctrlisselectionitalics}

\constfunc{bool}{IsSelectionItalics}{\void}

Returns \true if all of the selection is italic.

\membersection{wxRichTextCtrl::IsSelectionUnderlined}\label{wxrichtextctrlisselectionunderlined}

\constfunc{bool}{IsSelectionUnderlined}{\void}

Returns \true if all of the selection is underlined.

\membersection{wxRichTextCtrl::IsSingleLine}\label{wxrichtextctrlissingleline}

\constfunc{bool}{IsSingleLine}{\void}

Returns \true if the control is single-line. Currently wxRichTextCtrl does not
support single-line editing.

\membersection{wxRichTextCtrl::KeyboardNavigate}\label{wxrichtextctrlkeyboardnavigate}

\func{bool}{KeyboardNavigate}{\param{int }{keyCode}, \param{int }{flags}}

Helper function implementing keyboard navigation.

\membersection{wxRichTextCtrl::LayoutContent}\label{wxrichtextctrllayoutcontent}

\func{bool}{LayoutContent}{\param{bool }{onlyVisibleRect = false}}

Lays out the buffer, which must be done before certain operations, such as
setting the caret position. This function should not normally be required by the
application.

\membersection{wxRichTextCtrl::LineBreak}\label{wxrichtextctrllinebreak}

\func{bool}{LineBreak}{\void}

Inserts a line break at the current insertion point. A line break forces wrapping within a paragraph, and
can be introduced by using this function, by appending the wxChar value {\bf wxRichTextLineBreakChar} to text content,
or by typing Shift-Return.

\membersection{wxRichTextCtrl::LoadFile}\label{wxrichtextctrlloadfile}

\func{bool}{LoadFile}{\param{const wxString\& }{file}, \param{int }{type = wxRICHTEXT\_TYPE\_ANY}}

Loads content into the control's buffer using the given type. If the specified type
is wxRICHTEXT\_TYPE\_ANY, the type is deduced from the filename extension.

This function looks for a suitable \helpref{wxRichTextFileHandler}{wxrichtextfilehandler} object.

\membersection{wxRichTextCtrl::MarkDirty}\label{wxrichtextctrlmarkdirty}

\func{void}{MarkDirty}{\void}

Marks the buffer as modified.

\membersection{wxRichTextCtrl::MoveCaret}\label{wxrichtextctrlmovecaret}

\func{bool}{MoveCaret}{\param{long }{pos}, \param{bool }{showAtLineStart = false}}

Move the caret to the given character position.

\membersection{wxRichTextCtrl::MoveCaretBack}\label{wxrichtextctrlmovecaretback}

\func{void}{MoveCaretBack}{\param{long }{oldPosition}}

Move the caret one visual step forward: this may mean setting a flag
and keeping the same position if we're going from the end of one line
to the start of the next, which may be the exact same caret position.

\membersection{wxRichTextCtrl::MoveCaretForward}\label{wxrichtextctrlmovecaretforward}

\func{void}{MoveCaretForward}{\param{long }{oldPosition}}

Move the caret one visual step forward: this may mean setting a flag
and keeping the same position if we're going from the end of one line
to the start of the next, which may be the exact same caret position.

\membersection{wxRichTextCtrl::MoveDown}\label{wxrichtextctrlmovedown}

\func{bool}{MoveDown}{\param{int }{noLines = 1}, \param{int }{flags = 0}}

Moves the caret down.

\membersection{wxRichTextCtrl::MoveEnd}\label{wxrichtextctrlmoveend}

\func{bool}{MoveEnd}{\param{int }{flags = 0}}

Moves to the end of the buffer.

\membersection{wxRichTextCtrl::MoveHome}\label{wxrichtextctrlmovehome}

\func{bool}{MoveHome}{\param{int }{flags = 0}}

Moves to the start of the buffer.

\membersection{wxRichTextCtrl::MoveLeft}\label{wxrichtextctrlmoveleft}

\func{bool}{MoveLeft}{\param{int }{noPositions = 1}, \param{int }{flags = 0}}

Moves left.

\membersection{wxRichTextCtrl::MoveRight}\label{wxrichtextctrlmoveright}

\func{bool}{MoveRight}{\param{int }{noPositions = 1}, \param{int }{flags = 0}}

Moves right.

\membersection{wxRichTextCtrl::MoveToLineEnd}\label{wxrichtextctrlmovetolineend}

\func{bool}{MoveToLineEnd}{\param{int }{flags = 0}}

Moves to the end of the line.

\membersection{wxRichTextCtrl::MoveToLineStart}\label{wxrichtextctrlmovetolinestart}

\func{bool}{MoveToLineStart}{\param{int }{flags = 0}}

Moves to the start of the line.

\membersection{wxRichTextCtrl::MoveToParagraphEnd}\label{wxrichtextctrlmovetoparagraphend}

\func{bool}{MoveToParagraphEnd}{\param{int }{flags = 0}}

Moves to the end of the paragraph.

\membersection{wxRichTextCtrl::MoveToParagraphStart}\label{wxrichtextctrlmovetoparagraphstart}

\func{bool}{MoveToParagraphStart}{\param{int }{flags = 0}}

Moves to the start of the paragraph.

\membersection{wxRichTextCtrl::MoveUp}\label{wxrichtextctrlmoveup}

\func{bool}{MoveUp}{\param{int }{noLines = 1}, \param{int }{flags = 0}}

Moves up.

\membersection{wxRichTextCtrl::Newline}\label{wxrichtextctrlnewline}

\func{bool}{Newline}{\void}

Inserts a new paragraph at the current insertion point. See also \helpref{wxRichTextCtrl::LineBreak}{wxrichtextctrllinebreak}.

\membersection{wxRichTextCtrl::NumberList}\label{wxrichtextctrlnumberlist}

\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}}

\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}}

Numbers the paragraphs in the given range. Pass flags to determine how the attributes are set.
Either the style definition or the name of the style definition (in the current sheet) can be passed.

{\it flags} is a bit list of the following:

\begin{itemize}\itemsep=0pt
\item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
\item wxRICHTEXT\_SETSTYLE\_RENUMBER: specifies that numbering should start from {\it startFrom}, otherwise existing attributes are used.
\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.
\end{itemize}

See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlsetliststyle}, \helpref{wxRichTextCtrl::PromoteList}{wxrichtextctrlpromotelist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.

\membersection{wxRichTextCtrl::OnClear}\label{wxrichtextctrlonclear}

\func{void}{OnClear}{\param{wxCommandEvent\& }{event}}

Standard handler for the wxID\_CLEAR command.

\membersection{wxRichTextCtrl::OnContextMenu}\label{wxrichtextctrloncontextmenu}

\func{void}{OnContextMenu}{\param{wxContextMenuEvent\& }{event}}

Shows a standard context menu with undo, redo, cut, copy, paste, clear, and select all commands.

\membersection{wxRichTextCtrl::OnCopy}\label{wxrichtextctrloncopy}

\func{void}{OnCopy}{\param{wxCommandEvent\& }{event}}

Standard handler for the wxID\_COPY command.

\membersection{wxRichTextCtrl::OnCut}\label{wxrichtextctrloncut}

\func{void}{OnCut}{\param{wxCommandEvent\& }{event}}

Standard handler for the wxID\_CUT command.

\membersection{wxRichTextCtrl::OnDropFiles}\label{wxrichtextctrlondropfiles}

\func{void}{OnDropFiles}{\param{wxDropFilesEvent\& }{event}}

Loads the first dropped file.

\membersection{wxRichTextCtrl::OnPaste}\label{wxrichtextctrlonpaste}

\func{void}{OnPaste}{\param{wxCommandEvent\& }{event}}

Standard handler for the wxID\_PASTE command.

\membersection{wxRichTextCtrl::OnRedo}\label{wxrichtextctrlonredo}

\func{void}{OnRedo}{\param{wxCommandEvent\& }{event}}

Standard handler for the wxID\_REDO command.

\membersection{wxRichTextCtrl::OnSelectAll}\label{wxrichtextctrlonselectall}

\func{void}{OnSelectAll}{\param{wxCommandEvent\& }{event}}

Standard handler for the wxID\_SELECTALL command.

\membersection{wxRichTextCtrl::OnUndo}\label{wxrichtextctrlonundo}

\func{void}{OnUndo}{\param{wxCommandEvent\& }{event}}

Standard handler for the wxID\_PASTE command.

\membersection{wxRichTextCtrl::OnUpdateClear}\label{wxrichtextctrlonupdateclear}

\func{void}{OnUpdateClear}{\param{wxUpdateUIEvent\& }{event}}

Standard update handler for the wxID\_CLEAR command.

\membersection{wxRichTextCtrl::OnUpdateCopy}\label{wxrichtextctrlonupdatecopy}

\func{void}{OnUpdateCopy}{\param{wxUpdateUIEvent\& }{event}}

Standard update handler for the wxID\_COPY command.

\membersection{wxRichTextCtrl::OnUpdateCut}\label{wxrichtextctrlonupdatecut}

\func{void}{OnUpdateCut}{\param{wxUpdateUIEvent\& }{event}}

Standard update handler for the wxID\_CUT command.

\membersection{wxRichTextCtrl::OnUpdatePaste}\label{wxrichtextctrlonupdatepaste}

\func{void}{OnUpdatePaste}{\param{wxUpdateUIEvent\& }{event}}

Standard update handler for the wxID\_PASTE command.

\membersection{wxRichTextCtrl::OnUpdateRedo}\label{wxrichtextctrlonupdateredo}

\func{void}{OnUpdateRedo}{\param{wxUpdateUIEvent\& }{event}}

Standard update handler for the wxID\_REDO command.

\membersection{wxRichTextCtrl::OnUpdateSelectAll}\label{wxrichtextctrlonupdateselectall}

\func{void}{OnUpdateSelectAll}{\param{wxUpdateUIEvent\& }{event}}

Standard update handler for the wxID\_SELECTALL command.

\membersection{wxRichTextCtrl::OnUpdateUndo}\label{wxrichtextctrlonupdateundo}

\func{void}{OnUpdateUndo}{\param{wxUpdateUIEvent\& }{event}}

Standard update handler for the wxID\_UNDO command.

\membersection{wxRichTextCtrl::PageDown}\label{wxrichtextctrlpagedown}

\func{bool}{PageDown}{\param{int }{noPages = 1}, \param{int }{flags = 0}}

Moves one or more pages down.

\membersection{wxRichTextCtrl::PageUp}\label{wxrichtextctrlpageup}

\func{bool}{PageUp}{\param{int }{noPages = 1}, \param{int }{flags = 0}}

Moves one or more pages up.

\membersection{wxRichTextCtrl::PaintBackground}\label{wxrichtextctrlpaintbackground}

\func{void}{PaintBackground}{\param{wxDC\& }{dc}}

Paints the background.

\membersection{wxRichTextCtrl::Paste}\label{wxrichtextctrlpaste}

\func{void}{Paste}{\void}

Pastes content from the clipboard to the buffer.

\membersection{wxRichTextCtrl::PositionCaret}\label{wxrichtextctrlpositioncaret}

\func{void}{PositionCaret}{\void}

Internal function to position the visible caret according to the current caret position.

\membersection{wxRichTextCtrl::PositionToXY}\label{wxrichtextctrlpositiontoxy}

\constfunc{bool}{PositionToXY}{\param{long }{pos}, \param{long* }{x}, \param{long* }{y}}

Converts a text position to zero-based column and line numbers.

\membersection{wxRichTextCtrl::PromoteList}\label{wxrichtextctrlpromotelist}

\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}}

\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}}

Promotes or demotes the paragraphs in the given range. A positive {\it promoteBy} produces a smaller indent, and a negative number
produces a larger indent. Pass flags to determine how the attributes are set.
Either the style definition or the name of the style definition (in the current sheet) can be passed.

{\it flags} is a bit list of the following:

\begin{itemize}\itemsep=0pt
\item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
\item wxRICHTEXT\_SETSTYLE\_RENUMBER: specifies that numbering should start from {\it startFrom}, otherwise existing attributes are used.
\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.
\end{itemize}

See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlsetliststyle}, See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlnumberlist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.

\membersection{wxRichTextCtrl::Redo}\label{wxrichtextctrlredo}

\func{void}{Redo}{\void}

Redoes the current command.

\membersection{wxRichTextCtrl::Remove}\label{wxrichtextctrlremove}

\func{void}{Remove}{\param{long }{from}, \param{long }{to}}

Removes the content in the specified range.

\membersection{wxRichTextCtrl::Replace}\label{wxrichtextctrlreplace}

\func{void}{Replace}{\param{long }{from}, \param{long }{to}, \param{const wxString\& }{value}}

Replaces the content in the specified range with the string specified by {\it value}.

\membersection{wxRichTextCtrl::SaveFile}\label{wxrichtextctrlsavefile}

\func{bool}{SaveFile}{\param{const wxString\& }{file = wxEmptyString}, \param{int }{type = wxRICHTEXT\_TYPE\_ANY}}

Saves the buffer content using the given type. If the specified type
is wxRICHTEXT\_TYPE\_ANY, the type is deduced from the filename extension.

This function looks for a suitable \helpref{wxRichTextFileHandler}{wxrichtextfilehandler} object.

\membersection{wxRichTextCtrl::ScrollIntoView}\label{wxrichtextctrlscrollintoview}

\func{bool}{ScrollIntoView}{\param{long }{position}, \param{int }{keyCode}}

Scrolls {\it position} into view. This function takes a caret position.

\membersection{wxRichTextCtrl::SelectAll}\label{wxrichtextctrlselectall}

\func{void}{SelectAll}{\void}

Selects all the text in the buffer.

\membersection{wxRichTextCtrl::SelectNone}\label{wxrichtextctrlselectnone}

\func{void}{SelectNone}{\void}

Cancels any selection.

\membersection{wxRichTextCtrl::SetAndShowDefaultStyle}\label{wxrichtextctrlsetandshowdefaultstyle}

\func{void}{SetAndShowDefaultStyle}{\param{const wxRichTextAttr\& }{attr}}

Sets {\it attr} as the default style and tells the control that the UI should reflect
this attribute until the user moves the caret.

See also \helpref{IsDefaultStyleShowing}{wxrichtextctrlisdefaultstyleshowing}.

\membersection{wxRichTextCtrl::SetBasicStyle}\label{wxrichtextctrlsetbasicstyle}

\func{void}{SetBasicStyle}{\param{const wxRichTextAttr\& }{style}}

\func{void}{SetBasicStyle}{\param{const wxTextAttrEx\& }{style}}

Sets the basic (overall) style. This is the style of the whole
buffer before further styles are applied, unlike the default style, which
only affects the style currently being applied (for example, setting the default
style to bold will cause subsequently inserted text to be bold).

\membersection{wxRichTextCtrl::SetCaretPosition}\label{wxrichtextctrlsetcaretposition}

\func{void}{SetCaretPosition}{\param{long }{position}, \param{bool }{showAtLineStart = false}}

The caret position is the character position just before the caret.
A value of -1 means the caret is at the start of the buffer.

\membersection{wxRichTextCtrl::SetDefaultStyle}\label{wxrichtextctrlsetdefaultstyle}

\func{bool}{SetDefaultStyle}{\param{const wxTextAttrEx\& }{style}}

Sets the current default style, which can be used to change how subsequently inserted
text is displayed.

\membersection{wxRichTextCtrl::SetDefaultStyleToCursorStyle}\label{wxrichtextctrlsetdefaultstyletocursorstyle}

\func{bool}{SetDefaultStyleToCursorStyle}{\void}

Sets the default style to the style under the cursor.

\membersection{wxRichTextCtrl::SetDelayedLayoutThreshold}\label{wxrichtextctrlsetdelayedlayoutthreshold}

\func{void}{SetDelayedLayoutThreshold}{\param{long }{threshold}}

Sets the size of the buffer beyond which layout is delayed during resizing.
This optimizes sizing for large buffers. The default is 20000.

\membersection{wxRichTextCtrl::SetEditable}\label{wxrichtextctrlseteditable}

\func{void}{SetEditable}{\param{bool }{editable}}

Makes the control editable, or not.

\membersection{wxRichTextCtrl::SetFilename}\label{wxrichtextctrlsetfilename}

\func{void}{SetFilename}{\param{const wxString\& }{filename}}

Sets the current filename.

\membersection{wxRichTextCtrl::SetFont}\label{wxrichtextctrlsetfont}

\func{bool}{SetFont}{\param{const wxFont\& }{font}}

Sets the font, and also the basic and default attributes (see \helpref{SetDefaultStyle}{wxrichtextctrlsetdefaultstyle}).

\membersection{wxRichTextCtrl::SetHandlerFlags}\label{wxrichtextctrlsethandlerflags}

\func{void}{SetHandlerFlags}{\param{int }{flags}}

Sets flags that change the behaviour of loading or saving. See the documentation for each
handler class to see what flags are relevant for each handler.

\membersection{wxRichTextCtrl::SetInsertionPoint}\label{wxrichtextctrlsetinsertionpoint}

\func{void}{SetInsertionPoint}{\param{long }{pos}}

Sets the insertion point.

\membersection{wxRichTextCtrl::SetInsertionPointEnd}\label{wxrichtextctrlsetinsertionpointend}

\func{void}{SetInsertionPointEnd}{\void}

Sets the insertion point to the end of the text control.

\membersection{wxRichTextCtrl::SetListStyle}\label{wxrichtextctrlsetliststyle}

\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}}

\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}}

Sets the list attributes for the given range, passing flags to determine how the attributes are set.
Either the style definition or the name of the style definition (in the current sheet) can be passed.

{\it flags} is a bit list of the following:

\begin{itemize}\itemsep=0pt
\item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
\item wxRICHTEXT\_SETSTYLE\_RENUMBER: specifies that numbering should start from {\it startFrom}, otherwise existing attributes are used.
\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.
\end{itemize}

See also \helpref{wxRichTextCtrl::NumberList}{wxrichtextctrlnumberlist}, \helpref{wxRichTextCtrl::PromoteList}{wxrichtextctrlpromotelist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.

\membersection{wxRichTextCtrl::SetSelection}\label{wxrichtextctrlsetselection}

\func{void}{SetSelection}{\param{long }{from}, \param{long }{to}}

Sets the selection to the given range.

The end point of range is specified as the last character position of the span of text, plus one.
So, for example, to set the selection for a character at position 5, use the range (5,6).

\membersection{wxRichTextCtrl::SetSelectionRange}\label{wxrichtextctrlsetselectionrange}

\func{void}{SetSelectionRange}{\param{const wxRichTextRange\& }{range}}

Sets the selection to the given range.

The end point of range is specified as the last character position of the span of text, plus one.
So, for example, to set the selection for a character at position 5, use the range (5,6).

\membersection{wxRichTextCtrl::SetStyle}\label{wxrichtextctrlsetstyle}

\func{bool}{SetStyle}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}

\func{bool}{SetStyle}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttrEx\& }{style}}

\func{bool}{SetStyle}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttr\& }{style}}

Sets the attributes for the given range. The wxRichTextAttr version is more efficient
because it does not use wxFont objects.

The end point of range is specified as the last character position of the span of text, plus one.
So, for example, to set the style for a character at position 5, use the range (5,6).

\membersection{wxRichTextCtrl::SetStyleEx}\label{wxrichtextctrlsetstyleex}

\func{bool}{SetStyleEx}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}

\func{bool}{SetStyleEx}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}

\func{bool}{SetStyleEx}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttrEx\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}

Sets the attributes for the given range, passing flags to determine how the attributes are set. The wxRichTextAttr version is more efficient
because it does not use wxFont objects.

The end point of range is specified as the last character position of the span of text, plus one.
So, for example, to set the style for a character at position 5, use the range (5,6).

{\it flags} may contain a bit list of the following values:

\begin{itemize}\itemsep=0pt
\item wxRICHTEXT\_SETSTYLE\_NONE: no style flag.
\item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this operation should be undoable.
\item wxRICHTEXT\_SETSTYLE\_OPTIMIZE: specifies that the style should not be applied if the
combined style at this point is already the style in question.
\item wxRICHTEXT\_SETSTYLE\_PARAGRAPHS\_ONLY: specifies that the style should only be applied to paragraphs,
and not the content. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
\item wxRICHTEXT\_SETSTYLE\_CHARACTERS\_ONLY: specifies that the style should only be applied to characters,
and not the paragraph. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
\item wxRICHTEXT\_SETSTYLE\_RESET: resets (clears) the existing style before applying the new style.
\item wxRICHTEXT\_SETSTYLE\_REMOVE: removes the specified style. Only the style flags are used in this operation.
\end{itemize}

\membersection{wxRichTextCtrl::SetStyleSheet}\label{wxrichtextctrlsetstylesheet}

\func{void}{SetStyleSheet}{\param{wxRichTextStyleSheet* }{styleSheet}}

Sets the style sheet associated with the control. A style sheet allows named
character and paragraph styles to be applied.

\membersection{wxRichTextCtrl::SetValue}\label{wxrichtextctrlsetvalue}

\func{void}{SetValue}{\param{const wxString\& }{value}}

Replaces existing content with the given text.

\membersection{wxRichTextCtrl::SetupScrollbars}\label{wxrichtextctrlsetupscrollbars}

\func{void}{SetupScrollbars}{\param{bool }{atTop = false}}

A helper function setting up scrollbars, for example after a resize.

\membersection{wxRichTextCtrl::ShowPosition}\label{wxrichtextctrlshowposition}

\func{void}{ShowPosition}{\param{long }{pos}}

Scrolls the buffer so that the given position is in view.

\membersection{wxRichTextCtrl::SuppressingUndo}\label{wxrichtextctrlsuppressingundo}

\constfunc{bool}{SuppressingUndo}{\void}

Returns \true if undo history suppression is on.

\membersection{wxRichTextCtrl::Thaw}\label{wxrichtextctrlthaw}

\func{void}{Thaw}{\void}

Call this function to end a Freeze and refresh the display.

\membersection{wxRichTextCtrl::Undo}\label{wxrichtextctrlundo}

\func{void}{Undo}{\void}

Undoes the command at the top of the command history, if there is one.

\membersection{wxRichTextCtrl::WordLeft}\label{wxrichtextctrlwordleft}

\func{bool}{WordLeft}{\param{int }{noWords = 1}, \param{int }{flags = 0}}

Moves a number of words to the left.

\membersection{wxRichTextCtrl::WordRight}\label{wxrichtextctrlwordright}

\func{bool}{WordRight}{\param{int }{noWords = 1}, \param{int }{flags = 0}}

Move a nuber of words to the right.

\membersection{wxRichTextCtrl::WriteImage}\label{wxrichtextctrlwriteimage}

\func{bool}{WriteImage}{\param{const wxString\& }{filename}, \param{int }{bitmapType}}

Loads an image from a file and writes it at the current insertion point.

\func{bool}{WriteImage}{\param{const wxRichTextImageBlock\& }{imageBlock}}

Writes an image block at the current insertion point.

\func{bool}{WriteImage}{\param{const wxBitmap\& }{bitmap}, \param{int }{bitmapType = wxBITMAP\_TYPE\_PNG}}

\func{bool}{WriteImage}{\param{const wxImage\& }{image}, \param{int }{bitmapType = wxBITMAP\_TYPE\_PNG}}

Write a bitmap or image at the current insertion point. Supply an optional type to use
for internal and file storage of the raw data.

\membersection{wxRichTextCtrl::WriteText}\label{wxrichtextctrlwritetext}

\func{void}{WriteText}{\param{const wxString\& }{text}}

Writes text at the current position.

\membersection{wxRichTextCtrl::XYToPosition}\label{wxrichtextctrlxytoposition}

\constfunc{long}{XYToPosition}{\param{long }{x}, \param{long }{y}}

Translates from column and line number to position.

