From 9cbbd3e9de65d289c2b74d1b8074ba8eec0af00c Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 20 Jun 2018 14:47:14 +0000 Subject: [PATCH] B2018-096 AEP 082.002CD Note Box overlapping Step Box --- PROMS/Volian.Print.Library/vlnBox.cs | 18 +++++++++++++++++- PROMS/Volian.Print.Library/vlnParagraph.cs | 17 ++++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/PROMS/Volian.Print.Library/vlnBox.cs b/PROMS/Volian.Print.Library/vlnBox.cs index f1f5331f..84dff6e4 100644 --- a/PROMS/Volian.Print.Library/vlnBox.cs +++ b/PROMS/Volian.Print.Library/vlnBox.cs @@ -75,7 +75,21 @@ namespace Volian.Print.Library const string BoxAsteriskTopBottom = "*.*.*. . . .*.*. .*. . "; // fnp const string BoxLineTopBottom = "\x2500.\x2500.\x2500. . . .\x2500.\x2500. .\x2500. . "; // fnp const string BoxAsteriskTopBotton2 = " .*. . . . . . . .*. . "; // Robinson (CPL) - + public vlnBox MyParentBox + { + get + { + // B2018-096 AEP 082.002CD Note Box overlapping Step Box + vlnParagraph parent = MyParent.MyParent; + if(parent == null) return null; + if (!parent.MyItemInfo.FormatStepData.BoxIt) return null; + if (parent.PartsContainer == null) return null; + foreach(vlnPrintObject obj in parent.PartsContainer) + if (obj is vlnBox) + return(obj as vlnBox); + return null; + } + } public override float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin) { if (MyBox == null) return yPageStart; @@ -93,6 +107,8 @@ namespace Volian.Print.Library myBoxLeftAdj = float.Parse(MyParent.MyItemInfo.ActiveFormat.MyStepSectionLayoutData.BoxLeftAdj); left += myBoxLeftAdj; float right = (float)MyParent.MyItemInfo.MyDocStyle.Layout.LeftMargin + (float)(MyBox.End ?? DefEnd); + if (MyParentBox != null)// B2018-096 AEP 082.002CD Note Box overlapping Step Box + right = (float)MyParent.MyItemInfo.MyDocStyle.Layout.LeftMargin + MyParentBox.DefEnd - SixLinesPerInch/2; right += myBoxLeftAdj; iTextSharp.text.Color boxColor = new iTextSharp.text.Color(PrintOverride.OverrideBoxColor(System.Drawing.Color.Black)); cb.SetColorStroke(boxColor); diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 808d45b0..d02a5c1b 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -5330,8 +5330,8 @@ namespace Volian.Print.Library // else // xoff = XOffset; //} - - vlnHeader myHeader = new vlnHeader(this, cb, itemInfo.MyHeader.Text, itemInfo.MyHeader.CleanText.TrimStart(" ".ToCharArray()), xoff + _MyBoxLeftAdj, YOffset, itemInfo.MyHeader.MyFont); + // B2018-096 AEP 082.002CD Note Box overlapping Step Box + vlnHeader myHeader = new vlnHeader(this, cb, itemInfo.MyHeader.Text, itemInfo.MyHeader.CleanText.TrimStart(" ".ToCharArray()), xoff + AdjustHeader + _MyBoxLeftAdj, YOffset, itemInfo.MyHeader.MyFont); PartsAbove.Add(myHeader); //return myHeader.Height + (!MyItemInfo.MyDocStyle.SpecialStepsFoldout || (MyItemInfo.MyDocStyle.ExtraLineHeader && (MyItemInfo.IsCaution || MyItemInfo.IsNote)) ? SixLinesPerInch : 0); // Only use SpaceIn property for Cautions or Notes @@ -6028,6 +6028,12 @@ namespace Volian.Print.Library get { return _CheckOffWidth; } set { _CheckOffWidth = value; } } + private float _AdjustHeader = 0;// B2018-096 AEP 082.002CD Note Box overlapping Step Box + public float AdjustHeader + { + get { return _AdjustHeader; } + set { _AdjustHeader = value; } + } public void AdjustWidth(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo, vlnTab myTab) { int? bxIndx = itemInfo.IsStep ? itemInfo.FormatStepData.StepLayoutData.STBoxindex : null; @@ -6154,7 +6160,12 @@ namespace Volian.Print.Library Width = (float)formatInfo.MyStepSectionLayoutData.WidT - tabWidth; } else - Width = _WidthAdjustBox + (float)bx.TxtWidth - tabWidth; // add 1 to get it to wrap like 16Bit + { + float oldWidth = _WidthAdjustBox + (float)bx.TxtWidth - tabWidth; // add 1 to get it to wrap like 16Bit + // B2018-096 AEP 082.002CD Note Box overlapping Step Box + Width = Math.Min(MyParent.Width + MyParent.XOffset - XOffset, oldWidth); + AdjustHeader = (Width - oldWidth)/2; + } } else if ((itemInfo.IsCaution || itemInfo.IsNote) && !itemInfo.FormatStepData.UseOldTemplate) {