+ virtual bool ClearListStyle(const wxRichTextRange& range, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO);
+
+ //@{
+ /**
+ 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.
+
+ @a flags is a bit list of the following:
+ - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable.
+ - wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from
+ @a startFrom, otherwise existing attributes are used.
+ - wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that @a listLevel should be used
+ as the level for all paragraphs, otherwise the current indentation will be used.
+
+ @see SetListStyle(), PromoteList(), ClearListStyle().
+ */
+ virtual bool NumberList(const wxRichTextRange& range, wxRichTextListStyleDefinition* def = NULL, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1);
+ virtual bool NumberList(const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1);
+ //@}
+
+ //@{
+ /**
+ Promotes or demotes the paragraphs in the given range.
+ A positive @a 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.
+
+ @a flags is a bit list of the following:
+ - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable.
+ - wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from
+ @a startFrom, otherwise existing attributes are used.
+ - wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that @a listLevel should be used
+ as the level for all paragraphs, otherwise the current indentation will be used.
+
+ @see SetListStyle(), @see SetListStyle(), ClearListStyle().
+ */
+ virtual bool PromoteList(int promoteBy, const wxRichTextRange& range, wxRichTextListStyleDefinition* def = NULL, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel = -1);
+ virtual bool PromoteList(int promoteBy, const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel = -1);
+ //@}
+
+ /**
+ Deletes the content within the given range.
+ */
+ virtual bool Delete(const wxRichTextRange& range);
+
+ /**
+ Translates from column and line number to position.
+ */
+ virtual long XYToPosition(long x, long y) const;
+
+ /**
+ Converts a text position to zero-based column and line numbers.
+ */
+ virtual bool PositionToXY(long pos, long *x, long *y) const;
+
+ /**
+ Scrolls the buffer so that the given position is in view.
+ */
+ virtual void ShowPosition(long pos);
+
+ //@{
+ /**
+ Finds the character at the given position in pixels.
+ @a pt is in device coords (not adjusted for the client area origin nor for
+ scrolling).
+ */
+ virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const;
+ virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt,
+ wxTextCoord *col,
+ wxTextCoord *row) const;
+ //@}
+
+// Clipboard operations
+
+ /**
+ Copies the selected content (if any) to the clipboard.
+ */
+ virtual void Copy();
+
+ /**
+ Copies the selected content (if any) to the clipboard and deletes the selection.
+ This is undoable.
+ */
+ virtual void Cut();
+
+ /**
+ Pastes content from the clipboard to the buffer.
+ */
+ virtual void Paste();
+
+ /**
+ Deletes the content in the selection, if any. This is undoable.
+ */
+ virtual void DeleteSelection();
+
+ /**
+ Returns @true if selected content can be copied to the clipboard.
+ */
+ virtual bool CanCopy() const;
+
+ /**
+ Returns @true if selected content can be copied to the clipboard and deleted.
+ */
+ virtual bool CanCut() const;
+
+ /**
+ Returns @true if the clipboard content can be pasted to the buffer.
+ */
+ virtual bool CanPaste() const;
+
+ /**
+ Returns @true if selected content can be deleted.
+ */
+ virtual bool CanDeleteSelection() const;
+
+ /**
+ Undoes the command at the top of the command history, if there is one.
+ */
+ virtual void Undo();
+
+ /**
+ Redoes the current command.
+ */
+ virtual void Redo();
+
+ /**
+ Returns @true if there is a command in the command history that can be undone.
+ */
+ virtual bool CanUndo() const;
+
+ /**
+ Returns @true if there is a command in the command history that can be redone.
+ */
+ virtual bool CanRedo() const;
+
+ /**
+ Sets the insertion point and causes the current editing style to be taken from
+ the new position (unlike wxRichTextCtrl::SetCaretPosition).
+ */
+ virtual void SetInsertionPoint(long pos);
+
+ /**
+ Sets the insertion point to the end of the text control.
+ */
+ virtual void SetInsertionPointEnd();
+
+ /**
+ Returns the current insertion point.
+ */
+ virtual long GetInsertionPoint() const;
+
+ /**
+ Returns the last position in the buffer.
+ */
+ virtual wxTextPos GetLastPosition() const;
+
+ //@{
+ /**
+ 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).
+ */
+ virtual void SetSelection(long from, long to);
+ void SetSelection(const wxRichTextSelection& sel) { m_selection = sel; }
+ //@}
+
+
+ /**
+ Selects all the text in the buffer.
+ */
+ virtual void SelectAll();
+
+ /**
+ Makes the control editable, or not.
+ */
+ virtual void SetEditable(bool editable);
+
+ /**
+ Returns @true if there is a selection and the object containing the selection
+ was the same as the current focus object.
+ */
+ virtual bool HasSelection() const;
+
+ /**
+ Returns @true if there was a selection, whether or not the current focus object
+ is the same as the selection's container object.
+ */
+ virtual bool HasUnfocusedSelection() const;
+
+ //@{
+ /**
+ 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.
+ */
+ virtual bool WriteImage(const wxImage& image, wxBitmapType bitmapType = wxBITMAP_TYPE_PNG,
+ const wxRichTextAttr& textAttr = wxRichTextAttr());
+
+ virtual bool WriteImage(const wxBitmap& bitmap, wxBitmapType bitmapType = wxBITMAP_TYPE_PNG,
+ const wxRichTextAttr& textAttr = wxRichTextAttr());
+ //@}
+
+ /**
+ Loads an image from a file and writes it at the current insertion point.
+ */
+ virtual bool WriteImage(const wxString& filename, wxBitmapType bitmapType,
+ const wxRichTextAttr& textAttr = wxRichTextAttr());
+
+ /**
+ Writes an image block at the current insertion point.
+ */
+ virtual bool WriteImage(const wxRichTextImageBlock& imageBlock,
+ const wxRichTextAttr& textAttr = wxRichTextAttr());
+
+ /**
+ Write a text box at the current insertion point, returning the text box.
+ You can then call SetFocusObject() to set the focus to the new object.
+ */
+ virtual wxRichTextBox* WriteTextBox(const wxRichTextAttr& textAttr = wxRichTextAttr());
+
+ /**
+ Write a table at the current insertion point, returning the table.
+ You can then call SetFocusObject() to set the focus to the new object.
+ */
+ virtual wxRichTextTable* WriteTable(int rows, int cols, const wxRichTextAttr& tableAttr = wxRichTextAttr(), const wxRichTextAttr& cellAttr = wxRichTextAttr());
+
+ /**
+ Inserts a new paragraph at the current insertion point. @see LineBreak().
+ */
+ virtual bool Newline();
+
+ /**
+ 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 @b wxRichTextLineBreakChar
+ to text content, or by typing Shift-Return.
+ */
+ virtual bool LineBreak();
+
+ /**
+ 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).
+ */
+ virtual void SetBasicStyle(const wxRichTextAttr& style) { GetBuffer().SetBasicStyle(style); }
+
+ /**
+ 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).
+ */
+ virtual const wxRichTextAttr& GetBasicStyle() const { return GetBuffer().GetBasicStyle(); }
+
+ /**
+ Begins applying a style.
+ */
+ virtual bool BeginStyle(const wxRichTextAttr& style) { return GetBuffer().BeginStyle(style); }