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) { return LoadFile(file, wxRICHTEXT_TYPE_ANY); }
- virtual bool LoadFile(const wxString& file, int type);
- virtual bool SaveFile(const wxString& file = wxEmptyString) { return SaveFile(file, wxRICHTEXT_TYPE_ANY); }
- virtual bool SaveFile(const wxString& file, int type);
+ 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 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)
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_
-