*/
wxRichTextEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
- /**
- Clones the event.
- */
- wxEvent* Clone() const;
-
/**
Returns the character pressed, within a wxEVT_COMMAND_RICHTEXT_CHARACTER event.
*/
/**
Gets the range for the current operation.
*/
- wxRichTextRange GetRange() const;
+ const wxRichTextRange& GetRange() const;
/**
Sets the character variable.
For more information, see the @ref overview_richtextctrl.
+ @beginStyleTable
+ @style{wxRE_CENTRE_CARET}
+ The control will try to keep the caret line centred vertically while editing.
+ wxRE_CENTER_CARET is a synonym for this style.
+ @style{wxRE_MULTILINE}
+ The control will be multiline (mandatory).
+ @style{wxRE_READONLY}
+ The control will not be editable.
+ @endStyleTable
+
@library{wxrichtext}
@category{richtext}
+ @appearance{richtextctrl.png}
*/
class wxRichTextCtrl
{
See BeginNumberedBullet() for an explanation of how indentation is used
to render the bulleted paragraph.
*/
- bool BeginSymbolBullet(wxChar symbol, int leftIndent,
+ bool BeginSymbolBullet(const wxString& symbol, int leftIndent,
int leftSubIndent,
int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL);
*/
virtual void Clear();
- //@{
/**
Clears the list style from the given range, clearing list-related attributes
and applying any named paragraph style associated with each paragraph.
@see SetListStyle(), PromoteList(), NumberList().
*/
- bool ClearListStyle(const wxRichTextRange& range,
- int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO);
- bool ClearListStyle(const wxRichTextRange& range,
+ virtual bool ClearListStyle(const wxRichTextRange& range,
int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO);
- //@}
/**
Sends the event to the control.
*/
virtual void DiscardEdits();
- /**
- Currently this simply returns @c wxSize(10, 10).
- */
- wxSize DoGetBestSize() const;
-
/**
Ends alignment.
*/
Helper function for extending the selection, returning @true if the selection
was changed. Selections are in caret positions.
*/
- bool ExtendSelection(long oldPosition, long newPosition,
- int flags);
+ virtual bool ExtendSelection(long oldPosition, long newPosition, int flags);
/**
Helper function for finding the caret position for the next word.
applied (for example, setting the default style to bold will cause
subsequently inserted text to be bold).
*/
- const wxTextAttr GetBasicStyle() const;
+ virtual const wxTextAttr& GetBasicStyle() const;
//@{
/**
Returns the current default style, which can be used to change how subsequently
inserted text is displayed.
*/
- const wxTextAttr GetDefaultStyle() const;
+ virtual const wxTextAttr& GetDefaultStyle() const;
/**
Gets the size of the buffer beyond which layout is delayed during resizing.
/**
Returns the selection range in character positions. -1, -1 means no selection.
*/
- const wxRichTextRange GetSelectionRange() const;
+ wxRichTextRange GetSelectionRange() const;
/**
Returns the text within the current selection range, if any.
Attributes that differ in value within the range will not be included
in @a style flags.
*/
- bool GetStyleForRange(const wxRichTextRange& range,
- wxTextAttr& style);
+ virtual bool GetStyleForRange(const wxRichTextRange& range,
+ wxTextAttr& style);
/**
Returns the style sheet associated with the control, if any.
You can use this to implement, for example, bold button updating.
@a style must have flags indicating which attributes are of interest.
*/
- bool HasCharacterAttributes(const wxRichTextRange& range,
- const wxTextAttr& style) const;
+ virtual bool HasCharacterAttributes(const wxRichTextRange& range,
+ const wxTextAttr& style) const;
/**
Test if this whole range has paragraph attributes of the specified kind.
You can use this to implement, for example, centering button updating.
@a style must have flags indicating which attributes are of interest.
*/
- bool HasParagraphAttributes(const wxRichTextRange& range,
- const wxTextAttr& style) const;
+ virtual bool HasParagraphAttributes(const wxRichTextRange& range,
+ const wxTextAttr& style) const;
/**
Returns @true if there is a selection.
*/
void Init();
- /**
- Initialises the command event.
- */
- void InitCommandEvent(wxCommandEvent& event) 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
bool SetStyle(long start, long end, const wxTextAttr& style);
//@}
- //@{
/**
Sets the attributes for the given range, passing flags to determine how the
attributes are set.
- wxRICHTEXT_SETSTYLE_REMOVE: removes the specified style. Only the style flags
are used in this operation.
*/
- bool SetStyleEx(const wxRichTextRange& range,
- const wxTextAttr& style,
- int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO);
- bool SetStyleEx(long start, long end,
+ virtual bool SetStyleEx(const wxRichTextRange& range,
const wxTextAttr& style,
int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO);
- //@}
/**
Sets the style sheet associated with the control.
/**
Replaces existing content with the given text.
*/
- void SetValue(const wxString& value);
+ virtual void SetValue(const wxString& value);
/**
A helper function setting up scrollbars, for example after a resize.
/**
Loads an image from a file and writes it at the current insertion point.
*/
- bool WriteImage(const wxString& filename, int bitmapType);
+ virtual bool WriteImage(const wxString& filename, wxBitmapType bitmapType);
/**
Writes an image block at the current insertion point.
*/
- bool WriteImage(const wxRichTextImageBlock& imageBlock);
+ virtual bool WriteImage(const wxRichTextImageBlock& imageBlock);
//@{
/**
Translates from column and line number to position.
*/
virtual long XYToPosition(long x, long y) const;
+
+protected:
+
+ /**
+ Currently this simply returns @c wxSize(10, 10).
+ */
+ virtual wxSize DoGetBestSize() const;
+
+ /**
+ Initialises the command event.
+ */
+ void InitCommandEvent(wxCommandEvent& event) const;
};