diff --git a/PROMS/Formats/fmtall/BGEVLall.xml b/PROMS/Formats/fmtall/BGEVLall.xml index 67c47d96..25f25099 100644 Binary files a/PROMS/Formats/fmtall/BGEVLall.xml and b/PROMS/Formats/fmtall/BGEVLall.xml differ diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index 7e966c81..f2228418 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -1752,9 +1752,10 @@ namespace Volian.Controls.Library //if (MyItemInfo.SameRowAsParent && MyItemInfo.IsCaution2) // bottom = Top; - // If this is a "TitleWithTextRight", don't move down on the screen: + // If this is a "TitleWithTextRight", don't move down on the screen but only if it has a + // child, i.e. want the child to be positioned on line, but if no child, move down on screen: int newTop = bottom; - if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.Type == "TitleWithTextRight") newTop = Top; + if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.Type == "TitleWithTextRight" && MyItemInfo.HasChildren) newTop = Top; if (nextEditItem.Top != newTop) { MyStepPanel.ItemMoving++; @@ -2152,6 +2153,8 @@ namespace Volian.Controls.Library // Paul Linn made the request on 6/4/12 to align the Component Description & // Required Position under the Component Number. ItemLocation = new Point(_MyParentEditItem.ItemLocation.X, _MyParentEditItem.Bottom); + else if (MyItemInfo.FormatStepData.Type == "TitleWithTextRight" && MyItemInfo.Steps.Count==0) // this code is run for siblings within a HLS (but not last sibling). + ItemLocation = new Point(_MyParentEditItem.ItemLocation.X, _MyParentEditItem.Bottom); else if (MyItemInfo.MyParent.FormatStepData.Type == "TitleWithTextRight") ItemLocation = new Point(_MyParentEditItem.ItemLocation.X + _MyParentEditItem.ItemWidth, _MyParentEditItem.ItemLocation.Y); else if (MyItemInfo.MyTab.Offset != 0) @@ -2160,26 +2163,25 @@ namespace Volian.Controls.Library else ItemLocation = new Point(_MyParentEditItem.ContentLeft, _MyParentEditItem.Bottom); + bool specialTplSupport =((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd) || + (MyItemInfo.MyDocStyle.LandscapePageList && MyItemInfo.MyDocStyle.ComponentList); if (MyItemInfo.FormatStepData.ReadOnly) { Graphics g = CreateGraphics(); SizeF sz = g.MeasureString(MyItemInfo.MyContent.Text, MyItemInfo.FormatStepData.Font.WindowsFont); ItemWidth = (int)sz.Width; } - else if (MyItemInfo.FormatStepData.Type == "TitleWithTextRight" && - ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) + else if (MyItemInfo.FormatStepData.Type == "TitleWithTextRight" && specialTplSupport) { Graphics g = CreateGraphics(); SizeF sz = g.MeasureString(MyItemInfo.MyContent.Text, MyItemInfo.FormatStepData.Font.WindowsFont); ItemWidth = (int)sz.Width + 5; } - else if (MyItemInfo.FormatStepData.Type == "TitleWithTextBelow" && - ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) + else if (MyItemInfo.FormatStepData.Type == "TitleWithTextBelow" && specialTplSupport) { ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0); } - else if (MyItemInfo.MyParent.FormatStepData.Type == "TitleWithTextBelow" && - ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) + else if (MyItemInfo.MyParent.FormatStepData.Type == "TitleWithTextBelow" && specialTplSupport) { ItemWidth = MyParentEditItem.ItemWidth - RTBItem.RTBMargin; } diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 20739d79..2a49b8ca 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -1353,22 +1353,9 @@ namespace Volian.Print.Library } } - // see if this hls has footnotes, if so save them for vlnSvgPageHelper to put out - // and figure out yspace it takes for pagination. - if (MyItemInfo.IsHigh && MyPageHelper.NotesToFootNotesHLS.ContainsKey(MyItemInfo.ItemID)) - { - List myNotes = MyPageHelper.NotesToFootNotesHLS[MyItemInfo.ItemID]; - foreach (int myNote in myNotes) - { - ItemInfo inote = ItemInfo.Get(myNote); - vlnText ntTxt = new vlnText(cb, null, inote.MyContent.Text, inote.MyContent.Text, (float)MyItemInfo.MyDocStyle.Layout.LeftMargin, 0, inote.FormatStepData.Font); - ntTxt.Width = (float)MyItemInfo.MyDocStyle.Layout.PageWidth - (float)MyItemInfo.MyDocStyle.Layout.LeftMargin; - if (MyPageHelper.NotesToFootNotes == null) MyPageHelper.NotesToFootNotes = new List(); - MyPageHelper.NotesToFootNotes.Add(ntTxt); - } - MyPageHelper.NotesToFootNotesHLS.Remove(MyItemInfo.ItemID); - } - + // see if this hls has footnotes, add to the footnote datastructure for processing at end of pgae. + if (MyItemInfo.IsHigh && MyPageHelper.NotesToFootNotesHLS.ContainsKey(MyItemInfo.ItemID)) AddFootNote(cb); + yPageStart = ChildrenAbove.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); yPageStart = ChildrenLeft.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); @@ -1475,8 +1462,49 @@ namespace Volian.Print.Library } } if (yLocalypagestart != yPageStart) DebugText.WriteLine("ToPdf-yPagestartDiff:{0},{1},{2},{3}", MyPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, MyItemInfo.ItemID, yLocalypagestart, yPageStart); + + // if doing NotesToFootnotes (Calvert valve list format), get the bottom location so that + // footnotes will be printed after last text on page. This is used for the end of the section. + // Pages that broke within pagination logic above had footnote location set during pagination code. + if (MyPageHelper.NotesToFootNotes != null) + MyPageHelper.NotesToFootNotesYoffset = CalculateYLocation(yPageStart - YBottomMost, yTopMargin); + return yPageStart; } + + private void AddFootNote(PdfContentByte cb) + { + // for calvert valve lists footnotes, if there is footnote data, save it for vlnSvgPageHelper + // which puts the footnotes out when page is printed. + List myNotes = MyPageHelper.NotesToFootNotesHLS[MyItemInfo.ItemID]; + foreach (int myNote in myNotes) + { + ItemInfo inote = ItemInfo.Get(myNote); + + // first check if this exact text is already in the foot note list. If it is + // in there, don't add it. + bool inlist = false; + if (MyPageHelper.NotesToFootNotes != null) + { + foreach (vlnText vt in MyPageHelper.NotesToFootNotes) + { + if (vt.Text == inote.MyContent.Text) + { + inlist = true; + break; + } + } + } + if (!inlist) + { + vlnText ntTxt = new vlnText(cb, null, inote.MyContent.Text, inote.MyContent.Text, (float)MyItemInfo.MyDocStyle.Layout.LeftMargin, 0, inote.FormatStepData.Font); + ntTxt.Width = (float)MyItemInfo.MyDocStyle.Layout.PageWidth - (float)MyItemInfo.MyDocStyle.Layout.LeftMargin; + if (MyPageHelper.NotesToFootNotes == null) MyPageHelper.NotesToFootNotes = new List(); + MyPageHelper.NotesToFootNotes.Add(ntTxt); + } + } + MyPageHelper.NotesToFootNotesHLS.Remove(MyItemInfo.ItemID); + } private bool DoTopContinueMsg(PdfContentByte cb, ref float yPageStart, float yTopMargin, DocStyle docstyle, string subTab) { bool addExtraLine = false;