From fc14d031e47e0377d606e28890abd58c59206ddc Mon Sep 17 00:00:00 2001 From: David Bailes Date: Fri, 29 Mar 2019 11:38:18 +0000 Subject: [PATCH] MousePrefs: fix a focus issue Problem: a user can tab to the list, and no list item is the focus, and there is no visual indication of focus. Fix: set the first item to be selected and focused --- src/prefs/MousePrefs.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/prefs/MousePrefs.cpp b/src/prefs/MousePrefs.cpp index af2770b46..41a490a43 100644 --- a/src/prefs/MousePrefs.cpp +++ b/src/prefs/MousePrefs.cpp @@ -83,6 +83,12 @@ void MousePrefs::Populate() PopulateOrExchange(S); // ----------------------- End of main section -------------- CreateList(); + if (mList->GetItemCount() > 0) { + // set first item to be selected (and the focus when the + // list first becomes the focus) + mList->SetItemState(0, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED, + wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED); + } } /// Places controls on the panel and also exchanges data with them.