Added support for Wolf Creek Background Indent Used by a number of plants

This commit is contained in:
Rich 2016-05-27 18:06:28 +00:00
parent f4609c2f50
commit 65ba080983
2 changed files with 25 additions and 5 deletions

View File

@ -3819,6 +3819,22 @@ namespace VEPROMS.CSLA.Library
}
return false;
}
// Function to find if in part of a Background Step
public bool IsPartOfBackgroundStep()
{
if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.WolfCreekBackgroundFormat)
{
ItemInfo itm = this;
while (itm.MyPrevious != null)
{
if (itm.MyPrevious.IsBackgroundStep()) return true;
if (itm.MyPrevious != null && itm.MyPrevious.IsStep && itm.MyPrevious.FormatStepData.Type.ToUpper() == "TITLEWITHTEXTBELOW" && FormatStepData.Type.ToUpper() != "IMPLICITOR") return true;
itm = itm.MyPrevious;
}
return false;
}
return false;
}
private bool InNote()
{
// walk up until procedure level and if finding a note type, return true, otherwise false.

View File

@ -4854,6 +4854,7 @@ namespace Volian.Print.Library
{
if (myTab != null) myTab.XOffset = XOffset;
XOffset += (itemInfo.FormatStepData.Font.CharsToTwips * 2); // indent 2 characters for background steps
Width -= (itemInfo.FormatStepData.Font.CharsToTwips * 2); // Adjust width by 2 characters
return;
}
else if (itemInfo.FormatStepData.UseOldTemplate && itemInfo.IsInTemplate() &&
@ -4885,8 +4886,10 @@ namespace Volian.Print.Library
XOffset = (float)colOvrd;
else
{
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin;
Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin;
//Adjuust Indent for Wolf Creek Background format flag
float indentBG1 = itemInfo.IsPartOfBackgroundStep() ? itemInfo.FormatStepData.Font.CharsToTwips * 2 : 0;
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + indentBG1;
Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin - indentBG1;
}
return;
}
@ -4901,8 +4904,10 @@ namespace Volian.Print.Library
}
else
{
XOffset = childindent + MyParent.XOffset;//(itemInfo.FormatStepData.Font.CharsToTwips * 2);
Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin;
//Adjuust Indent for Wolf Creek Background format flag
float indentBG2 = itemInfo.IsPartOfBackgroundStep() ? itemInfo.FormatStepData.Font.CharsToTwips * 2 : 0;
XOffset = childindent + MyParent.XOffset+ indentBG2;//(itemInfo.FormatStepData.Font.CharsToTwips * 2);
Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin - indentBG2;
}
return;
}
@ -5180,7 +5185,6 @@ namespace Volian.Print.Library
Width -= xIncrement;
}
}
private bool PreviousIsTitleWithTextBelow(ItemInfo itemInfo)
{
while(itemInfo.MyPrevious != null)