From 143e55b8df8973c54c096fee13d9758b258feaa8 Mon Sep 17 00:00:00 2001 From: Jonathan Dagresta Date: Fri, 13 May 2016 15:30:13 +0200 Subject: [PATCH] Ensure wxGenericListCtrl item selected from keyboard is visible When using the keyboard to select an item by typing the first characters of its name, we need to make the item visible in addition to selecting it. See #16336. (cherry picked from commit 306597c4fa88d3fdb03d013ed44592a36fe671e3) --- docs/changes.txt | 1 + src/generic/listctrl.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 357baea490..d7c9757ddf 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -614,6 +614,7 @@ wxGTK: - Fix coordinates of wxSetCursorEvent propagated to parent windows. - Fix GTK+ warnings when refreshing wxListCtrl items (Scott Talbert). - Fix using wxHTTP and wxFTP from worker thread. +- Make items selected from keyboard visible in wxListCtrl (Jonathan Dagresta). wxMSW: diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 8dee581a43..eba507cec6 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2994,6 +2994,7 @@ void wxListMainWindow::OnChar( wxKeyEvent &event ) SetItemState(item, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED); + EnsureVisible(item); // Reset the bell flag if it had been temporarily disabled // before.