C2023-005: Search for annotations, delete causes reposition to first list item

C2023-004: Multiple tabs, closing one repositions to first rather than active
This commit is contained in:
2023-02-28 16:18:17 +00:00
parent 525c8f0650
commit e2a76bdb3a
2 changed files with 20 additions and 1 deletions

View File

@@ -939,11 +939,18 @@ namespace Volian.Controls.Library
if (unitPrefix.EndsWith("#"))
unitPrefix = unitPrefix.Replace("#", string.Empty);
// C2023-005: Lose list position after delete. Save selected index to restore after & don't open the
// section after reset of index (UpdateAnnotationList setting below)
int curindx = lbSrchResults.SelectedIndex;
SearchResults = ItemInfoList.GetListFromAnnotationSearch(DVISearchList, TypeSearchList, AnnotationSearchType, cbxTextSearchAnnotation.Text, cbxCaseSensitiveAnnoText.Checked, unitPrefix);
DisplayResults();
UpdatedAnnotationList = true;
lbSrchResults.SelectedIndex = curindx < 0 ? -1 : curindx - 1;
UpdatedAnnotationList = false;
}
private bool UpdatedAnnotationList = false;
#endregion
#region (ContextMenu)
@@ -1730,6 +1737,7 @@ namespace Volian.Controls.Library
{
if (_LoadingList) return;
if (_ProcessingSelectedValueChanged) return;
if (UpdatedAnnotationList) return;
_ProcessingSelectedValueChanged = true;
// B2021-004: Prevent multiple selections on the Incoming Transitions listbox (disable selections
// for the listbox until all processing is done, listbox is enabled at end of method)