From d3830fbd87dfbfbcb77ace605de3a2b6d2773376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Fri, 28 Sep 2018 14:44:10 +0300 Subject: [PATCH] shell32/autocomplete: Implement ACO_USETAB option. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/shell32/autocomplete.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index 5a8e03adbf5..11e9317cdde 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -19,17 +19,9 @@ */ /* - Implemented: - - ACO_AUTOAPPEND style - - ACO_AUTOSUGGEST style - - ACO_UPDOWNKEYDROPSLIST style - - - Handle pwzsRegKeyPath and pwszQuickComplete in Init - TODO: - implement ACO_SEARCH style - implement ACO_FILTERPREFIXES style - - implement ACO_USETAB style - implement ACO_RTLREADING style - implement ResetEnumerator - string compares should be case-insensitive, the content of the list should be sorted @@ -205,7 +197,7 @@ static LRESULT change_selection(IAutoCompleteImpl *ac, HWND hwnd, UINT key) } } } - else if (key == VK_UP) + else if (key == VK_UP || (key == VK_TAB && (GetKeyState(VK_SHIFT) & 0x8000))) sel = ((sel - 1) < -1) ? count - 1 : sel - 1; else sel = ((sel + 1) >= count) ? -1 : sel + 1; @@ -391,6 +383,14 @@ static LRESULT ACEditSubclassProc_KeyDown(IAutoCompleteImpl *ac, HWND hwnd, UINT if (select_item_with_return_key(ac, hwnd)) return 0; break; + case VK_TAB: + if ((ac->options & (ACO_AUTOSUGGEST | ACO_USETAB)) == (ACO_AUTOSUGGEST | ACO_USETAB) + && IsWindowVisible(ac->hwndListBox) && !(GetKeyState(VK_CONTROL) & 0x8000)) + { + ac->no_fwd_char = '\t'; + return change_selection(ac, hwnd, wParam); + } + break; case VK_UP: case VK_DOWN: case VK_PRIOR: @@ -646,7 +646,6 @@ static HRESULT WINAPI IAutoComplete2_fnInit( if (This->options & ACO_SEARCH) FIXME(" ACO_SEARCH not supported\n"); if (This->options & ACO_FILTERPREFIXES) FIXME(" ACO_FILTERPREFIXES not supported\n"); - if (This->options & ACO_USETAB) FIXME(" ACO_USETAB not supported\n"); if (This->options & ACO_RTLREADING) FIXME(" ACO_RTLREADING not supported\n"); if (!hwndEdit || !punkACL)