Added code to use ShowSectionTitles property

This commit is contained in:
Rich 2013-07-02 15:33:57 +00:00
parent 54bae90bfb
commit 5d7d23f292

View File

@ -82,22 +82,22 @@ namespace Volian.Print.Library
{ {
if (bxIndx != null) if (bxIndx != null)
{ {
if (box != null) if (box != null)
{ {
box.Height = yoff - box.YOffset; // new height, with children box.Height = yoff - box.YOffset; // new height, with children
if (childItemInfo.MyHeader != null && childItemInfo.MyPrevious != null if (childItemInfo.MyHeader != null && childItemInfo.MyPrevious != null
&& ((childItemInfo.MyPrevious.IsCaution && childItemInfo.IsCaution) || && ((childItemInfo.MyPrevious.IsCaution && childItemInfo.IsCaution) ||
(childItemInfo.MyPrevious.IsNote && childItemInfo.IsNote))) (childItemInfo.MyPrevious.IsNote && childItemInfo.IsNote)))
yoff += vlnPrintObject.SixLinesPerInch * 2; yoff += vlnPrintObject.SixLinesPerInch * 2;
}
box = new vlnBox();
box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
int ln = 1; // a format flag determines whether there is a space before the note/caution.
if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++;
if (childItemInfo.MixCautionNotesDiffType()) ln += 2;
box.YOffset = yoff + ((ln - 1) * vlnPrintObject.SixLinesPerInch);
yoff += ln * vlnPrintObject.SixLinesPerInch;
} }
box = new vlnBox();
box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
int ln = 1; // a format flag determines whether there is a space before the note/caution.
if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++;
if (childItemInfo.MixCautionNotesDiffType()) ln += 2;
box.YOffset = yoff + ((ln - 1) * vlnPrintObject.SixLinesPerInch);
yoff += ln * vlnPrintObject.SixLinesPerInch;
}
} }
bxIndex = bxIndx; bxIndex = bxIndx;
} }
@ -170,6 +170,13 @@ namespace Volian.Print.Library
get { return _IsWordDocPara; } get { return _IsWordDocPara; }
set { _IsWordDocPara = value; } set { _IsWordDocPara = value; }
} }
private bool _ShowSectionTitles;
public bool ShowSectionTitles
{
get { return _ShowSectionTitles; }
set { _ShowSectionTitles = value; }
}
public float ParagraphToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin) public float ParagraphToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
{ {
if (Processed) return yPageStart; if (Processed) return yPageStart;
@ -187,6 +194,8 @@ namespace Volian.Print.Library
if (MyItemInfo.HasChangeBar && MyPageHelper.ChangeBarDefinition.MyChangeBarType != PrintChangeBar.Without) MyPageHelper.AddChangeBar(DoChangeBar(cb, MyItemInfo, MyPageHelper, XOffset, yLocation, MyPageHelper.MaxRNO, MyItemInfo.ActiveFormat), cbMess); if (MyItemInfo.HasChangeBar && MyPageHelper.ChangeBarDefinition.MyChangeBarType != PrintChangeBar.Without) MyPageHelper.AddChangeBar(DoChangeBar(cb, MyItemInfo, MyPageHelper, XOffset, yLocation, MyPageHelper.MaxRNO, MyItemInfo.ActiveFormat), cbMess);
float retval = yLocation; float retval = yLocation;
bool doprint = true; bool doprint = true;
if (MyItemInfo.ItemID == 25045)
Console.WriteLine("jcb");
if (MyItemInfo.IsFigure) if (MyItemInfo.IsFigure)
{ {
yLocation -= (SixLinesPerInch * MyPageHelper.YMultiplier); yLocation -= (SixLinesPerInch * MyPageHelper.YMultiplier);
@ -197,7 +206,7 @@ namespace Volian.Print.Library
} }
else if (!MyItemInfo.IsStepSection else if (!MyItemInfo.IsStepSection
|| (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles || (ShowSectionTitles
&& !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
{ {
@ -205,7 +214,7 @@ namespace Volian.Print.Library
if (MyItemInfo.IsSection) if (MyItemInfo.IsSection)
{ {
SectionConfig sch = MyItemInfo.MyConfig as SectionConfig; SectionConfig sch = MyItemInfo.MyConfig as SectionConfig;
if (!(MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles if (!(ShowSectionTitles
&& !MyItemInfo.MyDocStyle.CancelSectTitle && !MyItemInfo.MyDocStyle.CancelSectTitle
&& !MyItemInfo.MyDocStyle.SpecialStepsFoldout && !MyItemInfo.MyDocStyle.SpecialStepsFoldout
&& !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) && !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections)
@ -758,7 +767,7 @@ namespace Volian.Print.Library
PromsPrinter.DoFoldoutPage(cb, "HLS (7 lpi) break", MyPageHelper.TextLayer, MyPageHelper, MyItemInfo.FoldoutIndex()); PromsPrinter.DoFoldoutPage(cb, "HLS (7 lpi) break", MyPageHelper.TextLayer, MyPageHelper, MyItemInfo.FoldoutIndex());
} }
if (MyItemInfo.MyParent != null && MyItemInfo.MyParent.IsStepSection && if (MyItemInfo.MyParent != null && MyItemInfo.MyParent.IsStepSection &&
MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles ShowSectionTitles
&& !MyItemInfo.MyDocStyle.CancelSectTitle && !MyItemInfo.MyDocStyle.CancelSectTitle
&& !MyItemInfo.MyDocStyle.SpecialStepsFoldout) && !MyItemInfo.MyDocStyle.SpecialStepsFoldout)
yPageStart = yPageStart; // if printing the section title, we already have the y location yPageStart = yPageStart; // if printing the section title, we already have the y location
@ -1015,6 +1024,7 @@ namespace Volian.Print.Library
private int COL_WID_ADJ = 6; // adjusts for incorrect use of WidSTable when breaking a line (it breaks 6 chars too short) private int COL_WID_ADJ = 6; // adjusts for incorrect use of WidSTable when breaking a line (it breaks 6 chars too short)
public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo, string prefix, string suffix) public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo, string prefix, string suffix)
{ {
ShowSectionTitles = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles || itemInfo.MyDocStyle.ShowSectionTitles;
int MetaLevel = 0; // if meta section, stores what level this section is. int MetaLevel = 0; // if meta section, stores what level this section is.
float savCheckListBottomMost = 0; float savCheckListBottomMost = 0;
//int[] problemIDs = { 889 }; //int[] problemIDs = { 889 };
@ -1068,7 +1078,7 @@ namespace Volian.Print.Library
if (itemInfo.IsSection) if (itemInfo.IsSection)
{ {
SectionConfig sch = MyItemInfo.MyConfig as SectionConfig; SectionConfig sch = MyItemInfo.MyConfig as SectionConfig;
if (!(MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles if (!(ShowSectionTitles
&& !MyItemInfo.MyDocStyle.CancelSectTitle && !MyItemInfo.MyDocStyle.CancelSectTitle
&& !MyItemInfo.MyDocStyle.SpecialStepsFoldout) && !MyItemInfo.MyDocStyle.SpecialStepsFoldout)
&& &&
@ -1336,7 +1346,7 @@ namespace Volian.Print.Library
else else
if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null) XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null) XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0);
if (itemInfo.IsSection && formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles if (itemInfo.IsSection && ShowSectionTitles
&& !MyItemInfo.MyDocStyle.CancelSectTitle) && !MyItemInfo.MyDocStyle.CancelSectTitle)
{ {
if (MyItemInfo.MyDocStyle.Layout.SectionMacro != null) if (MyItemInfo.MyDocStyle.Layout.SectionMacro != null)
@ -1366,7 +1376,7 @@ namespace Volian.Print.Library
// Get Y offset for regular steps, or if section title is output or if not within row (not last column of // Get Y offset for regular steps, or if section title is output or if not within row (not last column of
// text) for wcn checklist, i.e. // text) for wcn checklist, i.e.
if ((!itemInfo.IsStepSection && !itemInfo.MyHLS.FormatStepData.UseSmartTemplate) // regular step if ((!itemInfo.IsStepSection && !itemInfo.MyHLS.FormatStepData.UseSmartTemplate) // regular step
|| (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles || (ShowSectionTitles
&& !MyItemInfo.MyDocStyle.CancelSectTitle && !MyItemInfo.MyDocStyle.CancelSectTitle
&& !MyItemInfo.MyDocStyle.SpecialStepsFoldout) && !MyItemInfo.MyDocStyle.SpecialStepsFoldout)
// In Checklist: I don't have children or if I have children the first child doesn't alignwithparent. // In Checklist: I don't have children or if I have children the first child doesn't alignwithparent.
@ -1397,28 +1407,28 @@ namespace Volian.Print.Library
// checkoff - this was added for shearon harris: // checkoff - this was added for shearon harris:
if (!(co.NotOnEmpty && itemInfo.MyContent.Text.Replace(@"\u160?"," ").TrimEnd() == "")) if (!(co.NotOnEmpty && itemInfo.MyContent.Text.Replace(@"\u160?"," ").TrimEnd() == ""))
{ {
float xloc_co = (float)itemInfo.MyDocStyle.Layout.LeftMargin; float xloc_co = (float)itemInfo.MyDocStyle.Layout.LeftMargin;
// if the format has 'SkipSpaces', look at the tab, and back up the macros to the number of // if the format has 'SkipSpaces', look at the tab, and back up the macros to the number of
// spaces in the tab. // spaces in the tab.
if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.SkipSpaces) if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.SkipSpaces)
{
if (mytab != null)
xloc_co = mytab.XOffset;
else
xloc_co = XOffset; //there's no tab - put checkoff at step's xoff. Macro should back up from step's x.
}
else
{
if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation != null)
xloc_co += (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation;
if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.RelXLocation != null)
{ {
float relX = (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.RelXLocation; if (mytab != null)
xloc_co = XOffset + (relX > 0 ? Width : 0) + relX; xloc_co = mytab.XOffset;
else
xloc_co = XOffset; //there's no tab - put checkoff at step's xoff. Macro should back up from step's x.
} }
else
{
if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation != null)
xloc_co += (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation;
if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.RelXLocation != null)
{
float relX = (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.RelXLocation;
xloc_co = XOffset + (relX > 0 ? Width : 0) + relX;
}
}
PartsRight.Add(new vlnMacro(xloc_co, yForCheckoff, co.Macro));
} }
PartsRight.Add(new vlnMacro(xloc_co, yForCheckoff, co.Macro));
}
} }
float yOffRight = yoff; float yOffRight = yoff;
float RnoOffset = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO); float RnoOffset = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO);
@ -2325,7 +2335,7 @@ namespace Volian.Print.Library
{ {
if (sd.StepSectionData.StepSectionLayoutData.TieTabToLevel) if (sd.StepSectionData.StepSectionLayoutData.TieTabToLevel)
{ {
if (itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles if (ShowSectionTitles
&& !itemInfo.MyDocStyle.CancelSectTitle && !itemInfo.MyDocStyle.CancelSectTitle
&& !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel)) && !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel))
{ {