From 6d0a14c364a11878f1e1416849b20cf94b88d557 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 27 May 2014 16:51:23 +0000 Subject: [PATCH] Add new macro settings to allow for a different checkoff macro when a step element is in single column mode Logic to support the new macro settings which allows for a different checkoff macro and position when a step element is in single column mode --- .../Format/PlantFormat.cs | 25 +++++++++++++++++++ PROMS/Volian.Print.Library/vlnParagraph.cs | 13 +++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index cc7c3470..e0f1957b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -4947,6 +4947,31 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _MacroDef, "@Macro"); } } + private LazyLoad _SingleColMacroDef; + public string SingleColMacroDef + { + get + { + if (_Inherited == null) SetupStepInheritance(); + return LazyLoad(ref _MacroDef, "@SingleColMacro"); + } + } + private LazyLoad _MacroXOffSet; + public float? MacroXOffSet + { + get + { + return LazyLoad(ref _MacroXOffSet, "@MacroXOffSet"); + } + } + private LazyLoad _SingleColWidthAdjust; + public float? SingleColWidthAdjust + { + get + { + return LazyLoad(ref _SingleColWidthAdjust, "@SingleColWidthAdjust"); + } + } private LazyLoad _LocWithXOff; public bool? LocWithXOff { diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index d282e936..8f44e952 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -2551,7 +2551,18 @@ namespace Volian.Print.Library string tabText = mytab == null ? null : mytab.Text.Trim(" .".ToCharArray()); int tablen = (tabText == null) ? 0 : (tabText.Length <= 2) ? 0 : tabText.Length - 2; if (myMacro.LocWithXOff ?? false) x = mytab == null ? XOffset : ((float)mytab.XOffset + (tablen * (float)mytab.MyFont.CharsToTwips)); - PartsLeft.Add(new vlnMacro(x, y, myMacro.MacroDef)); + if (MyItemInfo.MyActiveSection.ColumnMode == 0 && myMacro.SingleColMacroDef != null && myMacro.SingleColMacroDef.Length > 0) + { + float macroXOffset = myMacro.MacroXOffSet ?? 0; + float widthAdj = myMacro.SingleColWidthAdjust ?? 0; // set as negative number in format + float rightTextEdge = (itemInfo.IsHigh)? XOffset + Width + mytab.XOffset:this.MyHighLevelParagraph.XOffset + this.MyHighLevelParagraph.Width; + x = (macroXOffset > 0) ? macroXOffset : rightTextEdge; + if (rightTextEdge > x) + Width += widthAdj; + PartsRight.Add(new vlnMacro(x, y, myMacro.SingleColMacroDef)); + } + else + PartsLeft.Add(new vlnMacro(x, y, myMacro.MacroDef)); } } }