From fdeb055bde4a2e74f1e5d7a7f9ea6b788561b9ec Mon Sep 17 00:00:00 2001 From: Kathy Date: Tue, 18 Mar 2014 12:13:54 +0000 Subject: [PATCH] =?UTF-8?q?Point=20Beach=20backgrounds:=20Added=20support?= =?UTF-8?q?=20for=20continue=20message;=20don=E2=80=99t=20add=20posadjust?= =?UTF-8?q?=20to=20children=20of=20same=20type;=20add=20support=20for=20Li?= =?UTF-8?q?mitWidToPageWid=20Added=20support=20for=20ProcDescr2=20pagelist?= =?UTF-8?q?=20item=20&=20support=20for=20ProcDescr1=20=3D=20{null}=20(inhe?= =?UTF-8?q?ritance=20was=20causing=20it=20to=20print=20when=20it=20shouldn?= =?UTF-8?q?=E2=80=99t=20have)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Volian.Print.Library/VlnSvgPageHelper.cs | 34 ++++++++++++++++++- PROMS/Volian.Print.Library/vlnParagraph.cs | 21 +++++++++++- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index 52713636..296e47b7 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -1219,7 +1219,10 @@ namespace Volian.Print.Library string matchStr = (pd.MatchProcNumber.StartsWith("*}")) ? pd.MatchProcNumber.Substring(2) : pd.MatchProcNumber; if (procnum.Contains(matchStr)) { - plstr = pd.ProcDescr1; + if (pd.ProcDescr1 == "{null}") // used to override fmt file inheritance & set null/empty string + plstr = ""; + else + plstr = pd.ProcDescr1; break; } if (pd.MatchProcNumber == "@") @@ -1236,6 +1239,35 @@ namespace Volian.Print.Library } } break; + case "{PROCDES2}": + ProcDescrList pdl2 = section.ActiveFormat.PlantFormat.FormatData.PrintData.ProcDescrList; + if (pdl2 != null && pdl2.Count > 0) + { + string procnum = section.MyProcedure.MyContent.Number; + foreach (ProcDescr pd in pdl2) + { + if (pd.MatchProcNumber != null) + { + string matchStr = (pd.MatchProcNumber.StartsWith("*}")) ? pd.MatchProcNumber.Substring(2) : pd.MatchProcNumber; + if (procnum.Contains(matchStr)) + { + plstr = pd.ProcDescr2; + break; + } + if (pd.MatchProcNumber == "@") + { + if (Regex.IsMatch(procnum, "^[A-Za-z]+$")) + plstr = pd.ProcDescr2; + else + plstr = ""; + break; + } + } + else + plstr = "UNKNOWN"; + } + } + break; case "{CURDATE}": DateTime thisDate1 = DateTime.Today; plstr = plstr.Replace(token, thisDate1.ToString("MMMM dd, yyyy")); diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 571e4875..2b5743cc 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -290,6 +290,7 @@ namespace Volian.Print.Library get { return _PageBreakOnStep; } set { _PageBreakOnStep = value; } } + private float WidthNoLimit = 0; private vlnTable _MyGrid; public vlnTable MyGrid { @@ -1007,6 +1008,8 @@ namespace Volian.Print.Library if (myMsg != null && myMsg != "") { yPageStart -= 2 * SixLinesPerInch;// Allow two lines for top continue message + if (myMsg.IndexOf(@"%3d") > -1) + myMsg = myMsg.Replace(@"%3d", MyItemInfo.MyHLS.Ordinal.ToString()); if (myMsg.IndexOf(@"%d") > -1) myMsg = myMsg.Replace(@"%d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim(" .".ToCharArray())); if (myMsg.IndexOf(@"%c") > -1) @@ -1184,6 +1187,8 @@ namespace Volian.Print.Library myMsg = myMsg.Replace(@"%0d", tb.Trim(" .".ToCharArray())); if (myMsg.IndexOf(@"%2d") > -1) myMsg = myMsg.Replace(@"%2d", tb.Trim(" .".ToCharArray()).PadLeft(2)); + if (myMsg.IndexOf(@"%3d") > -1) + myMsg = myMsg.Replace(@"%3d", MyItemInfo.MyHLS.Ordinal.ToString()); return myMsg; } private vlnParagraph TopMostChild @@ -1855,8 +1860,20 @@ namespace Volian.Print.Library CalculateXOffsetGridOrFigure(itemInfo, maxRNO, formatInfo); } else - if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null) XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); + if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null && (itemInfo.IsHigh || (!itemInfo.IsHigh && itemInfo.MyContent.Type != itemInfo.MyParent.MyContent.Type))) XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); + // point beach wpb subformats 20 & 22 were printing some text past right margin. Limit the width to the right margin, i.e. pagewid + if (itemInfo.ActiveFormat.MyStepSectionPrintData.LimitWidToPageWid) + { + float lim = (MyTab == null ? (XOffset - (float)itemInfo.MyDocStyle.Layout.LeftMargin) : MyTab.XOffset + MyTab.Width) + Width; + float docStyleLim = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin; + + if (lim > docStyleLim) + { + WidthNoLimit = Width; // Use this width to calculate childrens' width, without this, code was making children to narrow! + Width = docStyleLim - (MyTab == null ? (XOffset - (float)itemInfo.MyDocStyle.Layout.LeftMargin) : MyTab.XOffset + MyTab.Width); + } + } if (itemInfo.IsSection && ShowSectionTitles && !MyItemInfo.MyDocStyle.CancelSectTitle) { @@ -3210,6 +3227,8 @@ namespace Volian.Print.Library Width = adjwidth + MyParent.Width; else if (itemInfo.MyTab.Position != 0) Width = adjwidth + MyParent.Width; + else if (MyParent.WidthNoLimit != 0) + Width = adjwidth + MyParent.WidthNoLimit - tabWidth + (myTab == null ? 0 : myTab.TabAlign); else Width = adjwidth + MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign); }