X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/96c9f0f6775fb74e549789d714941e97a4407848..4c44eb66f34f90787524797472d48f35d98a9e23:/include/wx/richtext/richtextctrl.h diff --git a/include/wx/richtext/richtextctrl.h b/include/wx/richtext/richtextctrl.h index beef94f24d..c17fbacfa6 100644 --- a/include/wx/richtext/richtextctrl.h +++ b/include/wx/richtext/richtextctrl.h @@ -157,9 +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, 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(); @@ -180,9 +185,15 @@ public: 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); @@ -379,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) @@ -495,16 +509,16 @@ public: } /// 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(); @@ -525,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); @@ -590,8 +607,6 @@ public: /// Scrolling void OnScroll(wxScrollWinEvent& event); -// Implementation - /// Set font, and also default attributes virtual bool SetFont(const wxFont& font); @@ -712,6 +727,8 @@ public: SetCaretPositionForDefaultStyle(GetCaretPosition()); } +// Implementation + #if wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE WX_FORWARD_TO_SCROLL_HELPER() #endif @@ -733,8 +750,10 @@ private: /// Text buffer wxRichTextBuffer m_buffer; +#if !wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE /// Filename wxString m_filename; +#endif wxMenu* m_contextMenu; @@ -838,4 +857,3 @@ typedef void (wxEvtHandler::*wxRichTextEventFunction)(wxRichTextEvent&); #endif // _WX_RICHTEXTCTRL_H_ -