fix text width for 2nd level sections (WCN); do not print section continue message if subsection starts at top of page (BGE)

This commit is contained in:
Kathy Ruffing 2015-01-06 14:19:17 +00:00
parent 1541cc4f13
commit 1d0dca79b4

View File

@ -1167,7 +1167,7 @@ namespace Volian.Print.Library
if (doSectionContinue) DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle , null); if (doSectionContinue) DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle , null);
// If "ContinueSectionHeader" (format flag) is true then print the section title with "(Continued)" appended to it // If "ContinueSectionHeader" (format flag) is true then print the section title with "(Continued)" appended to it
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader && (!MyItemInfo.IsSection || MyItemInfo.IsSeparateSubsection)) if (!MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader && (!MyItemInfo.IsSection || MyItemInfo.IsSeparateSubsection))
{ {
SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig; SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig;
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle; doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle;
@ -4375,30 +4375,7 @@ namespace Volian.Print.Library
} }
float adjwidth = CheckOffAdj; float adjwidth = CheckOffAdj;
CheckOffWidth = -CheckOffAdj; CheckOffWidth = -CheckOffAdj;
SectData sd = formatInfo.PlantFormat.FormatData.SectData; adjwidth = AdjustMetaWidth(itemInfo, formatInfo, adjwidth);
if (sd.UseMetaSections)
{
if (sd.StepSectionData.StepSectionLayoutData.TieTabToLevel)
{
if (ShowSectionTitles
&& !itemInfo.MyDocStyle.CancelSectTitle
&& !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel))
{
int indxLevel = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel();
adjwidth += formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].WidSAdjByLevel ?? 0; ;
float colsbylevel = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel;
float seclvlindent = colsbylevel - (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS;
adjwidth -= seclvlindent;
adjwidth -= AdjustForSectionLevelTab();
}
}
else
{
if (formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count > 0)
adjwidth += (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[itemInfo.PrintLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel;
}
}
Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO);
Width += _WidthAdjust; Width += _WidthAdjust;
Width += adjwidth; Width += adjwidth;
@ -4456,7 +4433,10 @@ namespace Volian.Print.Library
} }
else if (itemInfo.IsSection) else if (itemInfo.IsSection)
{ {
Width = _WidthAdjust + ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO);
float adjwidths = 0;
adjwidths = AdjustMetaWidth(itemInfo, formatInfo, adjwidths);
Width += (adjwidths + _WidthAdjust);
} }
else if (MyParent == null) else if (MyParent == null)
{ {
@ -4500,6 +4480,35 @@ namespace Volian.Print.Library
Width += 10; // FIX THIS!!! Width += 10; // FIX THIS!!!
} }
private float AdjustMetaWidth(ItemInfo itemInfo, FormatInfo formatInfo, float adjwidth)
{
SectData sd = formatInfo.PlantFormat.FormatData.SectData;
if (sd.UseMetaSections)
{
if (sd.StepSectionData.StepSectionLayoutData.TieTabToLevel)
{
if (ShowSectionTitles
&& !itemInfo.MyDocStyle.CancelSectTitle
&& !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel))
{
int indxLevel = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel();
if (indxLevel > 1) Console.WriteLine("level={0} in: {1}", indxLevel, itemInfo.ShortPath);
adjwidth += formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].WidSAdjByLevel ?? 0; ;
float colsbylevel = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel;
float seclvlindent = colsbylevel - (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS;
adjwidth -= seclvlindent;
if (itemInfo.IsStep) adjwidth -= AdjustForSectionLevelTab();
}
}
else
{
if (formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count > 0)
adjwidth += (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[itemInfo.PrintLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel;
}
}
return adjwidth;
}
// for Component Table, don't increment yoff unless last item in table that HAS data associated // for Component Table, don't increment yoff unless last item in table that HAS data associated
// with it (there may be empty cells at end). // with it (there may be empty cells at end).
public bool UseTemplateKeepOnCurLine(ItemInfo itemInfo) public bool UseTemplateKeepOnCurLine(ItemInfo itemInfo)