\section{\class{wxRichTextCtrl}}\label{wxrichtextctrl} wxRichTextCtrl provides a generic, ground-up implementation of a text control capable of showing multiple styles and images. \wxheading{Derived from} wxTextCtrlBase \wxheading{Include files} \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}} 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::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::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 0x0000 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x0001 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x0002 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x0004 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x0008 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x0010 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x0020 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x0040 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x0080 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x0100 \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::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::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}} 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::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::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::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::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. \membersection{wxRichTextCtrl::GetSelection}\label{wxrichtextctrlgetselection} \constfunc{void}{GetSelection}{\param{long* }{from}, \param{long* }{to}} Returns the range of the current selection. 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} \constfunc{bool}{GetStyle}{\param{long }{position}, \param{wxRichTextAttr\& }{style}} \constfunc{bool}{GetStyle}{\param{long }{position}, \param{wxTextAttrEx\& }{style}} Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient because it does not use wxFont objects. \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::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::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::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} Insert a newline (actually paragraph) at the current insertion point. \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::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::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::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::SetSelection}\label{wxrichtextctrlsetselection} \func{void}{SetSelection}{\param{long }{from}, \param{long }{to}} Sets the selection to the given range. \membersection{wxRichTextCtrl::SetSelectionRange}\label{wxrichtextctrlsetselectionrange} \func{void}{SetSelectionRange}{\param{const wxRichTextRange\& }{range}} Sets the selection to the given range. \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}} Sets the attributes for the given range. The wxRichTextAttr version is more efficient because it does not use wxFont objects. \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.