Add wxTextEntry::AutoCompleteDirectories().
As we already had MSW-specific AutoCompleteFileNames(), we can just as well also add the also useful AutoCompleteDirectories() to be used with the text controls used for path entry. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68918 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -99,6 +99,7 @@ enum
|
||||
TextEntry_DisableAutoComplete = TextEntry_Begin,
|
||||
TextEntry_AutoCompleteFixed,
|
||||
TextEntry_AutoCompleteFilenames,
|
||||
TextEntry_AutoCompleteDirectories,
|
||||
TextEntry_AutoCompleteCustom,
|
||||
|
||||
TextEntry_SetHint,
|
||||
@@ -174,6 +175,7 @@ protected:
|
||||
void OnDisableAutoComplete(wxCommandEvent& event);
|
||||
void OnAutoCompleteFixed(wxCommandEvent& event);
|
||||
void OnAutoCompleteFilenames(wxCommandEvent& event);
|
||||
void OnAutoCompleteDirectories(wxCommandEvent& event);
|
||||
void OnAutoCompleteCustom(wxCommandEvent& event);
|
||||
|
||||
void OnSetHint(wxCommandEvent& event);
|
||||
@@ -303,6 +305,7 @@ BEGIN_EVENT_TABLE(WidgetsFrame, wxFrame)
|
||||
EVT_MENU(TextEntry_DisableAutoComplete, WidgetsFrame::OnDisableAutoComplete)
|
||||
EVT_MENU(TextEntry_AutoCompleteFixed, WidgetsFrame::OnAutoCompleteFixed)
|
||||
EVT_MENU(TextEntry_AutoCompleteFilenames, WidgetsFrame::OnAutoCompleteFilenames)
|
||||
EVT_MENU(TextEntry_AutoCompleteDirectories, WidgetsFrame::OnAutoCompleteDirectories)
|
||||
EVT_MENU(TextEntry_AutoCompleteCustom, WidgetsFrame::OnAutoCompleteCustom)
|
||||
|
||||
EVT_MENU(TextEntry_SetHint, WidgetsFrame::OnSetHint)
|
||||
@@ -418,6 +421,8 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
|
||||
wxT("Fixed-&list auto-completion"));
|
||||
menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteFilenames,
|
||||
wxT("&Files names auto-completion"));
|
||||
menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteDirectories,
|
||||
wxT("&Directories names auto-completion"));
|
||||
menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteCustom,
|
||||
wxT("&Custom auto-completion"));
|
||||
menuTextEntry->AppendSeparator();
|
||||
@@ -995,6 +1000,21 @@ void WidgetsFrame::OnAutoCompleteFilenames(wxCommandEvent& WXUNUSED(event))
|
||||
}
|
||||
}
|
||||
|
||||
void WidgetsFrame::OnAutoCompleteDirectories(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxTextEntryBase *entry = CurrentPage()->GetTextEntry();
|
||||
wxCHECK_RET( entry, "menu item should be disabled" );
|
||||
|
||||
if ( entry->AutoCompleteDirectories() )
|
||||
{
|
||||
wxLogMessage("Enabled auto completion of directories.");
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogMessage("AutoCompleteDirectories() failed.");
|
||||
}
|
||||
}
|
||||
|
||||
void WidgetsFrame::OnAutoCompleteCustom(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxTextEntryBase *entry = CurrentPage()->GetTextEntry();
|
||||
|
Reference in New Issue
Block a user