diff --git a/PROMS/Volian.Controls.Library/DisplayText.cs b/PROMS/Volian.Controls.Library/DisplayText.cs index fa1e62f5..dcc4b147 100644 --- a/PROMS/Volian.Controls.Library/DisplayText.cs +++ b/PROMS/Volian.Controls.Library/DisplayText.cs @@ -361,7 +361,13 @@ namespace Volian.Controls.Library Dictionary roUsgReplacements = BuildRoUsgReplacements(_MyItem.MyContent.ContentRoUsages); _MyItem.DTS = DateTime.Now; _MyItem.UserID = Environment.UserName; - _MyItem.Save(); + // Do the Save once rather than multiple times + bool saveAtOnce = false; + // If it is a new Item, save it before the transitions and ROs are saved + if (_MyItem.ItemID < 0) + _MyItem.Save(); + else + saveAtOnce = true; if (ctReplacements.Count > 0) { EditText = FixCtReplacements(EditText, ctReplacements); @@ -369,13 +375,15 @@ namespace Volian.Controls.Library foreach (ContentTransition ct in ctReplacements.Values) using (TransitionInfo tran = TransitionInfo.Get(ct.TransitionID)) _MyItem.MyContent.FixTransitionText(tran); - _MyItem.Save(); + saveAtOnce = true; } if (roUsgReplacements.Count > 0) { EditText = FixRoUsgReplacements(EditText, roUsgReplacements); - _MyItem.Save(); + saveAtOnce = true; } + if(saveAtOnce) + _MyItem.Save(); modtext = EditText; } else diff --git a/PROMS/Volian.Controls.Library/StepItem.cs b/PROMS/Volian.Controls.Library/StepItem.cs index b8aaa154..d503fde0 100644 --- a/PROMS/Volian.Controls.Library/StepItem.cs +++ b/PROMS/Volian.Controls.Library/StepItem.cs @@ -2049,12 +2049,30 @@ namespace Volian.Controls.Library return MyItemInfo.MyContent.ToString(); } } + private StepItem AERStepItem + { + get + { + if (MyParentStepItem != null) + { + if (MyParentStepItem.RNOLevel < RNOLevel) + return MyParentStepItem; + else + return MyParentStepItem.AERStepItem; + } + else + { + return MyPreviousStepItem.AERStepItem; + } + } + } /// /// Adjust the Location of all items below the current item. /// internal void AdjustLocation() { if (RNORight) MoveRNO(); // This is needed when an AER is Deleted that has an RNO. + if (RNOLevel>0) AERStepItem.AdjustLocation(); StepItem nextStepItem = NextDownStepItem; //if (MyID == 2138) // Console.WriteLine("2138"); diff --git a/PROMS/Volian.Controls.Library/StepPanel.cs b/PROMS/Volian.Controls.Library/StepPanel.cs index e8341044..cb89f0ef 100644 --- a/PROMS/Volian.Controls.Library/StepPanel.cs +++ b/PROMS/Volian.Controls.Library/StepPanel.cs @@ -47,6 +47,7 @@ namespace Volian.Controls.Library private Font _StepFont = new Font("Arial", 10); private Color _ActiveColor = Color.SkyBlue; private Color _InactiveColor = Color.Linen; + private Color _AnnotationColor = Color.FromArgb(255, 255, 128); private Color _TabColor = Color.Beige; private Color _PanelColor = Color.LightGray; // Whether panel is in view or edit mode. Toggled from steprtb @@ -501,6 +502,14 @@ namespace Volian.Controls.Library set { _ActiveColor = value; } } /// + /// Gets or Sets the Annotation backcolor for StepRTBs in the Panel + /// + public Color AnnotationColor + { + get { return _AnnotationColor; } + set { _AnnotationColor = value; } + } + /// /// Gets or sets the InActive Color for the Panel /// public Color InactiveColor diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index e8d1a5fa..6003d7d0 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -172,7 +172,10 @@ namespace Volian.Controls.Library public void SetBackColor() { if (MyStepItem == null || MyStepItem.MyStepPanel == null) return; - if (!Focused)BackColor = _MyItemInfo.ItemAnnotationCount == 0 ? MyStepItem.MyStepPanel.InactiveColor : Color.FromArgb(255, 255, 128); + if (Focused) // If active Set BackColor to the active color + BackColor = MyStepItem.MyStepPanel.ActiveColor; + else // Otherwise Set the BackColor to either the InactiveColor or the AnnotationColor + BackColor = _MyItemInfo.ItemAnnotationCount == 0 ? MyStepItem.MyStepPanel.InactiveColor : MyStepItem.MyStepPanel.AnnotationColor; } public void HighlightBackColor() {