ReadOnly Step Property for Backgrounds
Support ReadOnly step property for rtb size Support ReadOnly for rtb Pagination for Background documents, i.e. HLS/Caution/Note have pagebreaks Pagination for Backgrounds; Pagelist items for Backgrounds; tabs & offset for backgrounds & minor general Callaway PageList items for Background documents (HLRNO & HLSTAB) and CURDATE & CURTIME (for fnpnmp)
This commit is contained in:
@@ -60,7 +60,7 @@ namespace Volian.Print.Library
|
||||
// location of a pagebreak.
|
||||
if (MyPageHelper.ParaBreaks.Count > 0)
|
||||
{
|
||||
if (this == MyPageHelper.ParaBreaks[0] || this.YTopMost > MyPageHelper.ParaBreaks[0].YTopMost)
|
||||
if (this == MyPageHelper.ParaBreaks[0] || (!MyPageHelper.ParaBreaks[0].PageBreakOnStep && this.YTopMost > MyPageHelper.ParaBreaks[0].YTopMost))
|
||||
{
|
||||
MyPageHelper.ParaBreaks.RemoveAt(0);
|
||||
//Console.WriteLine("'PageBreak',6,'Yes','Page Break within Step',{0},{1},{2},{3}, {4},'{5}'", MyItemInfo.ItemID, YSize, 0, 0, 0, MyItemInfo.ShortPath);
|
||||
@@ -138,6 +138,16 @@ namespace Volian.Print.Library
|
||||
return 0; // Don't Paginate (page break) on a Step Section if it's first thing on page
|
||||
}
|
||||
if (!MyItemInfo.IsHigh) return 0; // Don't Paginate on a Substep level
|
||||
|
||||
// if this is a step, see if it has the 'PageBreakOnStep' format flag set to true, if so, break here.
|
||||
if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.PageBreakOnStep)
|
||||
{
|
||||
// if this step contains Cautions or Notes page breaks have to be added for those.
|
||||
if (TopMostChild != this) PageBreakOnStep = true;
|
||||
BuildPageBreakList(yPageSize, yPageSize, KeepStepsOnPage); // Case 1 :Works for ES05 Step 15 SubStep 7
|
||||
return 1;
|
||||
}
|
||||
|
||||
//MyPageHelper.HLSText = MyItemInfo.DisplayText; // save the High Level Step Text
|
||||
//Console.WriteLine("{0} Paginate", MyPageHelper.HLSText);
|
||||
StepConfig sc1 = MyItemInfo.MyConfig as StepConfig;
|
||||
@@ -305,6 +315,22 @@ namespace Volian.Print.Library
|
||||
}
|
||||
private void BuildPageBreakList(float ySpaceOnCurPage, float yPageSize, bool KeepStepsOnPage)
|
||||
{
|
||||
// if this paragraph is flagged to pagebreakonstep (i.e. these are used by background documents
|
||||
// to get each hls/caution/note to be on its own page), then any of the children above should
|
||||
// also have the flag set and be added to the pagebreakonsteplist so that a break occurs.
|
||||
List<vlnParagraph> PageBreakOnStepList = new List<vlnParagraph>();
|
||||
if (PageBreakOnStep)
|
||||
{
|
||||
foreach (vlnParagraph chldAbove in _ChildrenAbove)
|
||||
{
|
||||
if (TopMostChild != chldAbove)
|
||||
{
|
||||
chldAbove.PageBreakOnStep = true;
|
||||
PageBreakOnStepList.Add(chldAbove);
|
||||
}
|
||||
}
|
||||
PageBreakOnStepList.Add(this);
|
||||
}
|
||||
ParagraphLocations myLocations = new ParagraphLocations();
|
||||
BuildLocationList(YTopMost, myLocations);
|
||||
StepLevelList myList = myLocations.BuildStepLevelList(KeepStepsOnPage);
|
||||
@@ -337,7 +363,10 @@ namespace Volian.Print.Library
|
||||
}
|
||||
string myTopMsg = docstyle.Continue.Top.Message;
|
||||
float myTopMsgSpace = ((myTopMsg ?? "") != "") ? 2 * SixLinesPerInch : 0;
|
||||
while ((YSize - yTop) > ySpaceOnCurPage)
|
||||
|
||||
// while the amount to print is larger than one page, i.e. ((YSize - yTop) > ySpaceOnCurPage))
|
||||
// OR there are page breaks for HLS/cautions/notes remaining, typically for backgrounds (PageBreakOnStepList.Count > 0)
|
||||
while (((YSize - yTop) > ySpaceOnCurPage) || PageBreakOnStepList.Count > 0)
|
||||
{
|
||||
ySpaceOnCurPage -= myBottomMsgSpace;
|
||||
vlnParagraph paraBreak = FindPageBreak(yStart, ySpaceOnCurPage, yLowerLimit, myList);
|
||||
@@ -351,6 +380,19 @@ namespace Volian.Print.Library
|
||||
//float yTopNew = paraBreak.YVeryTop - YTopMost;
|
||||
//float yTopNew = paraBreak.YTopMost - YTopMost;
|
||||
float yTopNew = Math.Min(paraBreak.YTopMost, paraBreak.YVeryTop) - YTopMost;
|
||||
|
||||
// This is for formats that break on all HLS, Cautions & Notes (often backgrounds):
|
||||
if (PageBreakOnStepList.Count > 0)
|
||||
{
|
||||
// If the next page break is beyond the next hls/caution/note, use the next
|
||||
// hls/caution/note.
|
||||
if (PageBreakOnStepList[0].YTop <= paraBreak.YTop)
|
||||
{
|
||||
paraBreak = PageBreakOnStepList[0];
|
||||
PageBreakOnStepList.RemoveAt(0);
|
||||
yTopNew = paraBreak.YTop - YTopMost;
|
||||
}
|
||||
}
|
||||
RemoveProcessedParagraphs(myList, yTopNew - yTop);
|
||||
yTop = yTopNew;
|
||||
MyPageHelper.ParaBreaks.Add(paraBreak);
|
||||
|
Reference in New Issue
Block a user