C2018-039: Upgrade – User Control of Format
This commit is contained in:
@@ -1027,7 +1027,8 @@ i = 0;
|
||||
//}
|
||||
VEPROMS.CSLA.Library.FormatInfo activeFormat = mySection.ActiveFormat;
|
||||
VEPROMS.CSLA.Library.DocStyle docStyle = mySection.MyDocStyle;
|
||||
Volian.Svg.Library.Svg mySvg = null;
|
||||
Volian.Svg.Library.Svg mySvg = null;
|
||||
// the following line fills in the svg/svggroup/svgparts for all that is defined in the genmac definition (svg for plant)
|
||||
mySvg = SvgSerializer<Volian.Svg.Library.Svg>.StringDeserialize(BuildMyText(activeFormat));
|
||||
mySvg.ViewBox.Height = 1100;
|
||||
mySvg.ViewBox.Width = 850;
|
||||
@@ -1209,6 +1210,31 @@ i = 0;
|
||||
private string BuildMyText(VEPROMS.CSLA.Library.FormatInfo activeFormat)
|
||||
{
|
||||
string sGenMac = activeFormat.GenMac;
|
||||
FormatInfo fibase = activeFormat;
|
||||
// If this format has checkoffs (go through docstyles to see if any sections 'usecheckoffs'), then see if the ucf checkoffs are
|
||||
// defined in the format's genmac:
|
||||
string sGenMacBase = null;
|
||||
foreach (DocStyle ds in activeFormat.PlantFormat.DocStyles.DocStyleList)
|
||||
{
|
||||
if (ds.Inactive == false && ds.UseCheckOffs && !sGenMac.ToUpper().Contains("C100"))
|
||||
{
|
||||
while (fibase.FormatID != fibase.ParentID) fibase = fibase.MyParent;
|
||||
sGenMacBase = fibase.GenMac;
|
||||
if (sGenMacBase != null && sGenMacBase != "")
|
||||
{
|
||||
XmlDocument xDocGenMacBase = new XmlDocument();
|
||||
xDocGenMacBase.LoadXml(sGenMacBase);
|
||||
sGenMacBase = xDocGenMacBase.DocumentElement.InnerXml;
|
||||
sGenMacBase = sGenMacBase.Replace("xmlns=\"http://www.w3.org/2000/svg\"", "");
|
||||
// replace fonts with hls fontname & size
|
||||
string bsfontfamily = activeFormat.PlantFormat.FormatData.StepDataList[0].Font.Family;
|
||||
string bsfontsize = activeFormat.PlantFormat.FormatData.StepDataList[0].Font.Size.ToString();
|
||||
sGenMacBase = sGenMacBase.Replace("{family}", bsfontfamily);
|
||||
sGenMacBase = sGenMacBase.Replace("{size}", bsfontsize);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sGenMac == null || sGenMac == "")
|
||||
{
|
||||
// If subformat and does not have its own genmac, find an inherited genmac.
|
||||
@@ -1219,7 +1245,11 @@ i = 0;
|
||||
tmpf = FormatInfo.Get(tmpf.ParentID);
|
||||
}
|
||||
if (sGenMac == null || sGenMac == "")
|
||||
sGenMac = "<svg/>";// return "";
|
||||
sGenMac = "<svg></svg>";
|
||||
}
|
||||
if (sGenMacBase != null && sGenMacBase != "")
|
||||
{
|
||||
sGenMac = sGenMac.Replace("</svg>", sGenMacBase + "</svg>");
|
||||
}
|
||||
if (!sGenMac.Contains("xmlns"))
|
||||
sGenMac = sGenMac.Replace("<svg ", "<svg xmlns='http://www.w3.org/2000/svg' ");
|
||||
|
@@ -4138,6 +4138,13 @@ namespace Volian.Print.Library
|
||||
xloc_co = XOffset + (relX > 0 ? Width : 0) + relX;
|
||||
}
|
||||
}
|
||||
// if there is ucf value for adjusting the alignment for checkoffs, use it:
|
||||
FormatConfig fc = PlantFormat.GetFormatConfig(formatInfo);
|
||||
if (fc != null && fc.PlantFormat.FormatData.CheckOffXOffAdj != null)
|
||||
{
|
||||
if (co.Index > 99) xloc_co += ((float)fc.PlantFormat.FormatData.CheckOffXOffAdj * 72);
|
||||
}
|
||||
|
||||
// CheckOffXtraLines was introduced for the additional lines needed for the longer signoffs
|
||||
// for VCBA (&WST1), for F2016-061.
|
||||
float checkOffNumberOfLines = (co.CheckOffNumberOfLines ?? 0);
|
||||
@@ -4823,7 +4830,8 @@ namespace Volian.Print.Library
|
||||
|
||||
// First see if there is any checkoff data in the format file and that there
|
||||
// is a pagelist item for the checkoff header.
|
||||
if (itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndex <= 0) return;
|
||||
int maxindx = itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffUCF ? itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndex : itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndexNoInherit;
|
||||
if (maxindx <= 0) return;
|
||||
if (MyPageHelper.PageListCheckOffHeader == null) return;
|
||||
|
||||
VE_Font font = null;
|
||||
|
Reference in New Issue
Block a user