B2026-090 Populate Step Properties Panel when PROMS restores saved display tabs #833

Merged
jjenko merged 1 commits from B2026-090 into Development 2026-10-29 14:15:04 -04:00
+23 -11
View File
@@ -2426,9 +2426,10 @@ namespace VEPROMS
// when Word procedure tabs are restored.
// C2026-053 leaving this flag in her for now should we decide to trouble-shoot reopening of Word tabs later on.
tc.LoadingSavedProcTabs = true; // we check for this flag in DSOTabPanel.cs when opening Word sections
EditItem LastEditItem = null; //to hold last edit item. Needed in case last tab is a Word Section
foreach (DataRow TabState in DisPlayTabState.Rows)
{
int _ItemID = (int)TabState["ItemID"];
int _ItemID = (int)TabState["ItemID"];
ItemInfo _Procedure = ItemInfo.Get(_ItemID);
// C2026-053 Open procedure tab but only if it's NOT a Word section
// Needed to disable opening saved Word sections - at least for now.
@@ -2439,18 +2440,29 @@ namespace VEPROMS
// SelectedStepTabPanel needs to be set so the print buttons on the ribbon will work.
SelectedStepTabPanel = tc.MyEditItem.MyStepPanel.MyStepTabPanel;
//CSM B2024-090 - if last displaytab item,
//select the steptab panel for it
//and set the EditItem for Find/Replace
//otherwise will cause PROMS to crash if Find clicked before a Tab is given Focus
if ((DisPlayTabState.Rows.IndexOf(TabState) == DisPlayTabState.Rows.Count - 1))
LastEditItem = tc.MyEditItem; //set last tab index
if ((DisPlayTabState.Rows.IndexOf(TabState) == DisPlayTabState.Rows.Count - 1))
{
SelectedStepTabPanel.Select();
dlgFindReplace.MyEditItem = tc.MyEditItem;
SpellChecker.MyEditItem = tc.MyEditItem; //B2025-043 Remember Tabs is not setting the EditItem for the active window causing a PROMS crash when Spell Check
}
}
tc.LoadingSavedProcTabs = false;
}
}
//CSM B2024-090 - if last displaytab item,
//select the steptab panel for it
//and set the EditItem for Find/Replace
//otherwise will cause PROMS to crash if Find clicked before a Tab is given Focus
if (LastEditItem != null)
{
dlgFindReplace.MyEditItem = LastEditItem;
SpellChecker.MyEditItem = LastEditItem; //B2025-043 Remember Tabs is not setting the EditItem for the active window causing a PROMS crash when Spell Check
//B2026-090 Populate Step Properties Panel when PROMS restores saved display tabs
LastEditItem.MyStepPanel.BringToFront();
LastEditItem.MyStepPanel.Select();
Application.DoEvents();
tc_ItemSelectedChanged(this, new ItemSelectedChangedEventArgs(tc.MyEditItem));
}
tc.LoadingSavedProcTabs = false;
}
}
}