FNP Xoffset improvements for AER & RNO tabs & text

This commit is contained in:
Kathy Ruffing 2013-12-04 13:02:41 +00:00
parent d088933be0
commit f087e6b092

View File

@ -1300,7 +1300,7 @@ namespace Volian.Print.Library
if (!MyPageHelper.MyParagraphs.ContainsKey(itemInfo.ItemID)) MyPageHelper.MyParagraphs.Add(itemInfo.ItemID, this);
// if this a continuous subsection, refresh the style.
if (itemInfo.IsSection && !(itemInfo as SectionInfo).IsSeparatePagination() && itemInfo.MyParent.IsSection)
if (itemInfo.IsStepSection && !(itemInfo as SectionInfo).IsSeparatePagination() && itemInfo.MyParent.IsSection)
RefreshDocStyle();
XOffset = xoff;
@ -1425,10 +1425,19 @@ namespace Volian.Print.Library
}
else if (mytab != null)
{
float adjusttab = (itemInfo.MyParent.IsHigh) ? itemInfo.FormatStepData.AdjHighLevelTab??0 : 0;
mytab.XOffset += (mytab.Width + adjusttab);
XOffset = mytab.XOffset + mytab.Width;
if (adjusttab != 0) Width += (mytab.Width);
// For Farley (only plant format to use AdjHighLevelTab), determine the xoffset based on
// where the right edge of the text is. Their RNO's are numbered with parent numbering
// so the calculations for determining the xoffset backs up from the right edge.
if (itemInfo.FormatStepData.AdjHighLevelTab != null)
{
float rightTextEdge = this.MyHighLevelParagraph.XOffset + this.MyHighLevelParagraph.Width;
int colRx = int.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[itemInfo.ColumnMode]);
rightTextEdge += (colRx + MyHighLevelParagraph.MyTab.Width - (itemInfo.FormatStepData.AdjHighLevelTab ?? 0));
float diff = rightTextEdge - (XOffset + Width);
mytab.XOffset += diff;
XOffset += diff;
adjustAgain = false;
}
}
}
if(adjustAgain)
@ -1737,13 +1746,8 @@ namespace Volian.Print.Library
float yOffRight = yoff;
float RnoOffset = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO);
if (rnoLevel < maxRNO && itemInfo.RNOs != null)
{
float tmpXoff = XOffset;
// if there is an RNO off of a substep at a level deeper than 1, use the parent's xoffset
// otherwise the Xoffset of the RNO is too far to the right.
if (((itemInfo.RNOs[0].FormatStepData.AdjHighLevelTab ?? 0) != 0) && itemInfo.PrintLevel > 1) tmpXoff = MyParent.XOffset;
yOffRight = ChildrenRight.Add(cb, itemInfo.RNOs, tmpXoff + RnoOffset, YTop, YTop, rnoLevel + 1, maxRNO, formatInfo);
}
yOffRight = ChildrenRight.Add(cb, itemInfo.RNOs, XOffset + RnoOffset, YTop, YTop, rnoLevel + 1, maxRNO, formatInfo);
// 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)
@ -2662,19 +2666,17 @@ namespace Volian.Print.Library
}
}
}
// if format had a tab adjustment for step type, use it
// if format had a tab adjustment for step type, use it. MyTab.Offset is only set for FNP formats
// to get the correct xoffset for their tabs/text. The issue is that they use very large tabs
// because levels of substeps include the parent tab. This code will only be run for FNP.
if (itemInfo.MyTab != null && itemInfo.MyTab.Offset != 0)
{
// The following is an attempt to fix FNP xoffsets - it is still under development:
//float xOffTabNew = MyParent.MyTab != null ? MyParent.MyTab.XOffset : MyParent.XOffset + itemInfo.MyTab.Offset;
//xOffTabNew += MyParent.MyTab == null ? 0 : MyParent.MyTab.TabOffset;
//float xIncrement = xOffTabNew - MyTab.XOffset;
//myTab.XOffset += xIncrement;
//XOffset += xIncrement;
//Width -= xIncrement;
myTab.XOffset -= itemInfo.MyTab.Offset;
XOffset -= itemInfo.MyTab.Offset;
Width += itemInfo.MyTab.Offset;
float xOffTabNew = (MyParent.MyTab != null ? MyParent.MyTab.XOffset : MyParent.XOffset) + itemInfo.MyTab.Offset;
xOffTabNew += MyParent.MyTab == null ? 0 : MyParent.MyTab.TabOffset;
float xIncrement = xOffTabNew - MyTab.XOffset;
myTab.XOffset += xIncrement;
XOffset += xIncrement;
Width -= xIncrement;
}
}
@ -2703,12 +2705,13 @@ namespace Volian.Print.Library
else
widOvrd = itemInfo.FormatStepData == null ? null : (float?)ToInt(itemInfo.FormatStepData.WidthOverride, maxRNO);
//widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride;
if (itemInfo.IsRNOPart && itemInfo.MyParent.IsHigh && itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAlt != null)
// Don't adjust the RNO width if in single column mode:
if (itemInfo.IsRNOPart && itemInfo.MyParent.IsHigh && itemInfo.MyActiveSection.ColumnMode != 0 && itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAlt != null)
{
string[] splitRNOWidthAlt = itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAlt.Split(',');
float ovrd = (itemInfo.RNOLevel < splitRNOWidthAlt.Length) ? float.Parse(splitRNOWidthAlt[itemInfo.RNOLevel]) : 0;
if (ovrd > 0)
widOvrd = ovrd + 6; // Change bars on RNO column (signoff line) would not line up with 16-bit without this - NSP Alarms
widOvrd = ovrd; // + 6; // Change bars on RNO column (signoff line) would not line up with 16-bit without this - NSP Alarms
}
if ((widOvrd??0) != 0)
{