This commit is contained in:
2010-07-14 16:17:39 +00:00
parent 2bf01da344
commit ebd566dcb2
11 changed files with 1058 additions and 468 deletions

View File

@@ -33,9 +33,20 @@ namespace Volian.Print.Library
foreach (ItemInfo childItemInfo in itemInfoList)
{
int? bxIndx = childItemInfo.FormatStepData.StepLayoutData.STBoxindex;
if (bxIndex != bxIndx)
if (bxIndex != bxIndx || childItemInfo.FormatStepData.BoxIt)
{
if (bxIndex == null) // First boxed step
if (childItemInfo.FormatStepData.BoxIt) // this is a boxed HLS
{
box = new vlnBox();
box.MyBox = new Box();
box.DefBox = vlnBox.BoxThin;
StepSectionLayoutData ssld = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData;
int colR = int.Parse(formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColRTable.Split(",".ToCharArray())[childItemInfo.ColumnMode]);
int widS = vlnPrintObject.ToInt(formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.WidSTablePrint, maxRNO);
box.DefEnd = (float)(ssld.ColS + colR + widS + (60/4.8));
box.YOffset = yoff - .75F * vlnPrintObject.SixLinesPerInch;
}
else if (bxIndex == null) // First boxed step
{
box = new vlnBox();
box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
@@ -61,9 +72,15 @@ namespace Volian.Print.Library
para.PartsContainer.Add(box);
}
Add(para);
// para.YBottomMost will have y for bottom of any substeps that are also enclosed in the box.
yoff = para.YBottomMost;
if (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 (bxIndex != null) // End Box Style
if (box != null)
{
if (box != null) box.Height = yoff - box.YOffset; // new height, with children
yoff += 2 * vlnPrintObject.SixLinesPerInch;
@@ -84,13 +101,7 @@ namespace Volian.Print.Library
public float ParagraphToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
{
if (Processed) return yPageStart;
//if (!MyPageHelper.MyParagraphs.ContainsValue(this)) return yPageStart;
Processed = true;
//MyPageHelper.MyParagraphs.Remove(this.MyItemInfo.ItemID);
//Console.WriteLine("'{0}',{1},{2},{3},{4},{5},{6},{7},{8}", MyItemInfo.Path.Substring(_Prefix.Length).Trim(),
// cb.PdfWriter.CurrentPageNumber, yStart, YTop, yStart + YTop, yStart + YTop - _LastY, YTopMost, YSize, yPageStart);
//_LastY = yStart + YTop;
// 72 points per inchs. 504 is 7 inches wide. 3 1/2 inches wide: 252, 100);
if (_PartsAbove != null && _PartsAbove.Count > 0) yPageStart = PartsAbove.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
float yLocation = CalculateYOffset(yPageStart, yTopMargin);
if (MyItemInfo.HasChangeBar()) MyPageHelper.AddChangeBar(DoChangeBar(cb, MyItemInfo, MyPageHelper, XOffset, yLocation, MyPageHelper.MaxRNO, MyItemInfo.ActiveFormat), cbMess);
@@ -161,8 +172,6 @@ namespace Volian.Print.Library
}
public override float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
{
//if (!MyPageHelper.MyParagraphs.Contains(this)) return yPageStart;
//MyPageHelper.MyParagraphs.Remove(this);
float yLocation = yPageStart - YTopMost;
int paginate = Paginate(yLocation, yTopMargin, yBottomMargin);
switch (paginate)
@@ -187,7 +196,7 @@ namespace Volian.Print.Library
Console.WriteLine("Not done yet");
break;
case E_ContBottomLoc.BottomOfPage: // place continue message at bottom of page
msg_yLocation = yBottomMargin; // +2 * _SixLinesPerInch; // 2 lines above bottom margin
msg_yLocation = yBottomMargin + 2 * SixLinesPerInch; // 2 lines above bottom margin
break;
}
//float msg_yLocation = CalculateYOffset(yPageStart, yTopMargin);
@@ -254,8 +263,6 @@ namespace Volian.Print.Library
{
float yPageSize = yTopMargin - yBottomMargin;
float yWithinMargins = CalculateYLocation(yLocation, yTopMargin) - yBottomMargin;
if (MyItemInfo.ItemID == 832)
Console.Write(",'Here'");
if (MyItemInfo.IsStepSection) return 0; // Don't Paginate on a Step Section
float mySize = YSize * MyPageHelper.YMultiplier;
if (mySize <= yWithinMargins)
@@ -766,28 +773,6 @@ namespace Volian.Print.Library
return _ChildrenLeft;
}
}
//public vlnParagraph(vlnParagraph myParent, ItemInfo myItemInfo, float xoff, float yoff, float width, string rtf, ChildLocation childRelation)
//{
// MyParent = myParent;
// MyItemInfo = myItemInfo;
// XOffset = xoff;
// YOffset = yoff;
// Width = width;
// Rtf = rtf;
// switch (childRelation)
// {
// case ChildLocation.Below:
// myParent.ChildrenBelow.Add(this);
// break;
// case ChildLocation.Above:
// myParent.ChildrenAbove.Add(this);
// break;
// case ChildLocation.Right:
// myParent.ChildrenRight.Add(this);
// break;
// }
//}
public void AdjustXOffsetForTab(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo, vlnTab myTab)
{
float tabWidth = (myTab == null) ? 0 : myTab.Width;