From 0a4ed797b81de0183f1fe6c41c5b190fc32cf35d Mon Sep 17 00:00:00 2001 From: John Date: Thu, 6 Mar 2014 22:22:08 +0000 Subject: [PATCH] Fixed placement of ERG step number (Note) on Deviation Documents --- PROMS/Volian.Controls.Library/EditItem.cs | 14 +++++++++++--- PROMS/Volian.Print.Library/vlnParagraph.cs | 12 +++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index 5b1675a3..9714a413 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -2201,11 +2201,19 @@ namespace Volian.Controls.Library if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsCaution || MyItemInfo.IsNote)) { int x = MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT); - //if (MyItemInfo.ItemID == 1 || MyItemInfo.ItemID == 52) - // Console.WriteLine("here"); + int y = FindTop(myTop); + // Get the "bottom" number of the longest Caution/Note on the step/substep above so that + // we can position properly on the screen. + // EX. Catawba Deviations E-1 step deviation for step 10 + EditItem eitm = (MyParentEditItem.MyPreviousEditItem != null) ? MyParentEditItem.MyPreviousEditItem : MyParentEditItem.MyParentEditItem; + if (eitm != null && eitm.MyBeforeEditItems != null) + { + foreach (EditItem eitmTmp in eitm.MyBeforeEditItems) + y = Math.Max(y, eitmTmp.Bottom); + } if(MyItemInfo.IsNote) x += Width + 6; - Location = new Point(x, FindTop(myTop)); + Location = new Point(x, y); } else Location = new Point(_MyParentEditItem.Left + 20, FindTop(myTop)); diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 2ad83222..571e4875 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -1589,14 +1589,24 @@ namespace Volian.Print.Library if (itemInfo.Cautions != null && !(itemInfo.IsCaution || itemInfo.IsNote)) { if (itemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format) + { + // For deviations, the Cautions are always in the same place. + // Fix for Catawba E-1 deviation for step 10. Has note/caution off of a paragraph instead of HLS + float xoffDev = (float)itemInfo.MyDocStyle.Layout.LeftMargin; yoffLeft = ChildrenLeft.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); + } else yoff = ChildrenAbove.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); } if (itemInfo.Notes != null && !(itemInfo.IsCaution || itemInfo.IsNote)) { if (itemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format) - yoffLeft = Math.Max(yoffLeft, ChildrenLeft.Add(cb, itemInfo.Notes, xoff + 6 + (float)(itemInfo.ActiveFormat.MyStepSectionLayoutData.WidT), yoff, yoff, rnoLevel, maxRNO, formatInfo)); + { + // For deviations, the Cautions are always in the same place. + // Fix for Catawba E-1 deviation for step 10. Has note/caution off of a paragraph instead of HLS + float xoffDev = (float)itemInfo.MyDocStyle.Layout.LeftMargin + 6 + (float)(itemInfo.ActiveFormat.MyStepSectionLayoutData.WidT); + yoffLeft = Math.Max(yoffLeft, ChildrenLeft.Add(cb, itemInfo.Notes, xoffDev, yoff, yoff, rnoLevel, maxRNO, formatInfo)); + } else { // Notes/Cautions span the page. If the right (RNO) column is below current yoff, use the