From 3966a9f4f8001df66aa0fcb347911f9fdade00dc Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 19 Sep 2006 17:06:54 +0000 Subject: [PATCH] Better compatibility between wxRichTextCtrl and wxTextCtrlBase git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41303 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/carbon/textctrl.h | 1 + include/wx/msw/textctrl.h | 1 + include/wx/richtext/richtextbuffer.h | 4 ++-- include/wx/richtext/richtextctrl.h | 20 +++++++++++--------- include/wx/textctrl.h | 2 ++ src/richtext/richtextbuffer.cpp | 4 ++-- src/richtext/richtextctrl.cpp | 14 +++++++------- 7 files changed, 26 insertions(+), 20 deletions(-) diff --git a/include/wx/mac/carbon/textctrl.h b/include/wx/mac/carbon/textctrl.h index e4871fff87..69615247a2 100644 --- a/include/wx/mac/carbon/textctrl.h +++ b/include/wx/mac/carbon/textctrl.h @@ -83,6 +83,7 @@ public: // load the controls contents from the file virtual bool LoadFile(const wxString& file); + virtual bool LoadFile(const wxString& file, int WXUNUSED(fileType)) { return LoadFile(file); } // sets/clears the dirty flag virtual void MarkDirty(); diff --git a/include/wx/msw/textctrl.h b/include/wx/msw/textctrl.h index c12e9089bc..44cbc3653b 100644 --- a/include/wx/msw/textctrl.h +++ b/include/wx/msw/textctrl.h @@ -68,6 +68,7 @@ public: // load the controls contents from the file virtual bool LoadFile(const wxString& file); + virtual bool LoadFile(const wxString& file, int WXUNUSED(fileType)) { return LoadFile(file); } // clears the dirty flag virtual void MarkDirty(); diff --git a/include/wx/richtext/richtextbuffer.h b/include/wx/richtext/richtextbuffer.h index 28a4fb9832..fa9fd77144 100644 --- a/include/wx/richtext/richtextbuffer.h +++ b/include/wx/richtext/richtextbuffer.h @@ -917,8 +917,8 @@ public: virtual bool SetStyle(const wxRichTextRange& range, const wxTextAttrEx& style, bool withUndo = true); /// Get the text attributes for this position. - virtual bool GetStyle(long position, wxTextAttrEx& style) const; - virtual bool GetStyle(long position, wxRichTextAttr& style) const; + virtual bool GetStyle(long position, wxTextAttrEx& style); + virtual bool GetStyle(long position, wxRichTextAttr& style); /// Test if this whole range has character attributes of the specified kind. If any /// of the attributes are different within the range, the test fails. You diff --git a/include/wx/richtext/richtextctrl.h b/include/wx/richtext/richtextctrl.h index beef94f24d..d1dd775079 100644 --- a/include/wx/richtext/richtextctrl.h +++ b/include/wx/richtext/richtextctrl.h @@ -158,8 +158,10 @@ public: virtual void Remove(long from, long to); // 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 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); // sets/clears the dirty flag virtual void MarkDirty(); @@ -180,9 +182,9 @@ 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); virtual bool SetDefaultStyle(const wxTextAttrEx& style); virtual bool SetDefaultStyle(const wxTextAttr& style); @@ -495,16 +497,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(); diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index a25c2f16e3..ecdbef164f 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -322,7 +322,9 @@ public: // load/save the controls contents from/to the file virtual bool LoadFile(const wxString& file); + virtual bool LoadFile(const wxString& file, int WXUNUSED(fileType)) { return LoadFile(file); } virtual bool SaveFile(const wxString& file = wxEmptyString); + virtual bool SaveFile(const wxString& file, int WXUNUSED(fileType)) { return SaveFile(file); } // sets/clears the dirty flag virtual void MarkDirty() = 0; diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index d3fe3cfdf3..bc16bc9efd 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -1633,7 +1633,7 @@ bool wxRichTextParagraphLayoutBox::SetStyle(const wxRichTextRange& range, const } /// Get the text attributes for this position. -bool wxRichTextParagraphLayoutBox::GetStyle(long position, wxTextAttrEx& style) const +bool wxRichTextParagraphLayoutBox::GetStyle(long position, wxTextAttrEx& style) { wxRichTextObject* obj wxDUMMY_INITIALIZE(NULL); @@ -1652,7 +1652,7 @@ bool wxRichTextParagraphLayoutBox::GetStyle(long position, wxTextAttrEx& style) } /// Get the text attributes for this position. -bool wxRichTextParagraphLayoutBox::GetStyle(long position, wxRichTextAttr& style) const +bool wxRichTextParagraphLayoutBox::GetStyle(long position, wxRichTextAttr& style) { wxRichTextObject* obj wxDUMMY_INITIALIZE(NULL); diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index bd1b6c6e8f..7143227ccc 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -2244,7 +2244,7 @@ const wxTextAttr& wxRichTextCtrl::GetDefaultStyle() const return GetBuffer().GetDefaultStyle(); } -bool wxRichTextCtrl::GetStyle(long position, wxTextAttr& style) const +bool wxRichTextCtrl::GetStyle(long position, wxTextAttr& style) { wxTextAttrEx attr; if (GetBuffer().GetStyle(position, attr)) @@ -2256,12 +2256,12 @@ bool wxRichTextCtrl::GetStyle(long position, wxTextAttr& style) const return false; } -bool wxRichTextCtrl::GetStyle(long position, wxTextAttrEx& style) const +bool wxRichTextCtrl::GetStyle(long position, wxTextAttrEx& style) { return GetBuffer().GetStyle(position, style); } -bool wxRichTextCtrl::GetStyle(long position, wxRichTextAttr& style) const +bool wxRichTextCtrl::GetStyle(long position, wxRichTextAttr& style) { return GetBuffer().GetStyle(position, style); } @@ -2419,7 +2419,7 @@ bool wxRichTextCtrl::LayoutContent(bool onlyVisibleRect) } /// Is all of the selection bold? -bool wxRichTextCtrl::IsSelectionBold() const +bool wxRichTextCtrl::IsSelectionBold() { if (HasSelection()) { @@ -2449,7 +2449,7 @@ bool wxRichTextCtrl::IsSelectionBold() const } /// Is all of the selection italics? -bool wxRichTextCtrl::IsSelectionItalics() const +bool wxRichTextCtrl::IsSelectionItalics() { if (HasSelection()) { @@ -2479,7 +2479,7 @@ bool wxRichTextCtrl::IsSelectionItalics() const } /// Is all of the selection underlined? -bool wxRichTextCtrl::IsSelectionUnderlined() const +bool wxRichTextCtrl::IsSelectionUnderlined() { if (HasSelection()) { @@ -2551,7 +2551,7 @@ bool wxRichTextCtrl::ApplyUnderlineToSelection() } /// Is all of the selection aligned according to the specified flag? -bool wxRichTextCtrl::IsSelectionAligned(wxTextAttrAlignment alignment) const +bool wxRichTextCtrl::IsSelectionAligned(wxTextAttrAlignment alignment) { if (HasSelection()) { -- 2.45.2