diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index d5e7627e..66ce8053 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -4600,6 +4600,14 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _UsePreviousStyle, "TabData/@UsePreviousStyle"); } } + private LazyLoad _IsTransition; + public bool IsTransition + { + get + { + return LazyLoad(ref _IsTransition, "TabData/@IsTransition"); + } + } private LazyLoad _IdentWidth; public float? IdentWidth { @@ -5135,6 +5143,22 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _BoldTransition, "@BoldTransition"); } } + private LazyLoad _BoldTransitionExceptHLS; + public bool BoldTransitionExceptHLS + { + get + { + return LazyLoad(ref _BoldTransitionExceptHLS, "@BoldTransitionExceptHLS"); + } + } + private LazyLoad _AdjustStepTransitionText; + public bool AdjustStepTransitionText + { + get + { + return LazyLoad(ref _AdjustStepTransitionText, "@AdjustStepTransitionText"); + } + } } #endregion #region TransType diff --git a/PROMS/Volian.Controls.Library/DisplayText.cs b/PROMS/Volian.Controls.Library/DisplayText.cs index f1ee0579..96fedd6a 100644 --- a/PROMS/Volian.Controls.Library/DisplayText.cs +++ b/PROMS/Volian.Controls.Library/DisplayText.cs @@ -225,7 +225,7 @@ namespace Volian.Controls.Library } // Adjust RO display if (ROsShouldBeAdjusted) - text = DoTransitionAdjustments(text, _MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.BoldTransition); + text = DoTransitionAdjustments(text, _MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.BoldTransition || (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.BoldTransitionExceptHLS && !_MyItemInfo.IsHigh)); // add colors around links: if (colorLinks) text = DoColorLinks(text); diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index c712d047..c4caca3f 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -422,6 +422,8 @@ namespace Volian.Print.Library } else { + //added by jcb to reset mygaps when changing a section. found old section gaps were carrying over to new section + _MyHelper.MyGaps.Clear(); //Console.WriteLine("'{0}' PromsPrinter", mySection.DisplayText); if (mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate) _MyHelper.DidFirstPageDocStyle = false; diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index d4f78fd7..1911b87b 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -495,6 +495,7 @@ namespace Volian.Print.Library get { return _MyPromsPrinter; } set { _MyPromsPrinter = value; } } + private int _MyRomanPage = 1; public VlnSvgPageHelper(VEPROMS.CSLA.Library.SectionInfo mySection,PromsPrinter myPromsPrinter,string hlsText) : base() { HLSText = hlsText; @@ -564,10 +565,14 @@ namespace Volian.Print.Library MyPdfContentByte.AddTemplate(MyPageCounts.AddToTemplateList(key, MyPdfWriter, txt, args.MySvgText.Font, args.MySvgText.Align, args.MySvgText.FillColor), args.MySvgScale.X(args.MySvgText.X), args.MySvgScale.Y(MyPdfContentByte, args.MySvgText.Y)); return string.Empty; } - if (args.MyText.Contains("{ROMANPAGE}")) - { - return args.MyText.Replace("{ROMANPAGE}", ItemInfo.RomanNumbering(1).ToLower()); - } + //if (args.MyText.Contains("{ROMANPAGE}")) + //{ + // //return args.MyText.Replace("{ROMANPAGE}", ItemInfo.RomanNumbering(_MyRomanPage++).ToLower()); + // string key = "RomanPage." + MySection.ItemID; + // string txt = args.MyText; + // MyPdfContentByte.AddTemplate(MyPageCounts.AddToTemplateList(key, MyPdfWriter, txt, args.MySvgText.Font, args.MySvgText.Align, args.MySvgText.FillColor), args.MySvgScale.X(args.MySvgText.X), args.MySvgScale.Y(MyPdfContentByte, args.MySvgText.Y)); + // return string.Empty; + //} if (args.MyText.Contains("{SECONDARYPAGE}") || args.MyText.Contains("{SECONDARYOF}")) { string key = "SecondaryPage." + MySection.ItemID; @@ -1203,6 +1208,12 @@ namespace Volian.Print.Library private List SplitText(string text, int len) { List results = new List(); + if (text.Contains("\\LINE ") || text.Contains("\r\n")) + { + string[] mySplit = {"\\LINE ","\r\n"}; + return new List(text.Split(mySplit, StringSplitOptions.None)); + + } int width = 0; // width of text, non-rtf int start = 0; // start of line (index into string 'text'), includes rtf int lastspace = 0; // location of lastspace (index into string 'text'), includes rtf @@ -1251,7 +1262,7 @@ namespace Volian.Print.Library if (width > len) { // what should be done if lastspace == 0 - results.Add(nextprefix+text.Substring(start, lastspace-start)); + results.Add(nextprefix+text.Substring(start, lastspace-start).Trim(" ".ToCharArray())); nextprefix = rtfprefix; if (nextprefix != "") nextprefix += " "; start = lastspace + 1; @@ -1261,7 +1272,7 @@ namespace Volian.Print.Library } } - if (width > 0 || start < text.Length) results.Add(nextprefix + text.Substring(start)); + if (width > 0 || start < text.Length) results.Add(nextprefix + text.Substring(start).Trim(" ".ToCharArray())); return results; } @@ -1471,6 +1482,8 @@ namespace Volian.Print.Library return System.DateTime.Today.ToShortDateString(); case "{CHKOFFHEADING}": return PageListTopCheckOffHeader; + case "{ROMANPAGE}": + return ItemInfo.RomanNumbering(CurrentPageNumber).ToLower(); } if (!_MissingTokens.Contains(match.Value)) { diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 80583323..756ec2b0 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -34,100 +34,113 @@ namespace Volian.Print.Library vlnBox box = null; float yTop = yoff; ItemInfo lastChild = null; + string lastHeader = null; foreach (ItemInfo childItemInfo in itemInfoList) { - // if the format has MatchUpRNOCautNote, then add a line to yoff, if not at top of rno column. - if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.MatchUpRNO) + if (childItemInfo.FormatStepData.TabData != null && childItemInfo.FormatStepData.TabData.IsTransition) { - if (childItemInfo.MyParent != null && childItemInfo.MyParent.MyParent != null && !childItemInfo.MyParent.MyParent.IsHigh) - yoff += vlnPrintObject.SixLinesPerInch; + lastHeader = childItemInfo.DisplayText; } - // if this is a caution/note and it has a caution/note substep, do it before this caution/note, so that - // it comes above it. - if (childItemInfo.Cautions != null && (childItemInfo.IsCaution || childItemInfo.IsNote)) - yoff = Add(cb, childItemInfo.Cautions, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo); - if (childItemInfo.Notes != null && (childItemInfo.IsCaution || childItemInfo.IsNote)) - yoff = Add(cb, childItemInfo.Notes, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo); - int? bxIndx = childItemInfo.FormatStepData==null?-1:childItemInfo.FormatStepData.StepLayoutData.STBoxindex; - bool boxHLS = false; - - if ((bxIndx ?? -1) != -1 && (bxIndex != bxIndx || childItemInfo.FormatStepData.BoxIt || childItemInfo.MyHeader != null)) + else { - if (childItemInfo.FormatStepData.BoxIt) // this is a boxed HLS + if (lastHeader != null) { - box = new vlnBox(); - box.MyBox = new Box(); - box.DefBox = vlnBox.BoxThin; - StepSectionLayoutData ssld = formatInfo.MyStepSectionLayoutData; - int colR = int.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[childItemInfo.ColumnMode]); - int widS = vlnPrintObject.ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); - box.DefEnd = (float)(ssld.ColS + colR + widS + (60/4.8)); - box.YOffset = yoff - .75F * vlnPrintObject.SixLinesPerInch; + childItemInfo.SetHeader(childItemInfo.FormatStepData.TabData.Font, lastHeader); + lastHeader = null; } - else if (bxIndex == null) // First boxed step + // if the format has MatchUpRNOCautNote, then add a line to yoff, if not at top of rno column. + if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.MatchUpRNO) { - if (childItemInfo.IsHigh) boxHLS = true; - box = new vlnBox(); - box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (box.MyBox != null) + if (childItemInfo.MyParent != null && childItemInfo.MyParent.MyParent != null && !childItemInfo.MyParent.MyParent.IsHigh) + yoff += vlnPrintObject.SixLinesPerInch; + } + // if this is a caution/note and it has a caution/note substep, do it before this caution/note, so that + // it comes above it. + if (childItemInfo.Cautions != null && (childItemInfo.IsCaution || childItemInfo.IsNote)) + yoff = Add(cb, childItemInfo.Cautions, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo); + if (childItemInfo.Notes != null && (childItemInfo.IsCaution || childItemInfo.IsNote)) + yoff = Add(cb, childItemInfo.Notes, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo); + int? bxIndx = childItemInfo.FormatStepData == null ? -1 : childItemInfo.FormatStepData.StepLayoutData.STBoxindex; + bool boxHLS = false; + + if ((bxIndx ?? -1) != -1 && (bxIndex != bxIndx || childItemInfo.FormatStepData.BoxIt || childItemInfo.MyHeader != null)) + { + if (childItemInfo.FormatStepData.BoxIt) // this is a boxed HLS { - box.YOffset = yoff; - int ln = 1; // a format flag determines whether there is a space before the note/caution. - if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; - if (!boxHLS || (boxHLS && !childItemInfo.HasCautionOrNote)) - yoff += ln * vlnPrintObject.SixLinesPerInch; + box = new vlnBox(); + box.MyBox = new Box(); + box.DefBox = vlnBox.BoxThin; + StepSectionLayoutData ssld = formatInfo.MyStepSectionLayoutData; + int colR = int.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[childItemInfo.ColumnMode]); + int widS = vlnPrintObject.ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); + box.DefEnd = (float)(ssld.ColS + colR + widS + (60 / 4.8)); + box.YOffset = yoff - .75F * vlnPrintObject.SixLinesPerInch; } - } - else // Change Box Style - { - if (bxIndx != null) + else if (bxIndex == null) // First boxed step { - if (box != null) - { - box.Height = yoff - box.YOffset; // new height, with children - if (childItemInfo.MyHeader != null && childItemInfo.MyPrevious != null - && ((childItemInfo.MyPrevious.IsCaution && childItemInfo.IsCaution) || - (childItemInfo.MyPrevious.IsNote && childItemInfo.IsNote))) - yoff += vlnPrintObject.SixLinesPerInch * 2; - } + if (childItemInfo.IsHigh) boxHLS = true; box = new vlnBox(); box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - int ln = 1; // a format flag determines whether there is a space before the note/caution. - if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; - if (childItemInfo.MixCautionNotesDiffType()) ln += 2; - box.YOffset = yoff + ((ln - 1) * vlnPrintObject.SixLinesPerInch); - yoff += ln * vlnPrintObject.SixLinesPerInch; + if (box.MyBox != null) + { + box.YOffset = yoff; + int ln = 1; // a format flag determines whether there is a space before the note/caution. + if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; + if (!boxHLS || (boxHLS && !childItemInfo.HasCautionOrNote)) + yoff += ln * vlnPrintObject.SixLinesPerInch; + } } + else // Change Box Style + { + if (bxIndx != null) + { + if (box != null) + { + box.Height = yoff - box.YOffset; // new height, with children + if (childItemInfo.MyHeader != null && childItemInfo.MyPrevious != null + && ((childItemInfo.MyPrevious.IsCaution && childItemInfo.IsCaution) || + (childItemInfo.MyPrevious.IsNote && childItemInfo.IsNote))) + yoff += vlnPrintObject.SixLinesPerInch * 2; + } + box = new vlnBox(); + box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; + int ln = 1; // a format flag determines whether there is a space before the note/caution. + if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; + if (childItemInfo.MixCautionNotesDiffType()) ln += 2; + box.YOffset = yoff + ((ln - 1) * vlnPrintObject.SixLinesPerInch); + yoff += ln * vlnPrintObject.SixLinesPerInch; + } + } + bxIndex = bxIndx; } - bxIndex = bxIndx; + if (childItemInfo is SectionInfo) formatInfo = (childItemInfo as SectionInfo).LocalFormat ?? formatInfo; + if (rnoLevel < maxRNO && childItemInfo.RNOs != null) yoff = Math.Max(yoff, yoffRight); + vlnParagraph para = new vlnParagraph(Parent, cb, childItemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null); + if (box != null && box.MyParent == null) + { + box.MyParent = para; + para.PartsContainer.Add(box); + } + Add(para); + // para.YBottomMost will have y for bottom of any substeps that are also enclosed in the box. + if (childItemInfo.IsStep && childItemInfo.MyHLS.FormatStepData.UseSmartTemplate && para.ChildrenBelow.Count > 0 && para.ChildrenBelow[0].YBottomMost > para.YBottomMost) + yoff = para.ChildrenBelow[0].YBottomMost; + else + yoff = para.YBottomMost; + if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.BoxIt) + { + box.Height = yoff - box.YOffset - (1.1F * vlnPrintObject.SixLinesPerInch); + box = null; // if doing boxed steps, only do single sibling at a time. + } + if (boxHLS) + { + box.YOffset = para.YTop - (2 * vlnPrintObject.SixLinesPerInch); + box.Height = para.YBottomMost - box.YOffset; // para.YTop - (1.1F * vlnPrintObject.SixLinesPerInch); + box = null; + } + boxHLS = false; + lastChild = childItemInfo; } - if (childItemInfo is SectionInfo) formatInfo = (childItemInfo as SectionInfo).LocalFormat ?? formatInfo; - if (rnoLevel < maxRNO && childItemInfo.RNOs != null) yoff = Math.Max(yoff, yoffRight); - vlnParagraph para = new vlnParagraph(Parent, cb, childItemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null); - if (box != null && box.MyParent == null) - { - box.MyParent = para; - para.PartsContainer.Add(box); - } - Add(para); - // para.YBottomMost will have y for bottom of any substeps that are also enclosed in the box. - if (childItemInfo.IsStep && childItemInfo.MyHLS.FormatStepData.UseSmartTemplate && para.ChildrenBelow.Count>0 && para.ChildrenBelow[0].YBottomMost > para.YBottomMost) - yoff = para.ChildrenBelow[0].YBottomMost; - else - yoff = para.YBottomMost; - if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.BoxIt) - { - box.Height = yoff - box.YOffset - (1.1F * vlnPrintObject.SixLinesPerInch); - box = null; // if doing boxed steps, only do single sibling at a time. - } - if (boxHLS) - { - box.YOffset = para.YTop - (2 * vlnPrintObject.SixLinesPerInch); - box.Height = para.YBottomMost - box.YOffset; // para.YTop - (1.1F * vlnPrintObject.SixLinesPerInch); - box = null; - } - boxHLS = false; - lastChild = childItemInfo; } if (box != null && box.MyBox != null) {