This commit is contained in:
parent
7cfc6420e8
commit
b8344c8ca1
@ -1494,7 +1494,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public MetaTag MyFooter
|
public MetaTag MyFooter
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (!_TagsSetup) SetupTags();
|
if (!_TagsSetup) SetupTags();
|
||||||
return _MyFooter;
|
return _MyFooter;
|
||||||
}
|
}
|
||||||
@ -1504,12 +1504,253 @@ namespace VEPROMS.CSLA.Library
|
|||||||
protected bool _TagsSetup = false;
|
protected bool _TagsSetup = false;
|
||||||
public virtual void SetupTags()
|
public virtual void SetupTags()
|
||||||
{
|
{
|
||||||
_MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.Font);
|
if (IsStep)
|
||||||
_MyHeader = null;
|
{
|
||||||
_MyFooter = null;
|
MyTab = new Tab(FormatStepData.TabData.Font);
|
||||||
_MyTab.CleanText = DisplayNumber;
|
MyHeader = new MetaTag(FormatStepData.TabData.Font);
|
||||||
|
MyFooter = new MetaTag(FormatStepData.TabData.Font);
|
||||||
|
SetTabText();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.Font);
|
||||||
|
_MyHeader = null;
|
||||||
|
_MyFooter = null;
|
||||||
|
_MyTab.CleanText = DisplayNumber;
|
||||||
|
}
|
||||||
_TagsSetup = true;
|
_TagsSetup = true;
|
||||||
}
|
}
|
||||||
|
protected void SetTabText()
|
||||||
|
{
|
||||||
|
string cltext = null;
|
||||||
|
if (IsParagraph)
|
||||||
|
{
|
||||||
|
_MyTab.Text = "";
|
||||||
|
_MyTab.CleanText = "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int stepType = (int)(MyContent.Type % 10000);
|
||||||
|
string tbformat = IsInRNO ? FormatStepData.TabData.RNOIdentPrint : FormatStepData.TabData.IdentPrint;
|
||||||
|
// rno gets parent tab
|
||||||
|
if (IsRNO)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if ((((ItemInfo)ActiveParent).IsHigh && FormatStepData.NumberHighLevel) || ((!((ItemInfo)ActiveParent).IsHigh) && ((tbformat == null || tbformat == "") && (RNOLevel <= ColumnMode))))
|
||||||
|
{
|
||||||
|
_MyTab.CleanText = ((ItemInfo)ActiveParent).MyTab.CleanText;
|
||||||
|
_MyTab.Text = ((ItemInfo)ActiveParent).MyTab.Text;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine("SetTabText IsRNO error {0}", ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (tbformat == null)
|
||||||
|
{
|
||||||
|
_MyTab.Text = "";
|
||||||
|
_MyTab.CleanText = "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Start with basic cases of alpha/numeric/seq:
|
||||||
|
if (tbformat.IndexOf("{seq}") > -1)
|
||||||
|
{
|
||||||
|
int level = 0;
|
||||||
|
ItemInfo par = this;
|
||||||
|
while (!par.IsHigh)
|
||||||
|
{
|
||||||
|
// 16bit TODO:
|
||||||
|
//if (par.IsRNO) // do I need to save 'lastrnoptr'
|
||||||
|
//if (!IsRNO(ptr) && (IsSequential(ptr) ||
|
||||||
|
// (!IsText(ptr) && CountAllSubLevels))) - Add this line of code for non-hlp
|
||||||
|
if (!par.IsRNO && par.IsSequential) level++;
|
||||||
|
par = par.MyParent;
|
||||||
|
}
|
||||||
|
SeqTabFmtList seqtabs = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.SeqTabFmtList;
|
||||||
|
tbformat = seqtabs[level % seqtabs.Count].PrintTabFormat;
|
||||||
|
// If token includes 'Wpar', the parent tab prefix's the tab.
|
||||||
|
if (level > 0 && (tbformat.IndexOf("{numericWpar}") > -1 || tbformat.IndexOf("{alphaWpar}") > -1 || tbformat.IndexOf("{ALPHAWpar}") > -1))
|
||||||
|
{
|
||||||
|
string parentTab = ((ItemInfo)(ActiveParent)).MyTab.CleanText.Trim();
|
||||||
|
tbformat = parentTab + (parentTab.EndsWith(".") ? "" : ".") + tbformat.TrimStart();
|
||||||
|
}
|
||||||
|
if (tbformat.IndexOf("#2#") > -1 || tbformat.IndexOf("#1#") > -1)
|
||||||
|
{
|
||||||
|
string ofst = tbformat.Substring(0, 3);
|
||||||
|
_MyTab.Offset = Convert.ToInt32(ofst.Substring(1, 1));
|
||||||
|
cltext = tbformat.Replace("#2#", "");
|
||||||
|
cltext = cltext.Replace("#1#", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if this is a caution/note type determine where 'NOTE/CAUTION' tab goes, as tab or as 'header'
|
||||||
|
// and also determine whether the tab itself gets converted to a bullet.
|
||||||
|
if (IsCaution || IsNote) tbformat = CheckNoteCautionTab(tbformat);
|
||||||
|
|
||||||
|
int ordinal = Ordinal;
|
||||||
|
string alpha = AlphabeticalNumbering(ordinal);
|
||||||
|
tbformat = tbformat.Replace("{alpha}", alpha.ToLower());
|
||||||
|
tbformat = tbformat.Replace("{alphaWpar}", alpha.ToLower());
|
||||||
|
tbformat = tbformat.Replace("{ALPHA}", alpha);
|
||||||
|
tbformat = tbformat.Replace("{ALPHAWpar}", alpha);
|
||||||
|
string roman = RomanNumbering(ordinal);
|
||||||
|
tbformat = tbformat.Replace("{roman}", roman.ToLower());
|
||||||
|
tbformat = tbformat.Replace("{ROMAN}", roman);
|
||||||
|
tbformat = tbformat.Replace("{numeric}", ordinal.ToString().PadLeft(2));
|
||||||
|
tbformat = tbformat.Replace("{numericWpar}", ordinal.ToString());
|
||||||
|
|
||||||
|
if (tbformat.IndexOf("{!C0}") > -1)
|
||||||
|
{
|
||||||
|
cltext = cltext == null ? tbformat.Replace("{!C0}", "") : cltext.Replace("{!C0}", "");
|
||||||
|
}
|
||||||
|
if (FormatStepData.Sep != null && MyPrevious != null)
|
||||||
|
{
|
||||||
|
if (_MyHeader == null) _MyHeader = new MetaTag(FormatStepData.TabData.Font);
|
||||||
|
_MyHeader.Text = _MyHeader.CleanText = FormatStepData.Sep;
|
||||||
|
MyHeader.Justify = ContentAlignment.MiddleCenter;
|
||||||
|
}
|
||||||
|
#region Non HLP tab TODO
|
||||||
|
// other possible 'tokens'
|
||||||
|
// Position offset - do this one here, so don't get background substitution below..
|
||||||
|
// ##-3# - Offset of -3 from Parent (FNP)
|
||||||
|
// "{Pos-3}"
|
||||||
|
|
||||||
|
// Background/Deviation Documents - check for E_PurchaseOptions.(ENHANCEDBACKGROUNDS or ENHANCEDDEVIATIONS)
|
||||||
|
// # - Related Caution or Note number
|
||||||
|
// ~ - Linked Step Number
|
||||||
|
//"{LNK C/N Num}"
|
||||||
|
//"{LNK Step Num}"
|
||||||
|
|
||||||
|
//Section Numbers
|
||||||
|
// % - Prefix with section number (works string in 16 bit, ie.e For 4.3 the prefix becomes 4.
|
||||||
|
// wid that would be stored.
|
||||||
|
//"{Section Prefix}"
|
||||||
|
|
||||||
|
// Position offset
|
||||||
|
// \257 - Indent (CALLOWAY BACKGROUNDS)
|
||||||
|
// Newline within a tab (calbck)
|
||||||
|
//"{indent}");
|
||||||
|
//"{par}");
|
||||||
|
|
||||||
|
//Macros
|
||||||
|
// <!diamond> - draws a diamond around the stepnumber
|
||||||
|
// <!diamond1> - A macro
|
||||||
|
// <!asterisk>
|
||||||
|
// <> - ignored
|
||||||
|
// \241 - circle macro around step, same as <!circle>
|
||||||
|
// Also note, the format files had "<>", these get converted during input in this
|
||||||
|
// format converter code.
|
||||||
|
//wkstr = wkstr.Replace("{!asterisk}", "\\fs10 \\b*\\b0"); // was font size 20 in 16-bit
|
||||||
|
//wkstr = Regex.Replace(wkstr, @"{![.*?]}", @"{!$1}");
|
||||||
|
//wkstr = wkstr.Replace("{}", "");
|
||||||
|
//wkstr = wkstr.Replace("ñ", "{!C0}");
|
||||||
|
//if (vefont != null && vefont.HasCircleString2()) wkstr.Insert(0,"{!C0}");
|
||||||
|
|
||||||
|
//wkstr = wkstr.Replace("ê", @"{Box Step}");
|
||||||
|
#endregion
|
||||||
|
_MyTab.Text = tbformat;
|
||||||
|
_MyTab.CleanText = cltext != null ? cltext : tbformat;
|
||||||
|
}
|
||||||
|
private string CheckNoteCautionTab(string tbformat)
|
||||||
|
{
|
||||||
|
string prevTbFormat = null;
|
||||||
|
string nextTbFormat = null;
|
||||||
|
StepData nextStepData = null;
|
||||||
|
if (MyPrevious != null)
|
||||||
|
{
|
||||||
|
int prevStepType = ((int)MyPrevious.MyContent.Type) % 10000;
|
||||||
|
StepData prevStepData = ActiveFormat.PlantFormat.FormatData.StepDataList[prevStepType];
|
||||||
|
prevTbFormat = MyPrevious.IsInRNO ? prevStepData.TabData.RNOIdentPrint : prevStepData.TabData.IdentPrint;
|
||||||
|
}
|
||||||
|
if (NextItem != null)
|
||||||
|
{
|
||||||
|
int nextStepType = ((int)NextItem.MyContent.Type) % 10000;
|
||||||
|
nextStepData = ActiveFormat.PlantFormat.FormatData.StepDataList[nextStepType];
|
||||||
|
// tried to duplicate functionality from 16-bit code.
|
||||||
|
nextTbFormat = NextItem.IsInRNO ? nextStepData.TabData.RNOIdentPrint : nextStepData.TabData.IdentPrint;
|
||||||
|
}
|
||||||
|
// Handle the centered tab - if this tab is centered make it a header.
|
||||||
|
if (FormatStepData.TabData.Justify == "Center")
|
||||||
|
{
|
||||||
|
if (_MyHeader == null) _MyHeader = new MetaTag(FormatStepData.TabData.Font);
|
||||||
|
MyHeader.Justify = ContentAlignment.MiddleCenter;
|
||||||
|
MyHeader.Text = MyHeader.CleanText = tbformat.Trim(); ;
|
||||||
|
|
||||||
|
// if there is only step in the group - no bullet is used, if more that one replace the tab
|
||||||
|
// with a bullet
|
||||||
|
if (MyPrevious == null && NextItem == null)
|
||||||
|
tbformat = "";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (MyPrevious != null) MyHeader = null;
|
||||||
|
tbformat = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB;
|
||||||
|
if ((FormatStepData.TabData.Font.Style & E_Style.Underline) > 0)
|
||||||
|
{
|
||||||
|
FontStyle style = FontStyle.Regular;
|
||||||
|
if ((FormatStepData.TabData.Font.Style & E_Style.Bold) > 0) style |= FontStyle.Bold;
|
||||||
|
if ((FormatStepData.TabData.Font.Style & E_Style.Italics) > 0) style |= FontStyle.Italic;
|
||||||
|
_MyTab.MyFont.WindowsFont = new Font(FormatStepData.TabData.Font.WindowsFont.FontFamily, FormatStepData.TabData.Font.WindowsFont.Size, style);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return tbformat;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If this has a previous, and the tabs of this & previous match
|
||||||
|
if (tbformat != null && MyPrevious != null && !FormatStepData.AlwaysTab && (!FormatStepData.MixCautionsAndNotes || (tbformat == prevTbFormat)))
|
||||||
|
{
|
||||||
|
tbformat = tbformat + ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB;
|
||||||
|
}
|
||||||
|
// else if this has a next
|
||||||
|
else if (tbformat != null && NextItem != null && !FormatStepData.AlwaysTab &&
|
||||||
|
(!FormatStepData.MixCautionsAndNotes ||
|
||||||
|
(FormatStepData.TabData.UsePreviousStyle && !nextStepData.TabData.UsePreviousStyle && tbformat == nextTbFormat) ||
|
||||||
|
((prevTbFormat != tbformat && (NextItem.MyContent.Type == (int)(MyContent.Type % 10000))))))
|
||||||
|
{
|
||||||
|
tbformat = tbformat + ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB;
|
||||||
|
}
|
||||||
|
return tbformat;
|
||||||
|
}
|
||||||
|
private string AlphabeticalNumbering(int number)
|
||||||
|
{
|
||||||
|
string retval = string.Empty;
|
||||||
|
if (number > 26) retval += Letter((number - 1) / 26);
|
||||||
|
retval += Letter(1 + ((number - 1) % 26));
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
private string Letter(int number)
|
||||||
|
{
|
||||||
|
char c = (char)(number + 64);
|
||||||
|
return c.ToString();
|
||||||
|
}
|
||||||
|
private enum RomanOffset : int
|
||||||
|
{
|
||||||
|
Hundreds = 2,
|
||||||
|
Tens = 4,
|
||||||
|
Units = 6
|
||||||
|
}
|
||||||
|
private string _Romans = "MDCLXVI";
|
||||||
|
private string RomanPart(RomanOffset offset, int value)
|
||||||
|
{
|
||||||
|
int iFive = value / 5;
|
||||||
|
int iUnits = value % 5;
|
||||||
|
int iFour = iUnits / 4;
|
||||||
|
return _Romans.Substring(((int)offset), iFour) +
|
||||||
|
_Romans.Substring(((int)offset) - iFive - iFour, iFive | iFour) +
|
||||||
|
"".PadRight(iUnits % 4, _Romans[((int)offset)]);
|
||||||
|
}
|
||||||
|
private string RomanNumbering(int number)
|
||||||
|
{
|
||||||
|
int thousands = number / 1000;
|
||||||
|
int hundreds = (number % 1000) / 100;
|
||||||
|
int tens = (number % 100) / 10;
|
||||||
|
int units = number % 10;
|
||||||
|
return "".PadRight(thousands, _Romans[0]) +
|
||||||
|
RomanPart(RomanOffset.Hundreds, hundreds) +
|
||||||
|
RomanPart(RomanOffset.Tens, tens) +
|
||||||
|
RomanPart(RomanOffset.Units, units);
|
||||||
|
}
|
||||||
public static void ResetTabString(int itemID)
|
public static void ResetTabString(int itemID)
|
||||||
{
|
{
|
||||||
ConvertListToDictionary();
|
ConvertListToDictionary();
|
||||||
@ -1533,6 +1774,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public ContentAlignment Justify = ContentAlignment.MiddleLeft;
|
public ContentAlignment Justify = ContentAlignment.MiddleLeft;
|
||||||
public string Text; // may include tokens, such as macros for circles/diamonds, etc
|
public string Text; // may include tokens, such as macros for circles/diamonds, etc
|
||||||
public string CleanText; // all tokens removed
|
public string CleanText; // all tokens removed
|
||||||
|
//public bool _TagsSetup = false;
|
||||||
public MetaTag()
|
public MetaTag()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -2127,7 +2369,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
_MyTab.Text = DisplayNumber;
|
_MyTab.Text = DisplayNumber;
|
||||||
_MyTab.CleanText = DisplayNumber.PadRight(20);
|
_MyTab.CleanText = DisplayNumber.PadRight(20);
|
||||||
MyHeader = new MetaTag(ActiveFormat.PlantFormat.FormatData.SectData.SectionHeader.Font);
|
MyHeader = new MetaTag(ActiveFormat.PlantFormat.FormatData.SectData.SectionHeader.Font);
|
||||||
_MyHeader.Text = null; // this.DisplayText;
|
_MyHeader.Text = null;
|
||||||
MyFooter = null;
|
MyFooter = null;
|
||||||
_TagsSetup = true;
|
_TagsSetup = true;
|
||||||
}
|
}
|
||||||
@ -2252,240 +2494,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
_TagsSetup = true;
|
_TagsSetup = true;
|
||||||
MyTab = new Tab(FormatStepData.TabData.Font);
|
MyTab = new Tab(FormatStepData.TabData.Font);
|
||||||
MyHeader = new MetaTag(FormatStepData.TabData.Font);
|
MyHeader = new MetaTag(FormatStepData.TabData.Font);
|
||||||
MyFooter = new MetaTag(FormatStepData.TabData.Font); ;
|
MyFooter = new MetaTag(FormatStepData.TabData.Font);
|
||||||
SetTabText();
|
SetTabText();
|
||||||
}
|
}
|
||||||
private void SetTabText()
|
|
||||||
{
|
|
||||||
string cltext = null;
|
|
||||||
if (IsParagraph) // TODO: Do we need this?
|
|
||||||
{
|
|
||||||
_MyTab.Text = "";
|
|
||||||
_MyTab.CleanText = "";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int stepType = (int)(MyContent.Type % 10000);
|
|
||||||
string tbformat = IsInRNO ? FormatStepData.TabData.RNOIdentPrint : FormatStepData.TabData.IdentPrint;
|
|
||||||
// rno gets parent tab
|
|
||||||
if (IsRNO)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if ((((ItemInfo)ActiveParent).IsHigh && FormatStepData.NumberHighLevel) || ((!((ItemInfo)ActiveParent).IsHigh) && ((tbformat == null || tbformat == "") && (RNOLevel <= ColumnMode))))
|
|
||||||
{
|
|
||||||
_MyTab.CleanText = ((ItemInfo)ActiveParent).MyTab.CleanText;
|
|
||||||
_MyTab.Text = ((ItemInfo)ActiveParent).MyTab.Text;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine("SetTabText IsRNO error {0}", ex.Message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (tbformat == null)
|
|
||||||
{
|
|
||||||
_MyTab.Text = "";
|
|
||||||
_MyTab.CleanText = "";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Start with basic cases of alpha/numeric/seq:
|
|
||||||
if (tbformat.IndexOf("{seq}") > -1)
|
|
||||||
{
|
|
||||||
int level = 0;
|
|
||||||
ItemInfo par = this;
|
|
||||||
while (!par.IsHigh)
|
|
||||||
{
|
|
||||||
// 16bit TODO:
|
|
||||||
//if (par.IsRNO) // do I need to save 'lastrnoptr'
|
|
||||||
//if (!IsRNO(ptr) && (IsSequential(ptr) ||
|
|
||||||
// (!IsText(ptr) && CountAllSubLevels))) - Add this line of code for non-hlp
|
|
||||||
if (!par.IsRNO && par.IsSequential) level++;
|
|
||||||
par = par.MyParent;
|
|
||||||
}
|
|
||||||
SeqTabFmtList seqtabs = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.SeqTabFmtList;
|
|
||||||
tbformat = seqtabs[level % seqtabs.Count].PrintTabFormat;
|
|
||||||
// If token includes 'Wpar', the parent tab prefix's the tab.
|
|
||||||
if (level > 0 && (tbformat.IndexOf("{numericWpar}")>-1 || tbformat.IndexOf("{alphaWpar}")>-1 || tbformat.IndexOf("{ALPHAWpar}")>-1))
|
|
||||||
{
|
|
||||||
string parentTab = ((ItemInfo)(ActiveParent)).MyTab.CleanText.Trim();
|
|
||||||
tbformat = parentTab + (parentTab.EndsWith(".")?"":".") + tbformat.TrimStart();
|
|
||||||
}
|
|
||||||
if (tbformat.IndexOf("#2#") > -1 || tbformat.IndexOf("#1#") > -1)
|
|
||||||
{
|
|
||||||
string ofst = tbformat.Substring(0, 3);
|
|
||||||
_MyTab.Offset = Convert.ToInt32(ofst.Substring(1, 1));
|
|
||||||
cltext = tbformat.Replace("#2#", "");
|
|
||||||
cltext = cltext.Replace("#1#", "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// if this is a caution/note type determine where 'NOTE/CAUTION' tab goes, as tab or as 'header'
|
|
||||||
// and also determine whether the tab itself gets converted to a bullet.
|
|
||||||
if (IsCaution || IsNote) tbformat = CheckNoteCautionTab(tbformat);
|
|
||||||
|
|
||||||
int ordinal = Ordinal;
|
|
||||||
string alpha = AlphabeticalNumbering(ordinal);
|
|
||||||
tbformat = tbformat.Replace("{alpha}", alpha.ToLower());
|
|
||||||
tbformat = tbformat.Replace("{alphaWpar}", alpha.ToLower());
|
|
||||||
tbformat = tbformat.Replace("{ALPHA}", alpha);
|
|
||||||
tbformat = tbformat.Replace("{ALPHAWpar}", alpha);
|
|
||||||
string roman = RomanNumbering(ordinal);
|
|
||||||
tbformat = tbformat.Replace("{roman}", roman.ToLower());
|
|
||||||
tbformat = tbformat.Replace("{ROMAN}", roman);
|
|
||||||
tbformat = tbformat.Replace("{numeric}", ordinal.ToString().PadLeft(2));
|
|
||||||
tbformat = tbformat.Replace("{numericWpar}", ordinal.ToString());
|
|
||||||
|
|
||||||
if (tbformat.IndexOf("{!C0}") > -1)
|
|
||||||
{
|
|
||||||
cltext = cltext==null?tbformat.Replace("{!C0}", ""):cltext.Replace("{!C0}","");
|
|
||||||
}
|
|
||||||
if (FormatStepData.Sep != null && MyPrevious != null)
|
|
||||||
{
|
|
||||||
if (_MyHeader == null) _MyHeader = new MetaTag(FormatStepData.TabData.Font);
|
|
||||||
_MyHeader.Text = _MyHeader.CleanText = FormatStepData.Sep;
|
|
||||||
MyHeader.Justify = ContentAlignment.MiddleCenter;
|
|
||||||
}
|
|
||||||
#region Non HLP tab TODO
|
|
||||||
// other possible 'tokens'
|
|
||||||
// Position offset - do this one here, so don't get background substitution below..
|
|
||||||
// ##-3# - Offset of -3 from Parent (FNP)
|
|
||||||
// "{Pos-3}"
|
|
||||||
|
|
||||||
// Background/Deviation Documents - check for E_PurchaseOptions.(ENHANCEDBACKGROUNDS or ENHANCEDDEVIATIONS)
|
|
||||||
// # - Related Caution or Note number
|
|
||||||
// ~ - Linked Step Number
|
|
||||||
//"{LNK C/N Num}"
|
|
||||||
//"{LNK Step Num}"
|
|
||||||
|
|
||||||
//Section Numbers
|
|
||||||
// % - Prefix with section number (works string in 16 bit, ie.e For 4.3 the prefix becomes 4.
|
|
||||||
// wid that would be stored.
|
|
||||||
//"{Section Prefix}"
|
|
||||||
|
|
||||||
// Position offset
|
|
||||||
// \257 - Indent (CALLOWAY BACKGROUNDS)
|
|
||||||
// Newline within a tab (calbck)
|
|
||||||
//"{indent}");
|
|
||||||
//"{par}");
|
|
||||||
|
|
||||||
//Macros
|
|
||||||
// <!diamond> - draws a diamond around the stepnumber
|
|
||||||
// <!diamond1> - A macro
|
|
||||||
// <!asterisk>
|
|
||||||
// <> - ignored
|
|
||||||
// \241 - circle macro around step, same as <!circle>
|
|
||||||
// Also note, the format files had "<>", these get converted during input in this
|
|
||||||
// format converter code.
|
|
||||||
//wkstr = wkstr.Replace("{!asterisk}", "\\fs10 \\b*\\b0"); // was font size 20 in 16-bit
|
|
||||||
//wkstr = Regex.Replace(wkstr, @"{![.*?]}", @"{!$1}");
|
|
||||||
//wkstr = wkstr.Replace("{}", "");
|
|
||||||
//wkstr = wkstr.Replace("ñ", "{!C0}");
|
|
||||||
//if (vefont != null && vefont.HasCircleString2()) wkstr.Insert(0,"{!C0}");
|
|
||||||
|
|
||||||
//wkstr = wkstr.Replace("ê", @"{Box Step}");
|
|
||||||
#endregion
|
|
||||||
_MyTab.Text = tbformat;
|
|
||||||
_MyTab.CleanText = cltext!=null?cltext:tbformat;
|
|
||||||
}
|
|
||||||
private string CheckNoteCautionTab(string tbformat)
|
|
||||||
{
|
|
||||||
string prevTbFormat = null;
|
|
||||||
string nextTbFormat = null;
|
|
||||||
StepData nextStepData = null;
|
|
||||||
if (MyPrevious != null)
|
|
||||||
{
|
|
||||||
int prevStepType = ((int)MyPrevious.MyContent.Type) % 10000;
|
|
||||||
StepData prevStepData = ActiveFormat.PlantFormat.FormatData.StepDataList[prevStepType];
|
|
||||||
prevTbFormat = MyPrevious.IsInRNO ? prevStepData.TabData.RNOIdentPrint : prevStepData.TabData.IdentPrint;
|
|
||||||
}
|
|
||||||
if (NextItem != null)
|
|
||||||
{
|
|
||||||
int nextStepType = ((int)NextItem.MyContent.Type) % 10000;
|
|
||||||
nextStepData = ActiveFormat.PlantFormat.FormatData.StepDataList[nextStepType];
|
|
||||||
// tried to duplicate functionality from 16-bit code.
|
|
||||||
nextTbFormat = NextItem.IsInRNO ? nextStepData.TabData.RNOIdentPrint : nextStepData.TabData.IdentPrint;
|
|
||||||
}
|
|
||||||
// Handle the centered tab - if this tab is centered make it a header.
|
|
||||||
if (FormatStepData.TabData.Justify == "Center")
|
|
||||||
{
|
|
||||||
if (_MyHeader == null) _MyHeader = new MetaTag(FormatStepData.TabData.Font);
|
|
||||||
MyHeader.Justify = ContentAlignment.MiddleCenter;
|
|
||||||
MyHeader.Text = MyHeader.CleanText = tbformat.Trim(); ;
|
|
||||||
|
|
||||||
// if there is only step in the group - no bullet is used, if more that one replace the tab
|
|
||||||
// with a bullet
|
|
||||||
if (MyPrevious == null && NextItem == null)
|
|
||||||
tbformat = "";
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (MyPrevious != null) MyHeader = null;
|
|
||||||
tbformat = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB;
|
|
||||||
if ((FormatStepData.TabData.Font.Style & E_Style.Underline) > 0)
|
|
||||||
{
|
|
||||||
FontStyle style = FontStyle.Regular;
|
|
||||||
if ((FormatStepData.TabData.Font.Style & E_Style.Bold) > 0) style |= FontStyle.Bold;
|
|
||||||
if ((FormatStepData.TabData.Font.Style & E_Style.Italics) > 0) style |= FontStyle.Italic;
|
|
||||||
_MyTab.MyFont.WindowsFont = new Font(FormatStepData.TabData.Font.WindowsFont.FontFamily, FormatStepData.TabData.Font.WindowsFont.Size, style);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return tbformat;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If this has a previous, and the tabs of this & previous match
|
|
||||||
if (tbformat != null && MyPrevious != null && !FormatStepData.AlwaysTab && (!FormatStepData.MixCautionsAndNotes || (tbformat == prevTbFormat)))
|
|
||||||
{
|
|
||||||
tbformat = tbformat + ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB;
|
|
||||||
}
|
|
||||||
// else if this has a next
|
|
||||||
else if (tbformat != null && NextItem != null && !FormatStepData.AlwaysTab &&
|
|
||||||
(!FormatStepData.MixCautionsAndNotes ||
|
|
||||||
(FormatStepData.TabData.UsePreviousStyle && !nextStepData.TabData.UsePreviousStyle && tbformat == nextTbFormat) ||
|
|
||||||
((prevTbFormat != tbformat && (NextItem.MyContent.Type == (int)(MyContent.Type % 10000))))))
|
|
||||||
{
|
|
||||||
tbformat = tbformat + ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB;
|
|
||||||
}
|
|
||||||
return tbformat;
|
|
||||||
}
|
|
||||||
private string AlphabeticalNumbering(int number)
|
|
||||||
{
|
|
||||||
string retval = string.Empty;
|
|
||||||
if (number > 26) retval += Letter((number - 1) / 26);
|
|
||||||
retval += Letter(1 + ((number - 1) % 26));
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
private string Letter(int number)
|
|
||||||
{
|
|
||||||
char c = (char)(number + 64);
|
|
||||||
return c.ToString();
|
|
||||||
}
|
|
||||||
private enum RomanOffset : int
|
|
||||||
{
|
|
||||||
Hundreds = 2,
|
|
||||||
Tens = 4,
|
|
||||||
Units = 6
|
|
||||||
}
|
|
||||||
private string _Romans = "MDCLXVI";
|
|
||||||
private string RomanPart(RomanOffset offset, int value)
|
|
||||||
{
|
|
||||||
int iFive = value / 5;
|
|
||||||
int iUnits = value % 5;
|
|
||||||
int iFour = iUnits / 4;
|
|
||||||
return _Romans.Substring(((int)offset), iFour) +
|
|
||||||
_Romans.Substring(((int)offset) - iFive - iFour, iFive | iFour) +
|
|
||||||
"".PadRight(iUnits % 4, _Romans[((int)offset)]);
|
|
||||||
}
|
|
||||||
private string RomanNumbering(int number)
|
|
||||||
{
|
|
||||||
int thousands = number / 1000;
|
|
||||||
int hundreds = (number % 1000) / 100;
|
|
||||||
int tens = (number % 100) / 10;
|
|
||||||
int units = number % 10;
|
|
||||||
return "".PadRight(thousands, _Romans[0]) +
|
|
||||||
RomanPart(RomanOffset.Hundreds, hundreds) +
|
|
||||||
RomanPart(RomanOffset.Tens, tens) +
|
|
||||||
RomanPart(RomanOffset.Units, units);
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
protected override void RefreshFields(Item tmp)
|
protected override void RefreshFields(Item tmp)
|
||||||
{
|
{
|
||||||
|
@ -345,7 +345,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (parenstr != "<NO TITLE>" || tb._FormatData.ProcData.PrintNoTitle)
|
if (parenstr != "<NO TITLE>" || tb._FormatData.ProcData.PrintNoTitle)
|
||||||
{
|
{
|
||||||
lretstr.Append(tb._FormatData.TransData.DelimiterForTransitionTitle);
|
lretstr.Append(tb._FormatData.TransData.DelimiterForTransitionTitle);
|
||||||
lretstr.Append(tb._FormatData.TransData.CapsTransitions ? parenstr.ToUpper() :
|
lretstr.Append(tb._FormatData.TransData.CapsTransitions ? parenstr.ToUpper().Replace(@"\U", @"\u") :
|
||||||
tb._FormatData.TransData.Cap1stCharTrans ? CapFirstLetterOnly(parenstr, 0) :
|
tb._FormatData.TransData.Cap1stCharTrans ? CapFirstLetterOnly(parenstr, 0) :
|
||||||
parenstr);
|
parenstr);
|
||||||
lretstr.Append(tb._FormatData.TransData.DelimiterForTransitionTitle);
|
lretstr.Append(tb._FormatData.TransData.DelimiterForTransitionTitle);
|
||||||
@ -380,7 +380,18 @@ namespace VEPROMS.CSLA.Library
|
|||||||
case 2: // step
|
case 2: // step
|
||||||
sret = StepInfo.Get(item.ItemID).MyTab.CleanText;
|
sret = StepInfo.Get(item.ItemID).MyTab.CleanText;
|
||||||
if (!item.IsHigh)
|
if (!item.IsHigh)
|
||||||
sret = Tab(item.ActiveParent as ItemInfo) + "." + sret.Trim(" .)".ToCharArray());
|
{
|
||||||
|
if (item.IsRNO)
|
||||||
|
{
|
||||||
|
string mytb = sret.Trim(" .)".ToCharArray());
|
||||||
|
if (mytb == null || mytb == "")
|
||||||
|
sret = Tab(item.ActiveParent as ItemInfo) + ".RNO";
|
||||||
|
else
|
||||||
|
sret = Tab(item.ActiveParent as ItemInfo) + ".RNO." + sret.Trim(" .)".ToCharArray());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sret = Tab(item.ActiveParent as ItemInfo) + "." + sret.Trim(" .)".ToCharArray());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sret = sret.Trim(" .)".ToCharArray());
|
sret = sret.Trim(" .)".ToCharArray());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user