From 4bf28412db8cabd569e1284fb8b5073bea28952b Mon Sep 17 00:00:00 2001 From: David Bailes Date: Fri, 10 Aug 2018 16:43:27 +0100 Subject: [PATCH] Manage Macros dialog: a couple of focus issues 1. For both the macros list and the steps list, when focus first moves to the list, an item is selected but not the focus. 2. After editing a step, focus is not returned to that step in the list. Fix for 1: in the calls of SetItemState(), include the wxLIST_STATE_FOCUSED flag. Fix for 2: The fix for 1 fixed 2. Not sure why. --- src/BatchProcessDialog.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index 6128a1f57..0bf119073 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -185,7 +185,8 @@ void ApplyMacroDialog::PopulateMacros() } // Select the name in the list...this will fire an event. - mMacros->SetItemState(item, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); + mMacros->SetItemState(item, wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED, + wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED); if( 0 <= topItem && topItem < (int)mMacros->GetItemCount()) { @@ -703,7 +704,9 @@ void MacrosWindow::PopulateList() if (mSelectedCommand >= (int)mList->GetItemCount()) { mSelectedCommand = 0; } - mList->SetItemState(mSelectedCommand, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); + mList->SetItemState(mSelectedCommand, + wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED, + wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED); if( 0 <= topItem && topItem < (int)mList->GetItemCount()) { // Workaround for scrolling being windows only.