New Table of Contents flags & MaxWidth for PSIs (for current page)
Improve message when format is changed and not certain if section type is valid. (part of B2016-165) vcb1: Added MaxWidthCurPage for PSI text widths (use for current page) vcb1: Table of Contents values for subsections line spacing and grouping section numbers Table of Contents to handle single space subsections & Grouping section names remove group title Use MaxWidthCurPage to handle max width, but don’t account for multiple lines when printing content
This commit is contained in:
parent
4feea15106
commit
146e1fb968
Binary file not shown.
@ -610,8 +610,8 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
if (oldSelIndx > newDocStyles.Count)
|
if (oldSelIndx > newDocStyles.Count)
|
||||||
{
|
{
|
||||||
string msg = string.Format("The section type that is set is not available in the new format, it was reset to '{0}'. Verify that it is appropriate.", newDocStyles.GetDocStyleItem(0).Name);
|
string msg = string.Format("Since the format has been changed, the section type was also changed to '{0}'. Verify that it is appropriate and if not, select a new section type.", newDocStyles.GetDocStyleItem(0).Name);
|
||||||
MessageBox.Show(msg, "Non-existent section");
|
MessageBox.Show(msg, "Verify section type");
|
||||||
selindx = 0;
|
selindx = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,6 +133,18 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return (LazyLoad(ref _MaxWidth, "@MaxWidth"));
|
return (LazyLoad(ref _MaxWidth, "@MaxWidth"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// MaxWidth, above, flagged that, if there was more than 1 line, the topmargin would be adjusted by however
|
||||||
|
// many lines the PSI item contained (for wst alarms). The MaxWidthCurPage is used when that adjustment
|
||||||
|
// should not be made, the length of the PSI item is only relevant for the current page.
|
||||||
|
// (see AdjustTopMarginForMultiLinePageListItems variable and how it is used)
|
||||||
|
private LazyLoad<int?> _MaxWidthCurPage;
|
||||||
|
public int? MaxWidthCurPage
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return (LazyLoad(ref _MaxWidthCurPage, "@MaxWidthCurPage"));
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Override ToString
|
#region Override ToString
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
|
@ -3928,6 +3928,22 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return (tocProcStepsTitle == null || tocProcStepsTitle == "") ? "" : tocProcStepsTitle;
|
return (tocProcStepsTitle == null || tocProcStepsTitle == "") ? "" : tocProcStepsTitle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private LazyLoad<int?> _TofCLineSpacingSub;
|
||||||
|
public int? TofCLineSpacingSub
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return LazyLoad(ref _TofCLineSpacingSub, "@TofCLineSpacingSub");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private LazyLoad<bool> _TofCRemoveGrpNameInSects;
|
||||||
|
public bool TofCRemoveGrpNameInSects
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return LazyLoad(ref _TofCRemoveGrpNameInSects, "@TofCRemoveGrpNameInSects");
|
||||||
|
}
|
||||||
|
}
|
||||||
private VE_Font _Font;
|
private VE_Font _Font;
|
||||||
public VE_Font Font
|
public VE_Font Font
|
||||||
{
|
{
|
||||||
|
@ -1180,11 +1180,25 @@ namespace Volian.Print.Library
|
|||||||
yLocation = lastyLocation = 0;
|
yLocation = lastyLocation = 0;
|
||||||
rtnval = Rtf2Pdf.TextAt(cb, myparagraphtc, leftMargin + secNumPos, yPageStart - yLocation, w, height, "", yBottomMargin);
|
rtnval = Rtf2Pdf.TextAt(cb, myparagraphtc, leftMargin + secNumPos, yPageStart - yLocation, w, height, "", yBottomMargin);
|
||||||
}
|
}
|
||||||
yLocation += (2 * vlnPrintObject.SixLinesPerInch); // new line
|
int lnaftergroup = ((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 0) > 0) ? 1 : 2;
|
||||||
|
yLocation += (lnaftergroup * vlnPrintObject.SixLinesPerInch); // new line
|
||||||
}
|
}
|
||||||
// need to do the section number, section title & page number. Page number
|
// need to do the section number, section title & page number. Page number
|
||||||
// has to be put on at end after number of page is known, so use a Template.
|
// has to be put on at end after number of page is known, so use a Template.
|
||||||
|
bool didGrp = false;
|
||||||
string tmptxt = mySection.MyContent.Number == null || mySection.MyContent.Number == "" ? " " : mySection.MyContent.Number;
|
string tmptxt = mySection.MyContent.Number == null || mySection.MyContent.Number == "" ? " " : mySection.MyContent.Number;
|
||||||
|
if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCRemoveGrpNameInSects
|
||||||
|
&& tocGrpHeading.Length > 0 && tmptxt.ToUpper().Contains(tocGrpHeading))
|
||||||
|
{
|
||||||
|
tmptxt = tmptxt.Replace(tocGrpHeading, "");
|
||||||
|
didGrp = true;
|
||||||
|
}
|
||||||
|
if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCRemoveGrpNameInSects
|
||||||
|
&& lastTOCGroupHeading.Length > 0 && tmptxt.ToUpper().Contains(lastTOCGroupHeading))
|
||||||
|
{
|
||||||
|
tmptxt = tmptxt.Replace(lastTOCGroupHeading, "");
|
||||||
|
didGrp = true;
|
||||||
|
}
|
||||||
string rtfText = GetRtfToC(tmptxt, tOfC);
|
string rtfText = GetRtfToC(tmptxt, tOfC);
|
||||||
Paragraph myparagraphn = vlnPrintObject.RtfToParagraph(rtfText);
|
Paragraph myparagraphn = vlnPrintObject.RtfToParagraph(rtfText);
|
||||||
float width = 0;
|
float width = 0;
|
||||||
@ -1254,7 +1268,7 @@ namespace Volian.Print.Library
|
|||||||
// is put out.
|
// is put out.
|
||||||
retval = Rtf2Pdf.TextAt(cb, myparagraphn, leftMargin + secNumPos + indentOffset, yPageStart - yLocation, numwidth * 1.3F, height, "", yBottomMargin);
|
retval = Rtf2Pdf.TextAt(cb, myparagraphn, leftMargin + secNumPos + indentOffset, yPageStart - yLocation, numwidth * 1.3F, height, "", yBottomMargin);
|
||||||
|
|
||||||
float lSpace = (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch;
|
//float lSpace = (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch;
|
||||||
|
|
||||||
// adjust ylocation for pagenumber - the ylocation will get reset if the
|
// adjust ylocation for pagenumber - the ylocation will get reset if the
|
||||||
// section title split on 2 lines and the page number needs to be on the 2nd line.
|
// section title split on 2 lines and the page number needs to be on the 2nd line.
|
||||||
@ -1330,8 +1344,15 @@ namespace Volian.Print.Library
|
|||||||
else
|
else
|
||||||
AddTemplateTOCPageCounts(tOfC, yLocation, yPageStartAdj, leftMargin, secPagePos, height, mySection);
|
AddTemplateTOCPageCounts(tOfC, yLocation, yPageStartAdj, leftMargin, secPagePos, height, mySection);
|
||||||
}
|
}
|
||||||
|
//If the format wants single spacing within subsections (2nd level and lower), then need to figure out
|
||||||
yLocation += (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch;
|
// spacing (vcb1 table of contents)
|
||||||
|
bool dosuby = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0)
|
||||||
|
&& (mySection.MyParent.IsSection && ((mySection.Sections != null && mySection.Sections.Count > 0) || (level > 0 && mySection.NextItem != null))))
|
||||||
|
|| didGrp;
|
||||||
|
if (dosuby)
|
||||||
|
yLocation += (float)(tOfC.TofCLineSpacingSub ?? 1) * vlnPrintObject.SixLinesPerInch;
|
||||||
|
else
|
||||||
|
yLocation += (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch;
|
||||||
}
|
}
|
||||||
yLocation = AddSectionToTOC(tocSection, mySection, tOfC, cb, yPageStart, yLocation);
|
yLocation = AddSectionToTOC(tocSection, mySection, tOfC, cb, yPageStart, yLocation);
|
||||||
}
|
}
|
||||||
|
@ -2000,10 +2000,11 @@ namespace Volian.Print.Library
|
|||||||
// defined, see if the text is too wide for a single line (SplitTextMaxWidth). The
|
// defined, see if the text is too wide for a single line (SplitTextMaxWidth). The
|
||||||
// AdjustTopMarginForMultLinePageListItem contains the y-adjustment that must be considered
|
// AdjustTopMarginForMultLinePageListItem contains the y-adjustment that must be considered
|
||||||
// in the TopMargin if the PSI text split onto more than one line.
|
// in the TopMargin if the PSI text split onto more than one line.
|
||||||
if ((pageItem.MaxWidth??0)>0)
|
if ((pageItem.MaxWidth??0)>0 || (pageItem.MaxWidthCurPage??0)>0)
|
||||||
{
|
{
|
||||||
int locwid = (int)pageItem.MaxWidth;
|
int locwid = ((pageItem.MaxWidth??0)>0)?(int)pageItem.MaxWidth:(int)pageItem.MaxWidthCurPage;
|
||||||
AdjustTopMarginForMultiLinePageListItems = SplitTextMaxWidth(svgGroup, pageItem, val, locwid, token, ref plstr);
|
AdjustTopMarginForMultiLinePageListItems = SplitTextMaxWidth(svgGroup, pageItem, val, locwid, token, ref plstr);
|
||||||
|
if ((pageItem.MaxWidthCurPage ?? 0) > 0) AdjustTopMarginForMultiLinePageListItems = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
plstr = plstr.Replace(token, val);
|
plstr = plstr.Replace(token, val);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user