Adjust HLS width (checklist header) and DocStyle:page length for pagination

Display message box after formats/genmacs are copied
Improve checklist pagination
Improve checklist pagination & right checklist box line alignment
This commit is contained in:
2014-09-24 14:47:36 +00:00
parent 2c6eeee66c
commit 881cbe5bdd
4 changed files with 48 additions and 14 deletions

View File

@@ -694,7 +694,7 @@ namespace Volian.Print.Library
doHorizCnt++;
}
// put out the right side piece
Rtf2Pdf.TextAt(cb, rightLine, float.Parse(vertPos[cntVertPos - 1]) + (float)ii.MyDocStyle.Layout.LeftMargin - 6, yloc, lWidth, 100, null, yBottomMargin);
Rtf2Pdf.TextAt(cb, rightLine, float.Parse(vertPos[cntVertPos - 1]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yloc, lWidth, 100, null, yBottomMargin);
}
// Now handle middle parts of the table. For whatever sub level we're at, draw the cross character
// and the horizontal. This is case where the component number may have multiple descriptions,positions, etc. associated
@@ -774,6 +774,12 @@ namespace Volian.Print.Library
IParagraph.Chunks.RemoveAt(0);
}
}
// if printing checklist header, adjust ypagestart & ylocation so that won't get forced pagination (pagination is already ok)
if (PrintHeader)
{
yPageStart = yTopMargin + YVeryTop;
yLocation = yPageStart - YOffset; // yLocation is physical location from bottom of page.
}
retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugInfo + string.Format(",YLines = {0}",YSize/SixLinesPerInch), yBottomMargin);
if (retval == 0) // problem occurred - paragraph was not able to be printed on page
{ // pagination logic needs to be fixed.
@@ -781,6 +787,12 @@ namespace Volian.Print.Library
}
return retval;
}
private bool _PrintHeader = false;
public bool PrintHeader
{
get { return _PrintHeader; }
set { _PrintHeader = value; }
}
private static List<string> myAttributes = new List<string>();
private static void AddAttribute(string attr)
{
@@ -913,6 +925,7 @@ namespace Volian.Print.Library
}
}
private static bool DoSubs = true; // flag whether to print substeps (don't if doing continued checklist header)
public override float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin)
{
bool doThreeContinues = false;
@@ -1116,11 +1129,16 @@ namespace Volian.Print.Library
yPageStart += (3 * SixLinesPerInch);
}
// Now check if this is a template type step & if so, add the HLS's prefix/suffix to it.
// Since the entire checklist HLS (checklist table header) is printed as part of the
// continue, create a new paragraph to handle pagination and printing.
if (MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate)
{
vlnParagraph smartPara = new vlnParagraph(MyParent.MyParent, cb, MyItemInfo.MyHLS, MyParent.XOffset, 0, 0, 0, MyParent.MyItemInfo.ActiveFormat, null, " (Continued)", 0);
float mytmpfloat = smartPara.ParagraphToPdf(cb, smartPara.Height, yTopMargin, yBottomMargin); // .ToPdf(cb, 0, yTopMargin, yBottomMargin);
DoSubs = false;
vlnParagraph smartPara = new vlnParagraph(MyParent.MyParent, cb, MyItemInfo.MyHLS, MyParent.XOffset, yPageStart, 0, 0, MyParent.MyItemInfo.ActiveFormat, null, " (Continued)", 0);
smartPara.PrintHeader = true;
float mytmpfloat = smartPara.ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
yPageStart -= smartPara.Height;
DoSubs = true;
}
if (addExtraLines) yPageStart -= (2 * SixLinesPerInch);
if (MyItemInfo.IsRNOPart && MyItemInfo.FormatStepData.DoubleSpace && MyItemInfo.FormatStepData.SpaceDouble) yPageStart += SixLinesPerInch;
@@ -2076,7 +2094,7 @@ namespace Volian.Print.Library
float yoffLeft = yoff;
if (ChildrenAbove != null)
ChildrenAbove.StepDesignator = null; //reset StepDesignator
if (itemInfo.Cautions != null && (!itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || itemInfo.Cautions[0].FormatStepData.Type != "Caution1") && !(itemInfo.IsCaution || itemInfo.IsNote))
if (DoSubs && itemInfo.Cautions != null && (!itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || itemInfo.Cautions[0].FormatStepData.Type != "Caution1") && !(itemInfo.IsCaution || itemInfo.IsNote))
{
if (itemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
{
@@ -2091,7 +2109,7 @@ namespace Volian.Print.Library
yoff = ChildrenAbove.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
}
}
if (itemInfo.Notes != null && !(itemInfo.IsCaution || itemInfo.IsNote))
if (DoSubs && itemInfo.Notes != null && !(itemInfo.IsCaution || itemInfo.IsNote))
{
if (itemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
{
@@ -2509,7 +2527,7 @@ namespace Volian.Print.Library
}
float yOffRight = yoff;
float RnoOffset = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO);
if (rnoLevel < maxRNO && itemInfo.RNOs != null)
if (DoSubs && rnoLevel < maxRNO && itemInfo.RNOs != null)
{
yOffRight = ChildrenRight.Add(cb, itemInfo.RNOs, XOffset + RnoOffset, YTop, YTop, rnoLevel + 1, maxRNO, formatInfo);
if (ChildrenRight[0].ChildrenAbove.Count > 0)
@@ -2530,7 +2548,7 @@ namespace Volian.Print.Library
// Need code to determine if the table will overlap the Right Column if it does then
// use YOffRight rather than yoff
if (itemInfo.Tables != null)
if (DoSubs && itemInfo.Tables != null)
{
bool aerTableOrFigure = itemInfo.Tables[0].FormatStepData.Type.Contains("AER");
// get the first table & see if it is borderless. If borderless, 16bit code removed a
@@ -2609,7 +2627,7 @@ namespace Volian.Print.Library
yoff = ChildrenBelow.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
savCheckListBottomMost = yoff;
}
if (itemInfo.Steps != null && printsteps)
if (DoSubs && itemInfo.Steps != null && printsteps)
{
if (itemInfo.FormatStepData == null || itemInfo.FormatStepData.Type != "TitleWithTextRight")
if(rnoBefore)