]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/richtext/richtextctrl.h
put grid string in generic/grid.cpp, not common/datacmn.cpp
[wxWidgets.git] / include / wx / richtext / richtextctrl.h
index d1dd775079084dd6466b11164be0727ed4dc0d61..c17fbacfa67f29789fa00d7fed688f477f7718dc 100644 (file)
@@ -157,11 +157,14 @@ public:
     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();
@@ -185,6 +188,12 @@ public:
     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);
 
@@ -381,6 +390,9 @@ public:
     /// 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)
@@ -527,6 +539,9 @@ public:
     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);
@@ -592,8 +607,6 @@ public:
     /// Scrolling
     void OnScroll(wxScrollWinEvent& event);
 
-// Implementation
-
     /// Set font, and also default attributes
     virtual bool SetFont(const wxFont& font);
 
@@ -714,6 +727,8 @@ public:
         SetCaretPositionForDefaultStyle(GetCaretPosition());
     }
 
+// Implementation
+
 #if wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE
      WX_FORWARD_TO_SCROLL_HELPER()
 #endif
@@ -735,8 +750,10 @@ private:
     /// Text buffer
     wxRichTextBuffer        m_buffer;
 
+#if !wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE
     /// Filename
     wxString                m_filename;
+#endif
 
     wxMenu*                 m_contextMenu;
 
@@ -840,4 +857,3 @@ typedef void (wxEvtHandler::*wxRichTextEventFunction)(wxRichTextEvent&);
 
 #endif
     // _WX_RICHTEXTCTRL_H_
-