diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 648453bf..072e41c8 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -1358,7 +1358,8 @@ namespace VEPROMS.CSLA.Library // the addition of the parent.IsNote, the note was breaking between 2 ANDs (the 1st AND was a // steplevel of 5, but the 2nd was a steplevel of 4). If something similar is seen with Cautions, // that check could be added. - if (!item.IsRNOPart && !item.IsHigh && (item.MyPrevious == null || (((item.ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.EnhancedBackgrounds) != E_PurchaseOptions.EnhancedBackgrounds) && item.MyParent.IsNote))) + if (!item.IsRNOPart && !item.IsHigh && (item.MyPrevious == null || (((item.ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.EnhancedBackgrounds) != E_PurchaseOptions.EnhancedBackgrounds) + && item.MyParent != null && item.MyParent.IsNote))) level += firstInc; else firstInc = 0; @@ -3866,14 +3867,14 @@ namespace VEPROMS.CSLA.Library { if (IsStep) { - _MyTab = new Tab(AdjustForTextSubFollowsTextStyle(FormatStepData.TabData.Font)); + MyTab = new Tab(AdjustForTextSubFollowsTextStyle(FormatStepData.TabData.Font)); _MyHeader = new MetaTag(FormatStepData.TabData.Font); _MyFooter = new MetaTag(FormatStepData.TabData.Font); SetTabText(); } else { - _MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.Font); + MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.Font); _MyHeader = null; _MyFooter = null; _MyTab.CleanText = DisplayNumber; @@ -5400,7 +5401,7 @@ namespace VEPROMS.CSLA.Library public string Text { get { return _Text; } - set { _Text = value; } + set { _Text = value; } } public string CleanText; // all tokens removed public MetaTag() @@ -7533,7 +7534,7 @@ namespace VEPROMS.CSLA.Library //private int? _TemplateColumnMode public override void SetupTags() { - _MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.SectData.SectionNumber.Font); + MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.SectData.SectionNumber.Font); string sectTab = GetSectionTab(false); _MyTab.Text = sectTab; _MyTab.CleanText = sectTab.PadRight(20); @@ -7779,7 +7780,7 @@ namespace VEPROMS.CSLA.Library // B2016-160 Support transitions to sections VE_Font fnt = new VE_Font("Arial", 10, E_Style.None, 10); if (FormatStepData != null) fnt = FormatStepData.TabData.Font; - _MyTab = new Tab(AdjustForTextSubFollowsTextStyle(fnt)); + MyTab = new Tab(AdjustForTextSubFollowsTextStyle(fnt)); MyHeader = new MetaTag(fnt); MyFooter = new MetaTag(fnt); SetTabText(); diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index 5ce1cefa..74d8d7a1 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -352,7 +352,7 @@ namespace VEPROMS.CSLA.Library // Refresh ItemInfo to update Previous using (Item item = Get()) ItemInfo.Refresh(item); // Update all of the content records that have transitions that point to the Siblings or Sibling Children of the new item - tmp.UpdateTransitionText(); + tmp.ResetOrdinal(); // B2020-043: Fix transition text (was updatetransitiontext) tmp.UpdateROText(); OnNewSiblingBefore(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Before)); ((ItemInfo)ActiveParent).MyContent.RefreshContentParts(); @@ -2173,6 +2173,7 @@ namespace VEPROMS.CSLA.Library public void ResetOrdinal() { ResetOrdinal(ItemID); + Application.DoEvents(); // B2020-043: Fix transition text } public static void DeleteItemInfoAndChildren(int itemID) { @@ -2320,10 +2321,6 @@ namespace VEPROMS.CSLA.Library nextItem.RefreshItemParts(); //nextItem.ResetOrdinal(); - UpdateTransitionText calls ResetOrdinal //_MyTimer.ActiveProcess = "UpdateTransitionText"; - if(prevItem != null) - prevItem.UpdateTransitionText(); - else - nextItem.UpdateTransitionText(); } else if (prevItem != null) { @@ -2332,10 +2329,14 @@ namespace VEPROMS.CSLA.Library //_MyTimer.ActiveProcess = "ResetOrdinal"; if (prevItem.IsCaution || prevItem.IsNote) prevItem.ResetOrdinal(); //_MyTimer.ActiveProcess = "UpdateTransitionText"; - prevItem.UpdateTransitionText(); } //_MyTimer.ActiveProcess = "DeleteItemInfoAndChildren"; ItemInfo.DeleteItemInfoAndChildren(item.ItemID); // Dispose ItemInfo and Children + if (prevItem != null) + prevItem.UpdateTransitionText(); + else + nextItem.ResetOrdinal(); // B2020-043: Fix transition text, code moved from above, so that DeleteItemInfoAndChildren is called first. + } catch (Exception ex) { diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index b04c3f91..4b35f6d7 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -759,7 +759,7 @@ namespace Volian.Controls.Library { RefreshTab(); - if (_MyAfterEditItems != null) foreach (EditItem chld in _MyAfterEditItems) chld.SetAllTabs(); + if (_MyAfterEditItems != null) _MyAfterEditItems[0].SetAllTabs(); // B2020-043: used to loop through all, but then recursion would redo. if (_MyNextEditItem != null) _MyNextEditItem.SetAllTabs(); // Update the RNO tab if it exists - RHM 20100106 if (_MyRNOEditItems != null) foreach (EditItem chld in _MyRNOEditItems) chld.SetAllTabs(); @@ -1018,6 +1018,11 @@ namespace Volian.Controls.Library //Console.Write(",\"Parent\","); } //_MyTimer.ShowElapsedTimes("DeleteItem"); + if (newFocus != null) // B2020-043: Fix transition text when previous text is deleted + { + newFocus.SetAllTabs(); + newFocus.MyItemInfo.UpdateTransitionText(); + } return newFocus; } @@ -1409,6 +1414,7 @@ namespace Volian.Controls.Library AddGridIfNeeded(newItemInfo); AddImageIfNeeded(newItemInfo); DoAddSiblingBefore(newItemInfo, updateSelection); + newItemInfo.UpdateTransitionText(); // B2020-043: fix transition text when a step is inserted before if (MyStepPanel.SelectedEditItem is RTBItem) { RTBItem rtbi = MyStepPanel.SelectedEditItem as RTBItem;