wxRichTextCtrlwxRichTextCtrl provides a generic, ground-up implementation of a text control capable of showing multiple styles and images. wxRichTextCtrl sends notification events: see 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 wxRichTextCtrl overview. Derived from wxTextCtrlBase Include files <wx/richtext/richtextctrl.h> Data structures Members
wxRichTextCtrl::wxRichTextCtrl
wxRichTextCtrl::wxRichTextCtrlwxRichTextCtrl() wxRichTextCtrl(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxRE_MULTILINE, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxTextCtrlNameStr) Constructors.
wxRichTextCtrl::~wxRichTextCtrl~wxRichTextCtrl() Destructor.
wxRichTextCtrl::AddImagewxRichTextRange AddImage(const wxImage& image) Adds an image to the control's buffer.
wxRichTextCtrl::AddParagraphwxRichTextRange AddParagraph(const wxString& text) Adds a new paragraph of text to the end of the buffer.
wxRichTextCtrl::AppendTextvoid AppendText(const wxString& text) Sets the insertion point to the end of the buffer and writes the text.
wxRichTextCtrl::ApplyAlignmentToSelectionbool ApplyAlignmentToSelection(wxTextAttrAlignment alignment) Applies the given alignment to the selection (undoable). For alignment values, see wxTextAttrEx.
wxRichTextCtrl::ApplyBoldToSelectionbool ApplyBoldToSelection() Apples bold to the selection (undoable).
wxRichTextCtrl::ApplyItalicToSelectionbool ApplyItalicToSelection() Applies italic to the selection (undoable).
wxRichTextCtrl::ApplyStylebool ApplyStyle(wxRichTextStyleDefinition* def) Applies the given style to the selection.
wxRichTextCtrl::ApplyStyleSheetbool ApplyStyleSheet(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 sheet is NULL, the sheet set with SetStyleSheet is used. Currently this applies paragraph styles only.
wxRichTextCtrl::ApplyUnderlineToSelectionbool ApplyUnderlineToSelection() Applies underline to the selection (undoable).
wxRichTextCtrl::BatchingUndobool BatchingUndo() const Returns true if undo commands are being batched.
wxRichTextCtrl::BeginAlignmentbool BeginAlignment(wxTextAttrAlignment alignment) Begins using alignment For alignment values, see wxTextAttrEx.
wxRichTextCtrl::BeginBatchUndobool BeginBatchUndo(const wxString& cmdName) Starts batching undo history for commands.
wxRichTextCtrl::BeginBoldbool BeginBold() Begins using bold.
wxRichTextCtrl::BeginCharacterStylebool BeginCharacterStyle(const wxString& characterStyle) Begins using the named character style.
wxRichTextCtrl::BeginFontbool BeginFont(const wxFont& font) Begins using this font.
wxRichTextCtrl::BeginFontSizebool BeginFontSize(int pointSize) Begins using the given point size.
wxRichTextCtrl::BeginItalicbool BeginItalic() Begins using italic.
wxRichTextCtrl::BeginLeftIndentbool BeginLeftIndent(int leftIndent, 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.
wxRichTextCtrl::BeginLineSpacingbool BeginLineSpacing(int lineSpacing) Begins appling line spacing. 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:
wxRichTextCtrl::BeginListStylebool BeginListStyle(const wxString& listStyle, int level=1, int number=1) Begins using a specified list style. Optionally, you can also pass a level and a number.
wxRichTextCtrl::BeginNumberedBulletbool BeginNumberedBullet(int bulletNumber, int leftIndent, int leftSubIndent, 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. bulletNumber is a number, usually starting with 1. leftIndent and leftSubIndent are values in tenths of a millimetre. bulletStyle is a bitlist of the following values:
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.
wxRichTextCtrl::BeginParagraphSpacingbool BeginParagraphSpacing(int before, int after) Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of a millimetre.
wxRichTextCtrl::BeginParagraphStylebool BeginParagraphStyle(const wxString& paragraphStyle) Begins applying the named paragraph style.
wxRichTextCtrl::BeginRightIndentbool BeginRightIndent(int rightIndent) Begins a right indent, specified in tenths of a millimetre.
wxRichTextCtrl::BeginStylebool BeginStyle(const wxTextAttrEx& style) Begins applying a style.
wxRichTextCtrl::BeginSuppressUndobool BeginSuppressUndo() Starts suppressing undo history for commands.
wxRichTextCtrl::BeginSymbolBulletbool BeginSymbolBullet(wxChar symbol, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL) Begins applying a symbol bullet, using a character from the current font. See BeginNumberedBullet for an explanation of how indentation is used to render the bulleted paragraph.
wxRichTextCtrl::BeginTextColourbool BeginTextColour(const wxColour& colour) Begins using this colour.
wxRichTextCtrl::BeginUnderlinebool BeginUnderline() Begins using underlining.
wxRichTextCtrl::BeginURLbool BeginURL(const wxString& url, 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.
wxRichTextCtrl::CanCopybool CanCopy() const Returns true if selected content can be copied to the clipboard.
wxRichTextCtrl::CanCutbool CanCut() const Returns true if selected content can be copied to the clipboard and deleted.
wxRichTextCtrl::CanDeleteSelectionbool CanDeleteSelection() const Returns true if selected content can be deleted.
wxRichTextCtrl::CanPastebool CanPaste() const Returns true if the clipboard content can be pasted to the buffer.
wxRichTextCtrl::CanRedobool CanRedo() const Returns true if there is a command in the command history that can be redone.
wxRichTextCtrl::CanUndobool CanUndo() const Returns true if there is a command in the command history that can be undone.
wxRichTextCtrl::Clearvoid Clear() Clears the buffer content, leaving a single empty paragraph. Cannot be undone.
wxRichTextCtrl::ClearListStylebool ClearListStyle(const wxRichTextRange& range, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO) bool ClearListStyle(const wxRichTextRange& range, 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. flags is a bit list of the following:
See also wxRichTextCtrl::SetListStyle, wxRichTextCtrl::PromoteList, wxRichTextCtrl::NumberList.
wxRichTextCtrl::Commandvoid Command(wxCommandEvent& event) Sends the event to the control.
wxRichTextCtrl::Copyvoid Copy() Copies the selected content (if any) to the clipboard.
wxRichTextCtrl::Createbool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxRE_MULTILINE, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxTextCtrlNameStr) Creates the underlying window.
wxRichTextCtrl::Cutvoid Cut() Copies the selected content (if any) to the clipboard and deletes the selection. This is undoable.
wxRichTextCtrl::Deletebool Delete(const wxRichTextRange& range) Deletes the content within the given range.
wxRichTextCtrl::DeleteSelectedContentbool DeleteSelectedContent(long* newPos = NULL) Deletes content if there is a selection, e.g. when pressing a key. Returns the new caret position in newPos, or leaves it if there was no action. This is undoable.
wxRichTextCtrl::DeleteSelectionvoid DeleteSelection() Deletes the content in the selection, if any. This is undoable.
wxRichTextCtrl::DiscardEditsvoid DiscardEdits() Sets the buffer's modified status to false, and clears the buffer's command history.
wxRichTextCtrl::DoGetBestSizewxSize DoGetBestSize() const Currently this simply returns wxSize(10, 10).
wxRichTextCtrl::EndAlignmentbool EndAlignment() Ends alignment.
wxRichTextCtrl::EndAllStylesbool EndAllStyles() Ends application of all styles in the current style stack.
wxRichTextCtrl::EndBatchUndobool EndBatchUndo() Ends batching undo command history.
wxRichTextCtrl::EndBoldbool EndBold() Ends using bold.
wxRichTextCtrl::EndCharacterStylebool EndCharacterStyle() Ends application of a named character style.
wxRichTextCtrl::EndFontbool EndFont() Ends using a font.
wxRichTextCtrl::EndFontSizebool EndFontSize() Ends using a point size.
wxRichTextCtrl::EndItalicbool EndItalic() Ends using italic.
wxRichTextCtrl::EndLeftIndentbool EndLeftIndent() Ends left indent.
wxRichTextCtrl::EndLineSpacingbool EndLineSpacing() Ends line spacing.
wxRichTextCtrl::EndListStylebool EndListStyle() Ends using a specified list style.
wxRichTextCtrl::EndNumberedBulletbool EndNumberedBullet() Ends application of a numbered bullet.
wxRichTextCtrl::EndParagraphSpacingbool EndParagraphSpacing() Ends paragraph spacing.
wxRichTextCtrl::EndParagraphStylebool EndParagraphStyle() Ends application of a named character style.
wxRichTextCtrl::EndRightIndentbool EndRightIndent() Ends right indent.
wxRichTextCtrl::EndStylebool EndStyle() Ends the current style.
wxRichTextCtrl::EndSuppressUndobool EndSuppressUndo() Ends suppressing undo command history.
wxRichTextCtrl::EndSymbolBulletbool EndSymbolBullet() Ends applying a symbol bullet.
wxRichTextCtrl::EndTextColourbool EndTextColour() Ends applying a text colour.
wxRichTextCtrl::EndUnderlinebool EndUnderline() End applying underlining.
wxRichTextCtrl::EndURLbool EndURL() Ends applying a URL.
wxRichTextCtrl::ExtendSelectionbool ExtendSelection(long oldPosition, long newPosition, int flags) Helper function for extending the selection, returning true if the selection was changed. Selections are in caret positions.
wxRichTextCtrl::FindNextWordPositionlong FindNextWordPosition(int direction = 1) const Helper function for finding the caret position for the next word. Direction is 1 (forward) or -1 (backwards).
wxRichTextCtrl::Freezevoid Freeze() Call this function to prevent refresh and allow fast updates, and then Thaw to refresh the control.
wxRichTextCtrl::GetBasicStyleconst wxTextAttrEx& GetBasicStyle() const 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).
wxRichTextCtrl::GetBufferconst wxRichTextBuffer& GetBuffer() const wxRichTextBuffer& GetBuffer() Returns the buffer associated with the control.
wxRichTextCtrl::GetCaretPositionlong GetCaretPosition() const Returns the current caret position.
wxRichTextCtrl::GetCaretPositionForIndexbool GetCaretPositionForIndex(long position, wxRect& rect) Returns the caret height and position for the given character position
wxRichTextCtrl::GetCommandProcessorwxCommandProcessor* GetCommandProcessor() const Gets the command processor associated with the control's buffer.
wxRichTextCtrl::GetDefaultStyleExconst wxTextAttrEx& GetDefaultStyleEx() const 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.
wxRichTextCtrl::GetDelayedLayoutThresholdlong GetDelayedLayoutThreshold() const Gets the size of the buffer beyond which layout is delayed during resizing. This optimizes sizing for large buffers. The default is 20000.
wxRichTextCtrl::GetFilenamewxString GetFilename() const Gets the current filename associated with the control.
wxRichTextCtrl::GetFirstVisiblePositionlong GetFirstVisiblePosition() const Returns the first visible position in the current view.
wxRichTextCtrl::GetHandlerFlagsint GetHandlerFlags() const 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.
wxRichTextCtrl::GetInsertionPointlong GetInsertionPoint() const Returns the current insertion point.
wxRichTextCtrl::GetLastPositionwxTextPos GetLastPosition() const Returns the last position in the buffer.
wxRichTextCtrl::GetLineLengthint GetLineLength(long lineNo) const Returns the length of the specified line in characters.
wxRichTextCtrl::GetLineTextwxString GetLineText(long lineNo) const Returns the text for the given line.
wxRichTextCtrl::GetLogicalPointwxPoint GetLogicalPoint(const wxPoint& ptPhysical) const Transforms physical window position to logical (unscrolled) position.
wxRichTextCtrl::GetNumberOfLinesint GetNumberOfLines() const Returns the number of lines in the buffer.
wxRichTextCtrl::GetPhysicalPointwxPoint GetPhysicalPoint(const wxPoint& ptLogical) const Transforms logical (unscrolled) position to physical window position.
wxRichTextCtrl::GetRangewxString GetRange(long from, long to) const 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.
wxRichTextCtrl::GetSelectionvoid GetSelection(long* from, long* to) const 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 from and to are the same, there is no selection.
wxRichTextCtrl::GetSelectionRangeconst wxRichTextRange& GetSelectionRange() const Returns the selection range in character positions. -1, -1 means no selection.
wxRichTextCtrl::GetStringSelectionwxString GetStringSelection() const Returns the text within the current selection range, if any.
wxRichTextCtrl::GetStylebool GetStyle(long position, wxRichTextAttr& style) bool GetStyle(long position, wxTextAttrEx& style) bool GetStyle(long position, 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 GetUncombinedStyle.
wxRichTextCtrl::GetStyleForRangebool GetStyleForRange(const wxRichTextRange& range, wxRichTextAttr& style) bool GetStyleForRange(const wxRichTextRange& range, wxTextAttrEx& style) Gets the attributes common to the specified range. Attributes that differ in value within the range will not be included in style's flags.
wxRichTextCtrl::GetStyleSheetwxRichTextStyleSheet* GetStyleSheet() const Returns the style sheet associated with the control, if any. A style sheet allows named character and paragraph styles to be applied.
wxRichTextCtrl::GetUncombinedStylebool GetUncombinedStyle(long position, wxRichTextAttr& style) bool GetUncombinedStyle(long position, wxTextAttrEx& style) bool GetUncombinedStyle(long position, 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 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 GetStyle. If you specify (any) paragraph attribute in style's flags, this function will fetch the paragraph attributes. Otherwise, it will return the character attributes.
wxRichTextCtrl::GetValuewxString GetValue() const Returns the content of the entire control as a string.
wxRichTextCtrl::GetVisibleLineForCaretPositionwxRichTextLine* GetVisibleLineForCaretPosition(long caretPosition) const 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.
wxRichTextCtrl::HasCharacterAttributesbool HasCharacterAttributes(const wxRichTextRange& range, const wxTextAttrEx& style) const bool HasCharacterAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const 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. style must have flags indicating which attributes are of interest.
wxRichTextCtrl::HasParagraphAttributesbool HasParagraphAttributes(const wxRichTextRange& range, const wxTextAttrEx& style) const bool HasParagraphAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const 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. style must have flags indicating which attributes are of interest.
wxRichTextCtrl::HasSelectionbool HasSelection() const Returns true if there is a selection.
wxRichTextCtrl::HitTestwxTextCtrlHitTestResult HitTest(const wxPoint& pt, long* pos) const wxTextCtrlHitTestResult HitTest(const wxPoint& pt, wxTextCoord* col, wxTextCoord* row) const Finds the character at the given position in pixels. pt is in device coords (not adjusted for the client area origin nor for scrolling).
wxRichTextCtrl::Initvoid Init() Initialises the members of the control.
wxRichTextCtrl::InitCommandEventvoid InitCommandEvent(wxCommandEvent& event) const Initialises the command event.
wxRichTextCtrl::IsDefaultStyleShowingbool IsDefaultStyleShowing() const 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.
/// 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; }See also SetAndShowDefaultStyle.
wxRichTextCtrl::IsEditablebool IsEditable() const Returns true if the control is editable.
wxRichTextCtrl::IsFrozenbool IsFrozen() const Returns true if Freeze has been called without a Thaw.
wxRichTextCtrl::IsModifiedbool IsModified() const Returns true if the buffer has been modified.
wxRichTextCtrl::IsMultiLinebool IsMultiLine() const Returns true if the control is multiline.
wxRichTextCtrl::IsPositionVisiblebool IsPositionVisible(long pos) const Returns true if the given position is visible on the screen.
wxRichTextCtrl::IsSelectionAlignedbool IsSelectionAligned(wxTextAttrAlignment alignment) const Returns true if all of the selection is aligned according to the specified flag.
wxRichTextCtrl::IsSelectionBoldbool IsSelectionBold() const Returns true if all of the selection is bold.
wxRichTextCtrl::IsSelectionItalicsbool IsSelectionItalics() const Returns true if all of the selection is italic.
wxRichTextCtrl::IsSelectionUnderlinedbool IsSelectionUnderlined() const Returns true if all of the selection is underlined.
wxRichTextCtrl::IsSingleLinebool IsSingleLine() const Returns true if the control is single-line. Currently wxRichTextCtrl does not support single-line editing.
wxRichTextCtrl::KeyboardNavigatebool KeyboardNavigate(int keyCode, int flags) Helper function implementing keyboard navigation.
wxRichTextCtrl::LayoutContentbool LayoutContent(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.
wxRichTextCtrl::LineBreakbool LineBreak() 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 wxRichTextLineBreakChar to text content, or by typing Shift-Return.
wxRichTextCtrl::LoadFilebool LoadFile(const wxString& file, 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 wxRichTextFileHandler object.
wxRichTextCtrl::MarkDirtyvoid MarkDirty() Marks the buffer as modified.
wxRichTextCtrl::MoveCaretbool MoveCaret(long pos, bool showAtLineStart = false) Move the caret to the given character position.
wxRichTextCtrl::MoveCaretBackvoid MoveCaretBack(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.
wxRichTextCtrl::MoveCaretForwardvoid MoveCaretForward(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.
wxRichTextCtrl::MoveDownbool MoveDown(int noLines = 1, int flags = 0) Moves the caret down.
wxRichTextCtrl::MoveEndbool MoveEnd(int flags = 0) Moves to the end of the buffer.
wxRichTextCtrl::MoveHomebool MoveHome(int flags = 0) Moves to the start of the buffer.
wxRichTextCtrl::MoveLeftbool MoveLeft(int noPositions = 1, int flags = 0) Moves left.
wxRichTextCtrl::MoveRightbool MoveRight(int noPositions = 1, int flags = 0) Moves right.
wxRichTextCtrl::MoveToLineEndbool MoveToLineEnd(int flags = 0) Moves to the end of the line.
wxRichTextCtrl::MoveToLineStartbool MoveToLineStart(int flags = 0) Moves to the start of the line.
wxRichTextCtrl::MoveToParagraphEndbool MoveToParagraphEnd(int flags = 0) Moves to the end of the paragraph.
wxRichTextCtrl::MoveToParagraphStartbool MoveToParagraphStart(int flags = 0) Moves to the start of the paragraph.
wxRichTextCtrl::MoveUpbool MoveUp(int noLines = 1, int flags = 0) Moves up.
wxRichTextCtrl::Newlinebool Newline() Inserts a new paragraph at the current insertion point. See also wxRichTextCtrl::LineBreak.
wxRichTextCtrl::NumberListbool NumberList(const wxRichTextRange& range, const wxRichTextListStyleDefinition* style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = -1, int listLevel = -1) bool Number(const wxRichTextRange& range, const wxString& styleName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = -1, 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. flags is a bit list of the following:
See also wxRichTextCtrl::SetListStyle, wxRichTextCtrl::PromoteList, wxRichTextCtrl::ClearListStyle.
wxRichTextCtrl::OnClearvoid OnClear(wxCommandEvent& event) Standard handler for the wxID_CLEAR command.
wxRichTextCtrl::OnContextMenuvoid OnContextMenu(wxContextMenuEvent& event) Shows a standard context menu with undo, redo, cut, copy, paste, clear, and select all commands.
wxRichTextCtrl::OnCopyvoid OnCopy(wxCommandEvent& event) Standard handler for the wxID_COPY command.
wxRichTextCtrl::OnCutvoid OnCut(wxCommandEvent& event) Standard handler for the wxID_CUT command.
wxRichTextCtrl::OnDropFilesvoid OnDropFiles(wxDropFilesEvent& event) Loads the first dropped file.
wxRichTextCtrl::OnPastevoid OnPaste(wxCommandEvent& event) Standard handler for the wxID_PASTE command.
wxRichTextCtrl::OnRedovoid OnRedo(wxCommandEvent& event) Standard handler for the wxID_REDO command.
wxRichTextCtrl::OnSelectAllvoid OnSelectAll(wxCommandEvent& event) Standard handler for the wxID_SELECTALL command.
wxRichTextCtrl::OnUndovoid OnUndo(wxCommandEvent& event) Standard handler for the wxID_PASTE command.
wxRichTextCtrl::OnUpdateClearvoid OnUpdateClear(wxUpdateUIEvent& event) Standard update handler for the wxID_CLEAR command.
wxRichTextCtrl::OnUpdateCopyvoid OnUpdateCopy(wxUpdateUIEvent& event) Standard update handler for the wxID_COPY command.
wxRichTextCtrl::OnUpdateCutvoid OnUpdateCut(wxUpdateUIEvent& event) Standard update handler for the wxID_CUT command.
wxRichTextCtrl::OnUpdatePastevoid OnUpdatePaste(wxUpdateUIEvent& event) Standard update handler for the wxID_PASTE command.
wxRichTextCtrl::OnUpdateRedovoid OnUpdateRedo(wxUpdateUIEvent& event) Standard update handler for the wxID_REDO command.
wxRichTextCtrl::OnUpdateSelectAllvoid OnUpdateSelectAll(wxUpdateUIEvent& event) Standard update handler for the wxID_SELECTALL command.
wxRichTextCtrl::OnUpdateUndovoid OnUpdateUndo(wxUpdateUIEvent& event) Standard update handler for the wxID_UNDO command.
wxRichTextCtrl::PageDownbool PageDown(int noPages = 1, int flags = 0) Moves one or more pages down.
wxRichTextCtrl::PageUpbool PageUp(int noPages = 1, int flags = 0) Moves one or more pages up.
wxRichTextCtrl::PaintBackgroundvoid PaintBackground(wxDC& dc) Paints the background.
wxRichTextCtrl::Pastevoid Paste() Pastes content from the clipboard to the buffer.
wxRichTextCtrl::PositionCaretvoid PositionCaret() Internal function to position the visible caret according to the current caret position.
wxRichTextCtrl::PositionToXYbool PositionToXY(long pos, long* x, long* y) const Converts a text position to zero-based column and line numbers.
wxRichTextCtrl::PromoteListbool PromoteList(int promoteBy, const wxRichTextRange& range, const wxRichTextListStyleDefinition* style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int listLevel = -1) bool PromoteList(int promoteBy, const wxRichTextRange& range, const wxString& styleName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int listLevel = -1) Promotes or demotes the paragraphs in the given range. A positive 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. flags is a bit list of the following:
See also wxRichTextCtrl::SetListStyle, See also wxRichTextCtrl::SetListStyle, wxRichTextCtrl::ClearListStyle.
wxRichTextCtrl::Redovoid Redo() Redoes the current command.
wxRichTextCtrl::Removevoid Remove(long from, long to) Removes the content in the specified range.
wxRichTextCtrl::Replacevoid Replace(long from, long to, const wxString& value) Replaces the content in the specified range with the string specified by value.
wxRichTextCtrl::SaveFilebool SaveFile(const wxString& file = wxEmptyString, 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 wxRichTextFileHandler object.
wxRichTextCtrl::ScrollIntoViewbool ScrollIntoView(long position, int keyCode) Scrolls position into view. This function takes a caret position.
wxRichTextCtrl::SelectAllvoid SelectAll() Selects all the text in the buffer.
wxRichTextCtrl::SelectNonevoid SelectNone() Cancels any selection.
wxRichTextCtrl::SetAndShowDefaultStylevoid SetAndShowDefaultStyle(const wxRichTextAttr& attr) Sets attr as the default style and tells the control that the UI should reflect this attribute until the user moves the caret. See also IsDefaultStyleShowing.
wxRichTextCtrl::SetBasicStylevoid SetBasicStyle(const wxRichTextAttr& style) void SetBasicStyle(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).
wxRichTextCtrl::SetCaretPositionvoid SetCaretPosition(long position, 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.
wxRichTextCtrl::SetDefaultStylebool SetDefaultStyle(const wxTextAttrEx& style) Sets the current default style, which can be used to change how subsequently inserted text is displayed.
wxRichTextCtrl::SetDefaultStyleToCursorStylebool SetDefaultStyleToCursorStyle() Sets the default style to the style under the cursor.
wxRichTextCtrl::SetDelayedLayoutThresholdvoid SetDelayedLayoutThreshold(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.
wxRichTextCtrl::SetEditablevoid SetEditable(bool editable) Makes the control editable, or not.
wxRichTextCtrl::SetFilenamevoid SetFilename(const wxString& filename) Sets the current filename.
wxRichTextCtrl::SetFontbool SetFont(const wxFont& font) Sets the font, and also the basic and default attributes (see SetDefaultStyle).
wxRichTextCtrl::SetHandlerFlagsvoid SetHandlerFlags(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.
wxRichTextCtrl::SetInsertionPointvoid SetInsertionPoint(long pos) Sets the insertion point.
wxRichTextCtrl::SetInsertionPointEndvoid SetInsertionPointEnd() Sets the insertion point to the end of the text control.
wxRichTextCtrl::SetListStylebool SetListStyle(const wxRichTextRange& range, const wxRichTextListStyleDefinition* style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = -1, int listLevel = -1) bool SetListStyle(const wxRichTextRange& range, const wxString& styleName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = -1, 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. flags is a bit list of the following:
See also wxRichTextCtrl::NumberList, wxRichTextCtrl::PromoteList, wxRichTextCtrl::ClearListStyle.
wxRichTextCtrl::SetSelectionvoid SetSelection(long from, 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).
wxRichTextCtrl::SetSelectionRangevoid SetSelectionRange(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).
wxRichTextCtrl::SetStylebool SetStyle(const wxRichTextRange& range, const wxRichTextAttr& style) bool SetStyle(long start, long end, const wxTextAttrEx& style) bool SetStyle(long start, long end, 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).
wxRichTextCtrl::SetStyleExbool SetStyleEx(const wxRichTextRange& range, const wxRichTextAttr& style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO) bool SetStyleEx(const wxRichTextRange& range, const wxTextAttrEx& style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO) bool SetStyleEx(long start, long end, const wxTextAttrEx& style, 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). flags may contain a bit list of the following values:
wxRichTextCtrl::SetStyleSheetvoid SetStyleSheet(wxRichTextStyleSheet* styleSheet) Sets the style sheet associated with the control. A style sheet allows named character and paragraph styles to be applied.
wxRichTextCtrl::SetValuevoid SetValue(const wxString& value) Replaces existing content with the given text.
wxRichTextCtrl::SetupScrollbarsvoid SetupScrollbars(bool atTop = false) A helper function setting up scrollbars, for example after a resize.
wxRichTextCtrl::ShowPositionvoid ShowPosition(long pos) Scrolls the buffer so that the given position is in view.
wxRichTextCtrl::SuppressingUndobool SuppressingUndo() const Returns true if undo history suppression is on.
wxRichTextCtrl::Thawvoid Thaw() Call this function to end a Freeze and refresh the display.
wxRichTextCtrl::Undovoid Undo() Undoes the command at the top of the command history, if there is one.
wxRichTextCtrl::WordLeftbool WordLeft(int noWords = 1, int flags = 0) Moves a number of words to the left.
wxRichTextCtrl::WordRightbool WordRight(int noWords = 1, int flags = 0) Move a nuber of words to the right.
wxRichTextCtrl::WriteImagebool WriteImage(const wxString& filename, int bitmapType) Loads an image from a file and writes it at the current insertion point. bool WriteImage(const wxRichTextImageBlock& imageBlock) Writes an image block at the current insertion point. bool WriteImage(const wxBitmap& bitmap, int bitmapType = wxBITMAP_TYPE_PNG) bool WriteImage(const wxImage& image, 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.
wxRichTextCtrl::WriteTextvoid WriteText(const wxString& text) Writes text at the current position.
wxRichTextCtrl::XYToPositionlong XYToPosition(long x, long y) const Translates from column and line number to position.
|