From: Vadim Zeitlin Date: Sun, 17 Apr 2011 23:14:11 +0000 (+0000) Subject: Refactor: extract wxTextCompleterFixed from wxMSW to a header. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ed7dda9251cb9dd224fcfabcf067520992b18b88?hp=f0cc899914c55916cf09a033a7b2865717caffc7 Refactor: extract wxTextCompleterFixed from wxMSW to a header. This class will be used in other ports too so don't make it private to wxMSW (although it still remains private to wxWidgets for now as it doesn't make much sense to use it in user code). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67525 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/textcompleter.h b/include/wx/textcompleter.h index 2e084c9e03..7e9dd83b6f 100644 --- a/include/wx/textcompleter.h +++ b/include/wx/textcompleter.h @@ -55,5 +55,33 @@ private: wxDECLARE_NO_COPY_CLASS(wxTextCompleterSimple); }; +// ---------------------------------------------------------------------------- +// wxTextCompleterFixed: Trivial wxTextCompleter implementation which always +// returns the same fixed array of completions. +// ---------------------------------------------------------------------------- + +// NB: This class is private and intentionally not documented as it is +// currently used only for implementation of completion with the fixed list +// of strings only by wxWidgets itself, do not use it outside of wxWidgets. + +class wxTextCompleterFixed : public wxTextCompleterSimple +{ +public: + void SetCompletions(const wxArrayString& strings) + { + m_strings = strings; + } + + virtual void GetCompletions(const wxString& WXUNUSED(prefix), + wxArrayString& res) + { + res = m_strings; + } + +private: + wxArrayString m_strings; +}; + + #endif // _WX_TEXTCOMPLETER_H_ diff --git a/src/msw/textentry.cpp b/src/msw/textentry.cpp index be0e6dbb45..a6a92c1024 100644 --- a/src/msw/textentry.cpp +++ b/src/msw/textentry.cpp @@ -494,27 +494,6 @@ public: } private: - // Trivial wxTextCompleter implementation which always returns the same - // fixed array of completions. - class wxTextCompleterFixed : public wxTextCompleterSimple - { - public: - void SetCompletions(const wxArrayString& strings) - { - m_strings = strings; - } - - virtual void GetCompletions(const wxString& WXUNUSED(prefix), - wxArrayString& res) - { - res = m_strings; - } - - private: - wxArrayString m_strings; - }; - - // Must be called after changing the values to be returned by wxIEnumString // to really make the changes stick. void DoRefresh()