B2021-004: Multiple selections in the Search’s Incoming Transitions list box.

This commit is contained in:
Kathy Ruffing 2021-03-26 13:28:54 +00:00
parent 8c861c6b23
commit 4168218dc9
2 changed files with 26 additions and 3 deletions

View File

@ -1270,6 +1270,7 @@ namespace Volian.Controls.Library
this.grpPanSearchResults.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.grpPanSearchResults.Name = "grpPanSearchResults";
this.grpPanSearchResults.Size = new System.Drawing.Size(369, 268);
this.grpPanSearchResults.MouseDown += GrpPanSearchResults_MouseDown;
//
//
//
@ -1688,6 +1689,7 @@ namespace Volian.Controls.Library
}
#endregion
private DevComponents.DotNetBar.TabControl tabSearchTypes;

View File

@ -1220,19 +1220,35 @@ namespace Volian.Controls.Library
didcheck = false;
JustDidSelection = false;
}
private void GrpPanSearchResults_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
// B2021-004: If a multiple selection occurred in the results list for Incoming Transitions, tell user that
// processing is occurring
if (!lbSrchResultsIncTrans.Enabled) FlexibleMessageBox.Show("Processing a request to open a procedure. Try again when complete.",
"Try Again", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private bool _ProcessingSelectedValueChanged = false;
private void lbSrchResults_SelectedValueChanged(object sender, EventArgs e)
{
if (_LoadingList) return;
if (_ProcessingSelectedValueChanged) 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)
if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4])
{
lbSrchResultsIncTrans.Enabled = false;
lbSrchResultsIncTrans.UseWaitCursor = true;
}
JustDidSelection = true;
ListBox mylb = sender as ListBox;
// If the list is being refreshed, then set the selection index to -1 (no selection)
if (_SearchResults.RefreshingList && lbSrchResults.SelectedIndex != -1)
lbSrchResultsIncTrans.SelectedIndex = lbSrchResults.SelectedIndex = -1;
if (mylb != null && _SearchResults.RefreshingList && mylb.SelectedIndex != -1)
mylb.SelectedIndex = -1;
else
{
_ItemInfo = (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4])? lbSrchResultsIncTrans.SelectedValue as ItemInfo : lbSrchResults.SelectedValue as ItemInfo;
_ItemInfo = (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4]) ? lbSrchResultsIncTrans.SelectedValue as ItemInfo : lbSrchResults.SelectedValue as ItemInfo;
if ((tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[1]) && (_ItemInfo != null))
{
// B2020-019: Don't set the CurrentAnnotation to an annotation in a procedure that cannot be opened.
@ -1263,6 +1279,11 @@ namespace Volian.Controls.Library
}
}
_ProcessingSelectedValueChanged = false;
if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4])
{
lbSrchResultsIncTrans.Enabled = true;
lbSrchResultsIncTrans.UseWaitCursor = false;
}
}
private void cmbResultsStyle_SelectedValueChanged(object sender, EventArgs e)