Point Beach backgrounds: Added support for continue message; don’t add posadjust to children of same type; add support for LimitWidToPageWid
Added support for ProcDescr2 pagelist item & support for ProcDescr1 = {null} (inheritance was causing it to print when it shouldn’t have)
This commit is contained in:
parent
97c4d4d941
commit
fdeb055bde
@ -1219,7 +1219,10 @@ namespace Volian.Print.Library
|
||||
string matchStr = (pd.MatchProcNumber.StartsWith("*}")) ? pd.MatchProcNumber.Substring(2) : pd.MatchProcNumber;
|
||||
if (procnum.Contains(matchStr))
|
||||
{
|
||||
plstr = pd.ProcDescr1;
|
||||
if (pd.ProcDescr1 == "{null}") // used to override fmt file inheritance & set null/empty string
|
||||
plstr = "";
|
||||
else
|
||||
plstr = pd.ProcDescr1;
|
||||
break;
|
||||
}
|
||||
if (pd.MatchProcNumber == "@")
|
||||
@ -1236,6 +1239,35 @@ namespace Volian.Print.Library
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "{PROCDES2}":
|
||||
ProcDescrList pdl2 = section.ActiveFormat.PlantFormat.FormatData.PrintData.ProcDescrList;
|
||||
if (pdl2 != null && pdl2.Count > 0)
|
||||
{
|
||||
string procnum = section.MyProcedure.MyContent.Number;
|
||||
foreach (ProcDescr pd in pdl2)
|
||||
{
|
||||
if (pd.MatchProcNumber != null)
|
||||
{
|
||||
string matchStr = (pd.MatchProcNumber.StartsWith("*}")) ? pd.MatchProcNumber.Substring(2) : pd.MatchProcNumber;
|
||||
if (procnum.Contains(matchStr))
|
||||
{
|
||||
plstr = pd.ProcDescr2;
|
||||
break;
|
||||
}
|
||||
if (pd.MatchProcNumber == "@")
|
||||
{
|
||||
if (Regex.IsMatch(procnum, "^[A-Za-z]+$"))
|
||||
plstr = pd.ProcDescr2;
|
||||
else
|
||||
plstr = "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
plstr = "UNKNOWN";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "{CURDATE}":
|
||||
DateTime thisDate1 = DateTime.Today;
|
||||
plstr = plstr.Replace(token, thisDate1.ToString("MMMM dd, yyyy"));
|
||||
|
@ -290,6 +290,7 @@ namespace Volian.Print.Library
|
||||
get { return _PageBreakOnStep; }
|
||||
set { _PageBreakOnStep = value; }
|
||||
}
|
||||
private float WidthNoLimit = 0;
|
||||
private vlnTable _MyGrid;
|
||||
public vlnTable MyGrid
|
||||
{
|
||||
@ -1007,6 +1008,8 @@ namespace Volian.Print.Library
|
||||
if (myMsg != null && myMsg != "")
|
||||
{
|
||||
yPageStart -= 2 * SixLinesPerInch;// Allow two lines for top continue message
|
||||
if (myMsg.IndexOf(@"%3d") > -1)
|
||||
myMsg = myMsg.Replace(@"%3d", MyItemInfo.MyHLS.Ordinal.ToString());
|
||||
if (myMsg.IndexOf(@"%d") > -1)
|
||||
myMsg = myMsg.Replace(@"%d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim(" .".ToCharArray()));
|
||||
if (myMsg.IndexOf(@"%c") > -1)
|
||||
@ -1184,6 +1187,8 @@ namespace Volian.Print.Library
|
||||
myMsg = myMsg.Replace(@"%0d", tb.Trim(" .".ToCharArray()));
|
||||
if (myMsg.IndexOf(@"%2d") > -1)
|
||||
myMsg = myMsg.Replace(@"%2d", tb.Trim(" .".ToCharArray()).PadLeft(2));
|
||||
if (myMsg.IndexOf(@"%3d") > -1)
|
||||
myMsg = myMsg.Replace(@"%3d", MyItemInfo.MyHLS.Ordinal.ToString());
|
||||
return myMsg;
|
||||
}
|
||||
private vlnParagraph TopMostChild
|
||||
@ -1855,8 +1860,20 @@ namespace Volian.Print.Library
|
||||
CalculateXOffsetGridOrFigure(itemInfo, maxRNO, formatInfo);
|
||||
}
|
||||
else
|
||||
if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null) XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0);
|
||||
if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null && (itemInfo.IsHigh || (!itemInfo.IsHigh && itemInfo.MyContent.Type != itemInfo.MyParent.MyContent.Type))) XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0);
|
||||
|
||||
// point beach wpb subformats 20 & 22 were printing some text past right margin. Limit the width to the right margin, i.e. pagewid
|
||||
if (itemInfo.ActiveFormat.MyStepSectionPrintData.LimitWidToPageWid)
|
||||
{
|
||||
float lim = (MyTab == null ? (XOffset - (float)itemInfo.MyDocStyle.Layout.LeftMargin) : MyTab.XOffset + MyTab.Width) + Width;
|
||||
float docStyleLim = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin;
|
||||
|
||||
if (lim > docStyleLim)
|
||||
{
|
||||
WidthNoLimit = Width; // Use this width to calculate childrens' width, without this, code was making children to narrow!
|
||||
Width = docStyleLim - (MyTab == null ? (XOffset - (float)itemInfo.MyDocStyle.Layout.LeftMargin) : MyTab.XOffset + MyTab.Width);
|
||||
}
|
||||
}
|
||||
if (itemInfo.IsSection && ShowSectionTitles
|
||||
&& !MyItemInfo.MyDocStyle.CancelSectTitle)
|
||||
{
|
||||
@ -3210,6 +3227,8 @@ namespace Volian.Print.Library
|
||||
Width = adjwidth + MyParent.Width;
|
||||
else if (itemInfo.MyTab.Position != 0)
|
||||
Width = adjwidth + MyParent.Width;
|
||||
else if (MyParent.WidthNoLimit != 0)
|
||||
Width = adjwidth + MyParent.WidthNoLimit - tabWidth + (myTab == null ? 0 : myTab.TabAlign);
|
||||
else
|
||||
Width = adjwidth + MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user