From 6ac7897946f7a735d63845768c548f59f34fcd91 Mon Sep 17 00:00:00 2001 From: Rich Date: Fri, 24 Mar 2017 19:09:09 +0000 Subject: [PATCH] B2017-043 If the Edit Window is scrolled horizontally then new steps, cautions, notes or tables need to be located with respect to the horizontal scroll location --- PROMS/Volian.Controls.Library/EditItem.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index 46ea46c3..004d7424 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -1925,6 +1925,7 @@ namespace Volian.Controls.Library // Then should center on the wid Limit if (MyItemInfo.FormatStepData.Type.Contains("AER") == false && MyItemInfo.RNOLevel == 0) { + // B2017-043 COLR is used as a Width int colR = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColRTable, MyItemInfo.ColumnMode); rightLimit += colR * MyItemInfo.ColumnMode; center += (colR * MyItemInfo.ColumnMode) / 2; @@ -1935,7 +1936,8 @@ namespace Volian.Controls.Library //int x = myParentEditItem.TextLeft; int x = center - width / 2; if (x + width > rightLimit) x = rightLimit - width; - int colT = MyStepPanel.ToDisplay((int)myStepSectionLayoutData.ColT); + // B2017-043 account for Horizontal Scroll + int colT =MyStepPanel.DisplayRectangle.X + MyStepPanel.ToDisplay((int)myStepSectionLayoutData.ColT); if (x < colT) x = colT; int y = FindTop(myParentEditItem.Bottom); return new Point(x, y); @@ -2630,10 +2632,12 @@ namespace Volian.Controls.Library if (ein.Bottom > ei.Bottom) ei = ein; } } - ItemLocation = new Point(MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColS) + 50, ei.Bottom); + // B2017-043 Account for the Horizonal Scroll position when locating the step + ItemLocation = new Point(MyStepPanel.DisplayRectangle.X + MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColS) + 50, ei.Bottom); } else - ItemLocation = new Point(MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColS) + 50, _MyParentEditItem.Bottom); + // B2017-043 Account for the Horizonal Scroll position when locating the step + ItemLocation = new Point(MyStepPanel.DisplayRectangle.X + MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColS) + 50, _MyParentEditItem.Bottom); } else ItemLocation = new Point(_MyParentEditItem.ItemLocation.X + 20, _MyParentEditItem.Bottom); @@ -2805,7 +2809,8 @@ namespace Volian.Controls.Library //} if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsCaution || MyItemInfo.IsNote)) { - int x = MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT); + // B2017-043 account for Horizontal Scroll + int x = MyStepPanel.DisplayRectangle.X + MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT); int y = Top; if (MyPreviousEditItem == null || !MyPreviousEditItem.MyItemInfo.IsCaution || !MyItemInfo.IsNote) y = FindTop(myTop); @@ -2888,7 +2893,8 @@ namespace Volian.Controls.Library (MyPreviousEditItem == null || (MyPreviousEditItem.MyItemInfo.IsCaution && MyItemInfo.IsNote))) //if ((MyItemInfo.SameRowAsParent && MyItemInfo.IsCaution2) || (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsNote || MyItemInfo.IsCaution))) { - int x = MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT); + // B2017-043 account for Horizontal Scroll + int x = MyStepPanel.DisplayRectangle.X + MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT); if (MyItemInfo.IsNote) x += Width + 6; //Find first sibling