Split wxTextCompleter into a base class and wxTextCompleterSimple.

Allow overriding either the iterator-like methods of the base class or the
single and possibly more convenient, albeit slightly less efficient, method of
the derived wxTextCompleterSimple class.

This makes it possible to completely delegate to wxTextCompleter from wxMSW
IEnumString implementation and actually makes the code there easier, even if
it it still not quite trivial because of multi-threading concerns.

It also would make it possible to show the completions progressively, as they
are retrieved, in a future generic implementation of auto-completion (MSW
native implementation doesn't do this unfortunately and waits until all of the
completions become available before showing them).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67515 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-04-16 17:27:34 +00:00
parent e71e4c932a
commit 85047589a9
5 changed files with 252 additions and 120 deletions

View File

@@ -1006,7 +1006,7 @@ void WidgetsFrame::OnAutoCompleteCustom(wxCommandEvent& WXUNUSED(event))
// known. This allows to avoid building the full 676000 item list of
// possible strings all at once as the we have 1000 possibilities for the
// first word (000..999) and 676 (aa..zz) for the second one.
class CustomTextCompleter : public wxTextCompleter
class CustomTextCompleter : public wxTextCompleterSimple
{
public:
virtual void GetCompletions(const wxString& prefix, wxArrayString& res)