Compare commits

...
4 Commits
2 changed files with 26 additions and 14 deletions

No files matched your search

+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;
}
}
}
@@ -3192,7 +3192,7 @@ namespace Volian.Controls.Library
{
int itemID = int.Parse(nd.Attributes.GetNamedItem("id").InnerText);
ItemInfo ii = ItemInfo.Get(itemID);
if (ii.SearchAnnotationText == null && ii.ItemAnnotations != null) ii.SearchAnnotationText = AnnotationInfo.Get(ii.ItemAnnotations[0].AnnotationID).SearchText;
if (ii.SearchAnnotationText == null && ii.ItemAnnotations != null && ii.ItemAnnotations.Count > 0) ii.SearchAnnotationText = AnnotationInfo.Get(ii.ItemAnnotations[0].AnnotationID).SearchText;
SearchResults.AddItemInfo(ii);
}
lbSrchResults.DataSource = SearchResults;
@@ -3214,7 +3214,7 @@ namespace Volian.Controls.Library
int itemID = int.Parse(nd.Attributes.GetNamedItem("id").InnerText);
ItemInfo ii = ItemInfo.Get(itemID);
// B2020-107: The following was needed to set the Step Path result type for annotations
if (ii.SearchAnnotationText == null && ii.ItemAnnotations != null)
if (ii.SearchAnnotationText == null && ii.ItemAnnotations != null && ii.ItemAnnotations.Count > 0)
{
ii.SearchAnnotationText = AnnotationInfo.Get(ii.ItemAnnotations[0].AnnotationID).SearchText;
ii.SearchAnnotationID = ii.ItemAnnotations[0].AnnotationID;
@@ -3245,7 +3245,7 @@ namespace Volian.Controls.Library
{
int itemID = int.Parse(nd.Attributes.GetNamedItem("id").InnerText);
ItemInfo ii = ItemInfo.Get(itemID);
if (ii.SearchAnnotationText == null && ii.ItemAnnotations != null) ii.SearchAnnotationText = AnnotationInfo.Get(ii.ItemAnnotations[0].AnnotationID).SearchText;
if (ii.SearchAnnotationText == null && ii.ItemAnnotations != null && ii.ItemAnnotations.Count > 0) ii.SearchAnnotationText = AnnotationInfo.Get(ii.ItemAnnotations[0].AnnotationID).SearchText;
SearchResults.AddItemInfo(ii);
}
lbSrchResultsIncTrans.DataSource = SearchResults;