Add support for dynamic auto-completion in wxTextEntry.
Add wxTextCompleter class which allows to return the possible completions dynamically and wxTextCompleter::AutoComplete() overload using it. So far this is only implemented for wxMSW. Also fix calling wxTextEntry::AutoComplete(wxArrayString) multiple times under MSW, this didn't correctly update the list of shown completions before. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/textentry.h"
|
||||
#include "wx/textcompleter.h"
|
||||
#include "wx/clipbrd.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -368,4 +369,22 @@ bool wxTextEntryBase::SendTextUpdatedEvent(wxWindow *win)
|
||||
return win->HandleWindowEvent(event);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// auto-completion stubs
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxTextCompleter::~wxTextCompleter()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxTextEntryBase::DoAutoCompleteCustom(wxTextCompleter *completer)
|
||||
{
|
||||
// We don't do anything here but we still need to delete the completer for
|
||||
// consistency with the ports that do implement this method and take
|
||||
// ownership of the pointer.
|
||||
delete completer;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // wxUSE_TEXTCTRL || wxUSE_COMBOBOX
|
||||
|
||||
Reference in New Issue
Block a user