Support for background print output; fix printlevel for tab formatting (‘.’ Vs ‘)’);
This commit is contained in:
parent
7cbe3f651f
commit
a65ca24837
@ -393,7 +393,12 @@ namespace VEPROMS.CSLA.Library
|
||||
tmpInfo.RefreshItemParts();
|
||||
}
|
||||
}
|
||||
|
||||
private string _HighLevelStepTabPageList = null;
|
||||
public string HighLevelStepTabPageList
|
||||
{
|
||||
get { return _HighLevelStepTabPageList; }
|
||||
set { _HighLevelStepTabPageList = value; }
|
||||
}
|
||||
private bool _NewTransToUnNumberedItem = false;
|
||||
public bool NewTransToUnNumberedItem
|
||||
{
|
||||
@ -514,7 +519,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
if (_PrintLevel != 0) return _PrintLevel;
|
||||
int _PrintBias = 0;
|
||||
_PrintLevel = GetStepLevel(ref _PrintBias);
|
||||
_PrintLevel = GetStepLevel(); //ref _PrintBias);
|
||||
|
||||
return _PrintLevel;
|
||||
}
|
||||
@ -2435,8 +2440,8 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
if (tbformat.Contains("{LNK C/N Num}"))
|
||||
{
|
||||
tbformat = tbformat.Replace("{LNK C/N Num}", Ordinal.ToString() + ":");
|
||||
tbformat = tbformat.Replace("{LNK Step Num}", ""); //(ActiveParent as ItemInfo).Ordinal.ToString() + ":");
|
||||
tbformat = tbformat.Replace("{LNK C/N Num}", Ordinal.ToString());
|
||||
tbformat = tbformat.Replace("{LNK Step Num}", (ActiveParent as ItemInfo).Ordinal.ToString());
|
||||
tbformat = tbformat.TrimStart(" ".ToCharArray());
|
||||
}
|
||||
if (tbformat.Contains("{LNK Step Num}"))
|
||||
@ -2451,7 +2456,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
_MyTab.CleanText = ((ItemInfo)ActiveParent).MyTab.CleanText;
|
||||
_MyTab.Text = ((ItemInfo)ActiveParent).MyTab.Text;
|
||||
_MyTab.RNOTabWidthAdjust = ((ItemInfo)ActiveParent).FormatStepData.TabData.RNOAdjustTabSize??0;
|
||||
_MyTab.RNOTabWidthAdjust = ((ItemInfo)ActiveParent).FormatStepData.TabData.RNOAdjustTabSize ?? 0;
|
||||
if (((ItemInfo)ActiveParent).FormatStepData.TabData.RNOExcludeMacros)
|
||||
_MyTab.Text = Regex.Replace(_MyTab.Text, "{!.+?}", " ");
|
||||
if (((ItemInfo)ActiveParent).FormatStepData.TabData.RNOIdentPrint.Contains("{asterisk}"))
|
||||
@ -2470,7 +2475,6 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyTab.CleanText = "";
|
||||
return;
|
||||
}
|
||||
|
||||
// account for metasection indenting/tabbing in the 'PrintLevel', i.e. if we have metasection, we may be in
|
||||
// a subsection. Index into the seqtabs array has to account for metasection level.
|
||||
int localPrintLevel = PrintLevel;
|
||||
@ -2478,21 +2482,20 @@ namespace VEPROMS.CSLA.Library
|
||||
bool doMeta = false;
|
||||
if (sd.StepSectionLayoutData.TieTabToLevel && ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections)
|
||||
{
|
||||
if (sd.StepSectionLayoutData.ShowSectionTitles
|
||||
&& !MyDocStyle.CancelSectTitle
|
||||
&& !(MyDocStyle.SpecialStepsFoldout && MyDocStyle.UseColSByLevel))
|
||||
localPrintLevel = PrintLevel + CurrentSectionLevel();
|
||||
doMeta = true;
|
||||
if (sd.StepSectionLayoutData.ShowSectionTitles
|
||||
&& !MyDocStyle.CancelSectTitle
|
||||
&& !(MyDocStyle.SpecialStepsFoldout && MyDocStyle.UseColSByLevel))
|
||||
localPrintLevel = PrintLevel + CurrentSectionLevel();
|
||||
doMeta = true;
|
||||
}
|
||||
SeqTabFmtList seqtabs = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.SeqTabFmtList;
|
||||
// Start with basic cases of alpha/numeric/seq:
|
||||
// If we have metasections AND...
|
||||
// If the seqtabs for this given level does not get a section number, use the seqtab rather than
|
||||
// the ident of the step:
|
||||
|
||||
bool useSubStepTabs = false;
|
||||
if (doMeta && IsHigh
|
||||
&& !seqtabs[(localPrintLevel<0?0:localPrintLevel) % seqtabs.Count].TabToken.Contains("{numericWpar}")
|
||||
&& !seqtabs[(localPrintLevel < 0 ? 0 : localPrintLevel) % seqtabs.Count].TabToken.Contains("{numericWpar}")
|
||||
&& tbformat.Contains("{")) useSubStepTabs = true;
|
||||
|
||||
// Check to be sure the parent tab should be included... If this sequential is within a note
|
||||
@ -2562,13 +2565,13 @@ namespace VEPROMS.CSLA.Library
|
||||
// If the document style has the flag DSS_UnNumLikeRoman, don't do the normal tab, change to alpha,
|
||||
// but only if there is a tab string for this step. (the High level step is numbered with roman numerals, so
|
||||
// don't want to continue using the roman numeral concatenated with substep tabs.
|
||||
if (!IsHigh && tbformat!=null && tbformat != "" && (MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_UnNumLikeRoman) == E_DocStructStyle.DSS_UnNumLikeRoman)
|
||||
if (!IsHigh && tbformat != null && tbformat != "" && (MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_UnNumLikeRoman) == E_DocStructStyle.DSS_UnNumLikeRoman)
|
||||
tbformat = "{alpha}. ";
|
||||
|
||||
if (tbformat.IndexOf("#2#") > -1)
|
||||
{
|
||||
int indxlb = tbformat.IndexOf("#");
|
||||
string ofst = tbformat.Substring(indxlb+1, 3);
|
||||
string ofst = tbformat.Substring(indxlb + 1, 3);
|
||||
_MyTab.Offset = Convert.ToInt32(ofst.Substring(0, 1)) * (int)FormatStepData.TabData.Font.CPI;
|
||||
tbformat = tbformat.Replace("#2#", "");
|
||||
}
|
||||
@ -2576,9 +2579,9 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
int begPos = tbformat.IndexOf("{Pos");
|
||||
int endPos = tbformat.IndexOf("}");
|
||||
string ofst = tbformat.Substring(begPos + 4, endPos-begPos-4);
|
||||
string ofst = tbformat.Substring(begPos + 4, endPos - begPos - 4);
|
||||
_MyTab.Position = -(Convert.ToInt32(ofst) * (int)FormatStepData.TabData.Font.CPI);
|
||||
tbformat = tbformat.Remove(begPos,endPos+1);
|
||||
tbformat = tbformat.Remove(begPos, endPos + 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.
|
||||
@ -2602,13 +2605,13 @@ namespace VEPROMS.CSLA.Library
|
||||
string roman = RomanNumbering(ordinal);
|
||||
tbformat = tbformat.Replace("{roman}", roman.ToLower());
|
||||
tbformat = tbformat.Replace("{ROMAN}", roman);
|
||||
tbformat = tbformat.Replace("{numeric}", trimTabStart ? ordinal.ToString() : FormatStepData.AtLeastTwoDigits ? ordinal.ToString().PadLeft(2,'0') : ordinal.ToString().PadLeft(2));
|
||||
tbformat = tbformat.Replace("{numeric}", trimTabStart ? ordinal.ToString() : FormatStepData.AtLeastTwoDigits ? ordinal.ToString().PadLeft(2, '0') : ordinal.ToString().PadLeft(2));
|
||||
tbformat = tbformat.Replace("{numericWpar}", ordinal.ToString());
|
||||
if (tbformat.Contains("{asterisk}"))
|
||||
{
|
||||
// if this has a checkoff - need to set location of the asterisk - because the asterisk has to come before
|
||||
// the checkoff. Otherwise, it doesn't matter
|
||||
_MyTab.AsteriskOffset = - 10;
|
||||
_MyTab.AsteriskOffset = -10;
|
||||
tbformat = tbformat.Replace("{asterisk}", ""); // the asteriskoffset flags a '*' to be printed at xloc - this.
|
||||
}
|
||||
int macroindx = tbformat.IndexOf("{!C");
|
||||
@ -2635,20 +2638,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyHeader.Justify = ContentAlignment.MiddleCenter;
|
||||
}
|
||||
#region Non Converted Plants 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}"
|
||||
|
||||
// Position offset
|
||||
// \257 - Indent (CALLOWAY BACKGROUNDS)
|
||||
// Newline within a tab (calbck)
|
||||
//"{indent}");
|
||||
//"{par}");
|
||||
|
||||
@ -2664,9 +2654,22 @@ namespace VEPROMS.CSLA.Library
|
||||
//wkstr = Regex.Replace(wkstr, @"{![.*?]}", @"{!$1}");
|
||||
//wkstr = wkstr.Replace("{}", "");
|
||||
//if (vefont != null && vefont.HasCircleString2()) wkstr.Insert(0,"{!C0}");
|
||||
|
||||
//wkstr = wkstr.Replace("ê", @"{Box Step}");
|
||||
#endregion
|
||||
|
||||
// if this has an alternate tab, use it. These have been used in background documents.
|
||||
if (!IsSection && FormatStepData.TabData.IdentAltPrint != null && FormatStepData.TabData.IdentAltPrint != "")
|
||||
{
|
||||
string newtab = null;
|
||||
int indxnewtab = FormatStepData.TabData.IdentAltPrint.LastIndexOf('\\');
|
||||
if (indxnewtab >= 0)
|
||||
{
|
||||
newtab = FormatStepData.TabData.IdentAltPrint.Substring(indxnewtab + 1);
|
||||
// also see if there is the 'pagelist' string in this tab:
|
||||
HighLevelStepTabPageList = FormatStepData.TabData.IdentAltPrint.Substring(0, indxnewtab) + tbformat;
|
||||
_MyTab.AltPrintTab = newtab;
|
||||
}
|
||||
}
|
||||
_MyTab.Text = tbformat;
|
||||
_MyTab.CleanText = cltext != null ? cltext : tbformat;
|
||||
}
|
||||
@ -2701,7 +2704,7 @@ namespace VEPROMS.CSLA.Library
|
||||
return (tbformat.Substring(stindx, tbformat.IndexOf("}")-stindx+1));
|
||||
}
|
||||
|
||||
public int GetStepLevel(ref int bias)
|
||||
public int GetStepLevel() // ref int bias)
|
||||
{
|
||||
int level = 0;
|
||||
ItemInfo par = this;
|
||||
@ -2723,7 +2726,7 @@ namespace VEPROMS.CSLA.Library
|
||||
// level RNOs - unless DontOffsetTab format flag is set
|
||||
if (LastRNO != null && LastRNO.IsHigh && TopRNO.FormatStepData.NumberHighLevel && TopRNO.FormatStepData.OffsetTab)
|
||||
OffsetTab = TopRNO.FormatStepData.NumberHighLevel?1:0;
|
||||
bias = 0;
|
||||
_PrintBias = 0;
|
||||
if (par.FormatStepData != null && par.FormatStepData.TabData.IdentPrint.Contains("{ALPHA}"))
|
||||
level--;
|
||||
|
||||
@ -2736,7 +2739,7 @@ namespace VEPROMS.CSLA.Library
|
||||
level++; // 16bit has this: I didn't and mine worked most of time.
|
||||
if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructurePlus4) level += 2;
|
||||
if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectSubstep && !ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructurePlus4)
|
||||
bias = -1;
|
||||
PrintBias = -1;
|
||||
}
|
||||
// ImperfectStructure for substeps - only good for level 1 RNOs
|
||||
else if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectSubstep && RNOLevel == 1)
|
||||
@ -2753,7 +2756,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
level++;
|
||||
if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructurePlus4) level += 1;
|
||||
if (!ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructurePlus4) bias = -1;
|
||||
if (!ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructurePlus4) PrintBias = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3334,6 +3337,12 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
public class Tab : MetaTag
|
||||
{
|
||||
private string _AltPrintTab = null;
|
||||
public string AltPrintTab
|
||||
{
|
||||
get { return _AltPrintTab; }
|
||||
set { _AltPrintTab = value; }
|
||||
}
|
||||
private bool _RemovedStyleUnderline = false;
|
||||
public bool RemovedStyleUnderline
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user