From ee57834d9d5b195443edade7780131310e0fbf4d Mon Sep 17 00:00:00 2001 From: John Date: Mon, 28 Jan 2013 16:37:22 +0000 Subject: [PATCH] Bug fix B2013-015. Fixed a refresh problem that sometimes happens when you delete a step. Bug fix B2013-016, added a check for the existence of the path assigned to the roapp environment variable --- PROMS/Volian.Controls.Library/EditItem.cs | 14 ++++++++++++++ PROMS/Volian.Controls.Library/StepTabRibbon.cs | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index 0418899b..ad21a47a 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -683,6 +683,20 @@ namespace Volian.Controls.Library newFocus.AdjustLocation(); //newFocus.ShowTops(""); //_MyTimer.ShowElapsedTimes("RemoveItem"); + ForceEditItemRefresh(newFocus); + } + + private static void ForceEditItemRefresh(EditItem newFocus) + { + // bug fix + // need to force a refresh from the level above the step that was removed. + // this fixes a problem where the following step/substep wasn't shown on the screen (but was there) + // and fixes a problem where the sequence numbers were off by one + // and fixes a problem where an edit window would end up on top of the ones above it + EditItem ei = newFocus; + while (ei.MyPreviousEditItem != null) ei = ei.MyPreviousEditItem; + if (ei.MyParentEditItem != null) + ei.MyParentEditItem.Expand(true); } public EditItem DeleteItem() { diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 0a20c667..dfb18b63 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -1634,11 +1634,23 @@ namespace Volian.Controls.Library return; } string roapp = Environment.GetEnvironmentVariable("roapp"); - if (roapp == null) + if (roapp == null || roapp == string.Empty) { - MessageBox.Show("Could not find path to Ro Editor, check 'roapp' environment variable"); + MessageBox.Show("The 'roapp' environment variable needs to be set to the path of the RO Editor\n\n Ex: C:\\VE-PROMS.NET\\Bin\\roeditor.exe", "Environment Variable Error"); return; } + if (!File.Exists(roapp)) + { + string errtxt = string.Format("Could not find path to Referenced Objects Editor:\n\n roapp = {0}\n\n Verify the path assigned to the 'roapp' environment variable", roapp); + MessageBox.Show(errtxt, "Environment Variable Error"); + //MessageBox.Show("Could not find path to Ro Editor, check 'roapp' environment variable","Environment Variable Error"); + return; + } + //if (roapp == null) + //{ + // MessageBox.Show("Could not find path to Ro Editor, check 'roapp' environment variable"); + // return; + //} if (MyDVI == null || MyDVI.DocVersionAssociationCount < 1) { MessageBox.Show("Could not find associated path for ro data.");