virtual void Replace(long from, long to, const wxString& value);
virtual void Remove(long from, long to);
+#if !wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE
+ bool LoadFile(const wxString& file, int fileType = wxRICHTEXT_TYPE_ANY);
+ bool SaveFile(const wxString& file = wxEmptyString, int fileType = wxRICHTEXT_TYPE_ANY);
+#endif
+
// load/save the controls contents from/to the file
- virtual bool LoadFile(const wxString& file, int type = wxRICHTEXT_TYPE_ANY);
- virtual bool SaveFile(const wxString& file = wxEmptyString, int type = wxRICHTEXT_TYPE_ANY);
+ virtual bool DoLoadFile(const wxString& file, int fileType);
+ virtual bool DoSaveFile(const wxString& file = wxEmptyString, int fileType = wxRICHTEXT_TYPE_ANY);
// sets/clears the dirty flag
virtual void MarkDirty();
virtual bool SetStyle(long start, long end, const wxTextAttr& style);
virtual bool SetStyle(long start, long end, const wxTextAttrEx& style);
virtual bool SetStyle(const wxRichTextRange& range, const wxRichTextAttr& style);
- virtual bool GetStyle(long position, wxTextAttr& style) const;
- virtual bool GetStyle(long position, wxTextAttrEx& style) const;
- virtual bool GetStyle(long position, wxRichTextAttr& style) const;
+ virtual bool GetStyle(long position, wxTextAttr& style);
+ virtual bool GetStyle(long position, wxTextAttrEx& style);
+ virtual bool GetStyle(long position, wxRichTextAttr& style);
+
+ /// Get the content (uncombined) attributes for this position.
+ virtual bool GetUncombinedStyle(long position, wxTextAttr& style);
+ virtual bool GetUncombinedStyle(long position, wxTextAttrEx& style);
+ virtual bool GetUncombinedStyle(long position, wxRichTextAttr& style);
+
virtual bool SetDefaultStyle(const wxTextAttrEx& style);
virtual bool SetDefaultStyle(const wxTextAttr& style);
/// Clear the selection
virtual void SelectNone();
+ /// Select the word at the given character position
+ virtual bool SelectWord(long position);
+
/// Get/set the selection range in character positions. -1, -1 means no selection.
/// The range is in API convention, i.e. a single character selection is denoted
/// by (n, n+1)
}
/// Is all of the selection bold?
- virtual bool IsSelectionBold() const;
+ virtual bool IsSelectionBold();
/// Is all of the selection italics?
- virtual bool IsSelectionItalics() const;
+ virtual bool IsSelectionItalics();
/// Is all of the selection underlined?
- virtual bool IsSelectionUnderlined() const;
+ virtual bool IsSelectionUnderlined();
/// Is all of the selection aligned according to the specified flag?
- virtual bool IsSelectionAligned(wxTextAttrAlignment alignment) const;
+ virtual bool IsSelectionAligned(wxTextAttrAlignment alignment);
/// Apply bold to the selection
virtual bool ApplyBoldToSelection();
void SetStyleSheet(wxRichTextStyleSheet* styleSheet) { GetBuffer().SetStyleSheet(styleSheet); }
wxRichTextStyleSheet* GetStyleSheet() const { return GetBuffer().GetStyleSheet(); }
+ /// Apply the style sheet to the buffer, for example if the styles have changed.
+ bool ApplyStyleSheet(wxRichTextStyleSheet* styleSheet = NULL);
+
// Command handlers
void Command(wxCommandEvent& event);
/// Scrolling
void OnScroll(wxScrollWinEvent& event);
-// Implementation
-
/// Set font, and also default attributes
virtual bool SetFont(const wxFont& font);
SetCaretPositionForDefaultStyle(GetCaretPosition());
}
+// Implementation
+
#if wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE
WX_FORWARD_TO_SCROLL_HELPER()
#endif
/// Text buffer
wxRichTextBuffer m_buffer;
+#if !wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE
/// Filename
wxString m_filename;
+#endif
wxMenu* m_contextMenu;
#endif
// _WX_RICHTEXTCTRL_H_
-