Implement auto complete in generic wxSearchCtrl

Just forward the relevant methods to the embedded wxTextCtrl.

Closes #17519.
This commit is contained in:
Eric Jensen
2016-05-07 01:49:22 +02:00
committed by Vadim Zeitlin
parent e85b8f1a4b
commit e7a526604c
3 changed files with 24 additions and 0 deletions

View File

@@ -81,6 +81,7 @@ All (GUI):
- Make wxDataViewCtrl::Expand() expand ancestors in native ports too.
- Add wxDataViewCtrl::SetHeaderAttr().
- Add wxListCtrl::SetHeaderAttr().
- Implement auto complete in generic wxSearchCtrl (Eric Jensen).
wxGTK:

View File

@@ -166,6 +166,11 @@ public:
virtual void SelectAll() wxOVERRIDE;
virtual void SetEditable(bool editable) wxOVERRIDE;
// Autocomplete
virtual bool DoAutoCompleteStrings(const wxArrayString &choices) wxOVERRIDE;
virtual bool DoAutoCompleteFileNames(int flags) wxOVERRIDE;
virtual bool DoAutoCompleteCustom(wxTextCompleter *completer) wxOVERRIDE;
#if 0
// override streambuf method

View File

@@ -820,6 +820,24 @@ bool wxSearchCtrl::SetBackgroundColour(const wxColour& colour)
return true;
}
// Autocomplete
bool wxSearchCtrl::DoAutoCompleteStrings(const wxArrayString &choices)
{
return m_text->AutoComplete( choices );
}
bool wxSearchCtrl::DoAutoCompleteFileNames(int flags)
{
return flags == wxFILE ? m_text->AutoCompleteFileNames() : m_text->AutoCompleteDirectories();
}
bool wxSearchCtrl::DoAutoCompleteCustom(wxTextCompleter *completer)
{
return m_text->AutoComplete(completer);
}
// search control generic only
void wxSearchCtrl::SetSearchBitmap( const wxBitmap& bitmap )
{