Split wxTextAutoCompleteData in two subclasses

Doing two different things in the same class, using m_isDynamicCompleter
to determine which kind of completion is used, was not very clear, so
create two simple classes each of which does one and one thing only and
create the one we need in wxTextEntry methods.

Note that wxTextAutoCompleteDynamic can assume to always have a valid
wxTextCompleter as otherwise no wxTextAutoCompleteData is needed at all,
which results in more simplifications.

There should be no changes in behaviour.
This commit is contained in:
Vadim Zeitlin
2018-01-27 01:07:18 +01:00
parent d4c84ce745
commit 02f2159aea
2 changed files with 177 additions and 160 deletions

View File

@@ -94,13 +94,11 @@ private:
// implement this to return the associated GtkEntry
virtual GtkEntry *GetEntry() const = 0;
wxTextAutoCompleteData *GetOrCreateCompleter();
// Various auto-completion-related stuff, only used if any of AutoComplete()
// methods are called. Use the function above to access it.
// methods are called.
wxTextAutoCompleteData *m_autoCompleteData;
// It needs to call our GetEditable() method.
// It needs to call our GetEntry() method.
friend class wxTextAutoCompleteData;
bool m_isUpperCase;