Generate Placekeeper logic
This commit is contained in:
@@ -77,10 +77,6 @@ namespace Volian.Print.Library
|
||||
if (iChildItemInfo.IsSection && (iChildItemInfo as SectionInfo).ColumnMode != maxRNO)
|
||||
maxRNO = (iChildItemInfo as SectionInfo).ColumnMode;
|
||||
ItemInfo childItemInfo = iChildItemInfo;
|
||||
//if (childItemInfo.ItemID == 167601)
|
||||
// Console.WriteLine("AER RNO Step");
|
||||
//if (childItemInfo.ItemID == 167603)
|
||||
// Console.WriteLine("stop");
|
||||
int? bxIndx = childItemInfo.FormatStepData == null ? -1 : childItemInfo.FormatStepData.StepLayoutData.STBoxindex;
|
||||
|
||||
// if the Caution or Note is not boxed, then use ColT to set the starting column of the Note or Caution
|
||||
@@ -268,14 +264,6 @@ namespace Volian.Print.Library
|
||||
box.Height = para.YBottomMost - box.YOffset - (boxLnAdjust * vlnPrintObject.SixLinesPerInch); // para.YTop - (1.1F * vlnPrintObject.SixLinesPerInch);
|
||||
box = null;
|
||||
}
|
||||
//else if (childItemInfo.ItemID == 167601)
|
||||
//{
|
||||
// boxHLS = true;
|
||||
// int boxLnAdjust = iChildItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.DiffContActBox ? 1 : 2;
|
||||
// box.Height = yoff - box.YOffset - (boxLnAdjust * vlnPrintObject.SixLinesPerInch); // new height, with children
|
||||
// yoff += 1 * vlnPrintObject.SixLinesPerInch;
|
||||
// box = null;
|
||||
//}
|
||||
}
|
||||
if (childItemInfo.IsSequential && childItemInfo.NextItemCount > 0 && childItemInfo.MyParent.IsHigh && ((childItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.XBlankW1stLevSub) == E_DocStructStyle.XBlankW1stLevSub))
|
||||
yoff += vlnPrintObject.SixLinesPerInch;
|
||||
@@ -1240,7 +1228,7 @@ namespace Volian.Print.Library
|
||||
float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin;
|
||||
xpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2;
|
||||
xpos = Math.Max(xpos, XOffsetBox + (float)docstyle.Layout.LeftMargin);
|
||||
MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font);
|
||||
MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font);
|
||||
MyPageHelper.MyGaps.Add(new Gap(msg_yLocation, msg_yLocation - MyPageHelper.BottomMessage.Height));
|
||||
}
|
||||
}
|
||||
@@ -1491,8 +1479,21 @@ namespace Volian.Print.Library
|
||||
{
|
||||
get { return _MyFlexGrid; }
|
||||
}
|
||||
private pkParagraph _MyPlaceKeeper = null;
|
||||
public pkParagraph MyPlaceKeeper
|
||||
{
|
||||
get { return _MyPlaceKeeper; }
|
||||
set { _MyPlaceKeeper = value; }
|
||||
}
|
||||
public static bool InList(int id, params int[] ids)
|
||||
{
|
||||
foreach (int listid in ids)
|
||||
if (id == listid) return true;
|
||||
return false;
|
||||
}
|
||||
public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo, string prefix, string suffix, float yoffRightParent)
|
||||
{
|
||||
BuildPlacekeeper(parent, itemInfo);
|
||||
if (itemInfo.ActiveFormat.MyStepSectionLayoutData.BoxLeftAdj != null)
|
||||
_MyBoxLeftAdj = float.Parse(itemInfo.ActiveFormat.MyStepSectionLayoutData.BoxLeftAdj);
|
||||
ShowSectionTitles = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles || itemInfo.MyDocStyle.ShowSectionTitles;
|
||||
@@ -2196,6 +2197,27 @@ namespace Volian.Print.Library
|
||||
if (XOffsetCenter != null) XOffset = (float)XOffsetCenter;
|
||||
}
|
||||
|
||||
private void BuildPlacekeeper(vlnParagraph parent, ItemInfo itemInfo)
|
||||
{
|
||||
if (itemInfo is SectionInfo && (itemInfo as SectionInfo).SectionConfig.Section_Placekeeper.ToUpper() != "N") // if is a section type and the section is marked to create placekeeper
|
||||
{
|
||||
MyPlaceKeeper = new pkParagraph(this);
|
||||
if (parent != null && parent.MyItemInfo.IsSection)
|
||||
parent.MyPlaceKeeper = MyPlaceKeeper;
|
||||
}
|
||||
else if (parent != null && parent.MyPlaceKeeper != null && itemInfo is StepInfo)//InList(parent.MyItemInfo.ItemID, 513, 514, 519, 520, 525))
|
||||
{
|
||||
StepConfig sc = itemInfo.MyConfig as StepConfig;
|
||||
if (sc != null && sc.Step_Placekeeper.ToUpper() != "N")
|
||||
{
|
||||
if (itemInfo.IsCautionPart || itemInfo.IsNotePart)
|
||||
MyPlaceKeeper = parent.MyPlaceKeeper.AddCautionsAndNotes(this);
|
||||
else
|
||||
MyPlaceKeeper = parent.MyPlaceKeeper.AddChild(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private vlnParagraph FindParentRNO()
|
||||
{
|
||||
if (ChildrenRight != null && ChildrenRight.Count > 0) return ChildrenRight[0];
|
||||
@@ -3088,11 +3110,7 @@ namespace Volian.Print.Library
|
||||
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + tabWidth + XOffsetBox;
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (itemInfo.ItemID == 167601)
|
||||
// Console.WriteLine("AER RNO Step");
|
||||
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)bx.TxtStart + _MyBoxLeftAdj + tabWidth + XOffsetBox;
|
||||
}
|
||||
if (myTab != null) myTab.XOffset = XOffset - tabWidth;
|
||||
}
|
||||
else if (itemInfo.IsRNOPart && itemInfo.MyParent != null && itemInfo.MyParent.IsRNOPart && itemInfo.FormatStepData.NumberWithLevel)
|
||||
|
Reference in New Issue
Block a user