This commit is contained in:
Kathy Ruffing 2012-01-27 12:47:44 +00:00
parent fed3b1e913
commit f8ce342257

View File

@ -151,10 +151,17 @@ namespace Volian.Print.Library
&& !MyItemInfo.MyDocStyle.CancelSectTitle && !MyItemInfo.MyDocStyle.CancelSectTitle
&& !MyItemInfo.MyDocStyle.SpecialStepsFoldout)) // Don't ouput the Step Section title && !MyItemInfo.MyDocStyle.SpecialStepsFoldout)) // Don't ouput the Step Section title
{ {
bool doprint = true;
// if this is a section, then check the section config for printable header too.
if (MyItemInfo.IsSection)
{
SectionConfig sch = MyItemInfo.MyConfig as SectionConfig;
if (sch != null && sch.Section_PrintHdr != "Y") doprint = false;
}
if (MyItemInfo.MyContent.MyGrid != null) if (MyItemInfo.MyContent.MyGrid != null)
retval = DrawGrid(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); retval = DrawGrid(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation);
else else
retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); if (doprint)retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation);
if (MyItemInfo.IsHigh) if (MyItemInfo.IsHigh)
{ {
MyPageHelper.PageBookmarks.Add(MyItemInfo, MyItemInfo.MyTab.CleanText + " " + MyItemInfo.DisplayText, MyPageHelper.PageBookmarks.Add(MyItemInfo, MyItemInfo.MyTab.CleanText + " " + MyItemInfo.DisplayText,
@ -555,7 +562,7 @@ namespace Volian.Print.Library
{ {
if (yLocation < yTopMargin) // continuous section if (yLocation < yTopMargin) // continuous section
{ {
if (ChildrenBelow == null) return 0; if (ChildrenBelow == null || ChildrenBelow.Count==0) return 0;
vlnParagraph firstChild = ChildrenBelow[0]; vlnParagraph firstChild = ChildrenBelow[0];
// This is a continuous section. There may be cases where the user put a manual page // This is a continuous section. There may be cases where the user put a manual page
@ -902,7 +909,13 @@ namespace Volian.Print.Library
if (itemInfo.MyTab != null && itemInfo.MyTab.Text != null && itemInfo.MyTab.Text != "") if (itemInfo.MyTab != null && itemInfo.MyTab.Text != null && itemInfo.MyTab.Text != "")
{ {
float localXOffset = XOffset; float localXOffset = XOffset;
if (itemInfo.IsSection && !itemInfo.MyDocStyle.CancelSectTitle && itemInfo.MyTab.Text.ToUpper() != "FOLDOUT") bool doprint = true;
if (itemInfo.IsSection)
{
SectionConfig sch = MyItemInfo.MyConfig as SectionConfig;
if (sch != null && sch.Section_PrintHdr != "Y") doprint = false;
}
if (doprint && itemInfo.IsSection && !itemInfo.MyDocStyle.CancelSectTitle && itemInfo.MyTab.Text.ToUpper() != "FOLDOUT")
{ {
doSectTab = true; doSectTab = true;
if (itemInfo.IsStepSection && formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Just == "PSLeft") if (itemInfo.IsStepSection && formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Just == "PSLeft")
@ -911,8 +924,6 @@ namespace Volian.Print.Library
if (formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos != null) if (formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos != null)
offset += (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; offset += (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos;
localXOffset = offset; localXOffset = offset;
// jsj - 12Aug2011
//localXOffset = (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos + (float)itemInfo.MyDocStyle.Layout.LeftMargin;
} }
} }
if (!itemInfo.IsSection || doSectTab) if (!itemInfo.IsSection || doSectTab)
@ -1018,9 +1029,15 @@ namespace Volian.Print.Library
Width = GetTableWidth(cb, IParagraph, MyItemInfo.MyDocStyle.Layout.PageWidth); Width = GetTableWidth(cb, IParagraph, MyItemInfo.MyDocStyle.Layout.PageWidth);
CalculateXOffset(itemInfo, maxRNO, formatInfo); CalculateXOffset(itemInfo, maxRNO, formatInfo);
} }
bool printhdr = true;
if (itemInfo.Steps != null && itemInfo.IsSection && itemInfo.Sections != null && itemInfo.Sections.Count > 0)
{
SectionConfig sc = itemInfo.MyConfig as SectionConfig;
if (sc != null && sc.Section_PrintHdr != "Y") printhdr = false;
}
// Determine if section title is output // Determine if section title is output
if (!itemInfo.IsStepSection if (!itemInfo.IsStepSection
|| (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles || (printhdr && formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles
&& !MyItemInfo.MyDocStyle.CancelSectTitle && !MyItemInfo.MyDocStyle.CancelSectTitle
&& !MyItemInfo.MyDocStyle.SpecialStepsFoldout)) && !MyItemInfo.MyDocStyle.SpecialStepsFoldout))
{ {
@ -1057,10 +1074,10 @@ namespace Volian.Print.Library
// Look for the meta section case where the 'Editable' flag is set to 'N', which means that // Look for the meta section case where the 'Editable' flag is set to 'N', which means that
// these steps should not be printed: // these steps should not be printed:
bool printsteps = true; bool printsteps = true;
if (itemInfo.Steps != null && itemInfo.IsSection) if (itemInfo.Steps != null && itemInfo.IsSection && itemInfo.Sections!=null && itemInfo.Sections.Count>0)
{ {
SectionConfig sc = itemInfo.MyConfig as SectionConfig; SectionConfig sc = itemInfo.MyConfig as SectionConfig;
if (sc != null && sc.SubSection_Edit == "N") printsteps = false; if (sc != null && sc.SubSection_Edit != "Y") printsteps = false;
} }
if (itemInfo.Steps != null && printsteps) yoff = ChildrenBelow.Add(cb, itemInfo.Steps, XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo); if (itemInfo.Steps != null && printsteps) yoff = ChildrenBelow.Add(cb, itemInfo.Steps, XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo);
@ -1503,7 +1520,6 @@ namespace Volian.Print.Library
float tabWidth = (myTab == null) ? 0 : myTab.Width; float tabWidth = (myTab == null) ? 0 : myTab.Width;
if (itemInfo.IsStepSection) if (itemInfo.IsStepSection)
{ {
if (itemInfo.MyDocStyle.CancelSectTitle) return;
if (formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Just == "PSLeft") if (formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Just == "PSLeft")
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos; XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos;
return; return;
@ -1516,7 +1532,6 @@ namespace Volian.Print.Library
Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
if (bx == null) if (bx == null)
{ {
//float xoff = 0;
if ((colOvrd??0)!=0) if ((colOvrd??0)!=0)
{ {
// 16-bit code subtracted the left margin // 16-bit code subtracted the left margin
@ -1528,21 +1543,13 @@ namespace Volian.Print.Library
float tabOffset = (myTab == null?0: myTab.XOffset) - XOffset; float tabOffset = (myTab == null?0: myTab.XOffset) - XOffset;
XOffset = (float)colOvrd; XOffset = (float)colOvrd;
if (myTab != null) if (myTab != null) myTab.XOffset = XOffset + tabOffset;
{
//myTab.XOffset += (MyParent.XOffset - myTab.XOffset);
myTab.XOffset = XOffset + tabOffset;
//if (myTab.ScriptCaution)
// myTab.XOffset += 10.8F;
//myTab.XOffset += xoff;
}
return; return;
} }
else else
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + tabWidth + XOffsetBox; XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + tabWidth + XOffsetBox;
} }
else else
//if (bx != null)
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)bx.TxtStart + tabWidth + XOffsetBox; XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)bx.TxtStart + tabWidth + XOffsetBox;
if (myTab != null) myTab.XOffset = XOffset - tabWidth; if (myTab != null) myTab.XOffset = XOffset - tabWidth;
} }
@ -1551,27 +1558,15 @@ namespace Volian.Print.Library
float x = 0; float x = 0;
float xoff = 0; float xoff = 0;
if ((colOvrd??0)!=0) if ((colOvrd??0)!=0)
{
x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)colOvrd; x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)colOvrd;
//xoff = (float)colOvrd;
//XOffset += xoff;
//if (myTab != null) myTab.XOffset += xoff;
}
else else
{
x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS; x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS;
}
//float x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS;
//float xoff = x - XOffset;
xoff = x - XOffset; xoff = x - XOffset;
// ColSByLevel will specify the column in which the High Level Step starts with // ColSByLevel will specify the column in which the High Level Step starts with
// respect to the overall level calculation based on sections & meta-sections. // respect to the overall level calculation based on sections & meta-sections.
// Only a few of the single column formats use this: WCN1, CAL1, RGEBCK // Only a few of the single column formats use this: WCN1, CAL1, RGEBCK
if (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel if (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel
&& itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles
&& !itemInfo.MyDocStyle.CancelSectTitle
&& !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel)) && !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel))
{ {
int indxLevel = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); int indxLevel = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel();
@ -1589,11 +1584,6 @@ namespace Volian.Print.Library
else else
XOffset = myTab.XOffset + (myTab.Text.Length * (float)itemInfo.FormatStepData.Font.CPI) - colsbylevel; XOffset = myTab.XOffset + (myTab.Text.Length * (float)itemInfo.FormatStepData.Font.CPI) - colsbylevel;
} }
//else
//{
// x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS;
//}
//xoff = x - XOffset;
else else
{ {
XOffset += xoff; XOffset += xoff;
@ -1608,23 +1598,24 @@ namespace Volian.Print.Library
{ {
if (myTab != null && itemInfo.IsSequential && formatInfo.PlantFormat.FormatData.SectData.UseMetaSections && formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.LeftJustifyList.Count > 0) if (myTab != null && itemInfo.IsSequential && formatInfo.PlantFormat.FormatData.SectData.UseMetaSections && formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.LeftJustifyList.Count > 0)
{ {
int indxLevels = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); int indxLevels = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); // kbr -1;
LeftJustifyList jstlst = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.LeftJustifyList; LeftJustifyList jstlst = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.LeftJustifyList;
bool foundleftj = false;
float tableftadj = 0; float tableftadj = 0;
foreach (LeftJustify lj in jstlst) foreach (LeftJustify lj in jstlst)
{ {
if (lj.Index == indxLevels) if (lj.Index == indxLevels)
{ {
foundleftj = true;
tableftadj = lj.Size ?? 0; tableftadj = lj.Size ?? 0;
break; break;
} }
} }
//float tableftadj = (jstlst[indxLevels >= jstlst.Count ? jstlst.Count - 1 : indxLevels].Size) ?? 0; // the order of this is important. First adjust the tab's xoffset for the width of
if (tableftadj != 0) tabWidth = myTab.Width = tableftadj; // (jstlst[indxLevels >= jstlst.Count ? jstlst.Count - 1 : indxLevels].Size) ?? 0; // the tab. The offset of text needs to be adjusted by the 'leftjustify' format variable
XOffset += tabWidth; // if it existed for this level.
myTab.XOffset += tabWidth; myTab.XOffset += tabWidth;
if (tableftadj != 0 && myTab.Width<tableftadj)
tabWidth = myTab.Width = tableftadj;
XOffset += tabWidth;
myTab.Rtf = myTab.Rtf.Replace(myTab.Text, myTab.Text.TrimStart(" ".ToCharArray())); myTab.Rtf = myTab.Rtf.Replace(myTab.Text, myTab.Text.TrimStart(" ".ToCharArray()));
Width = MyParent.Width - myTab.Width; Width = MyParent.Width - myTab.Width;
} }
@ -1635,22 +1626,6 @@ namespace Volian.Print.Library
} }
} }
} }
private static int CurrentSectionLevel(ItemInfo itemInfo)
{
int retval = 0;
SectionInfo si = itemInfo.MyActiveSection as SectionInfo;
if ((si != null && si.TrueSectionNum()) || (itemInfo.ActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_TreatAsTrueSectNum) == E_DocStructStyle.DSS_TreatAsTrueSectNum)
{
ItemInfo sec = itemInfo.MyActiveSection;
while (sec != null && sec.IsSection)
{
SectionConfig sc = sec.MyConfig as SectionConfig;
if (sc != null && sc.SubSection_AutoIndent != "N") retval++;
sec = sec.MyParent as SectionInfo;
}
}
return retval;
}
public void AdjustWidth(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo, vlnTab myTab) public void AdjustWidth(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo, vlnTab myTab)
{ {
int typ = ((int)itemInfo.MyContent.Type) % 10000; int typ = ((int)itemInfo.MyContent.Type) % 10000;