BGE: Handle {} around ro values
BGE: Added an x-Location of end message for a section Use x-location of end message for a section; tab format for sequential tabs at 4th level; hls tab spaces; indent in transition format 9 BGE: Use x-location of end message for a section BGE: support for top continue messages that contain tab for continued step resolve {Step Text} token in transition; modify code that processes transition format to use collection matches rather than search for ‘{‘ support AllUnits ro flag support ‘{‘ and ‘}’ around ro value top continue message with tab; location of top continue message in both AER/RNO columns for dual column; support indent in transition format during print support two top continue messages (aer/rno) that can have different text; fix bug in splitting procedure title text if it contains hard spaces
This commit is contained in:
@@ -32,13 +32,18 @@ namespace Volian.Print.Library
|
||||
get { return _CheckListBoxes; }
|
||||
set { _CheckListBoxes = value; }
|
||||
}
|
||||
|
||||
private vlnText _TopMessage;
|
||||
public vlnText TopMessage
|
||||
{
|
||||
get { return _TopMessage; }
|
||||
set { _TopMessage = value; }
|
||||
}
|
||||
private vlnText _TopMessageR; // Added if there are 2 messages, in AER AND RNO (for BGE)
|
||||
public vlnText TopMessageR
|
||||
{
|
||||
get { return _TopMessageR; }
|
||||
set { _TopMessageR = value; }
|
||||
}
|
||||
private vlnText _BottomMessage;
|
||||
public vlnText BottomMessage
|
||||
{
|
||||
@@ -387,6 +392,11 @@ namespace Volian.Print.Library
|
||||
TopMessage.ToPdf(cb, 0, ref tmp, ref tmp);
|
||||
TopMessage = null; // Only output it once.
|
||||
}
|
||||
if (TopMessageR != null)
|
||||
{
|
||||
TopMessageR.ToPdf(cb, 0, ref tmp, ref tmp);
|
||||
TopMessageR = null; // Only output it once.
|
||||
}
|
||||
if (BottomMessage != null)
|
||||
{
|
||||
BottomMessage.ToPdf(cb, 0, ref tmp, ref tmp);
|
||||
@@ -1617,9 +1627,9 @@ namespace Volian.Print.Library
|
||||
indx += m.Length - 1;
|
||||
width++;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
m = Regex.Match(text.Substring(indx), @"^\\[uU][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][?]");
|
||||
m = Regex.Match(text.Substring(indx), @"^\\[uU][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][?]"); // 3 char unicode, for example \u160? (hardspace)
|
||||
if (m.Success)
|
||||
{
|
||||
indx += m.Length - 1;
|
||||
@@ -1627,11 +1637,20 @@ namespace Volian.Print.Library
|
||||
}
|
||||
else
|
||||
{
|
||||
m = Regex.Match(text.Substring(indx), @"^\\[^ ]*? ");
|
||||
m = Regex.Match(text.Substring(indx), @"^\\[uU][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][?]");
|
||||
if (m.Success)
|
||||
{
|
||||
indx += m.Length - 1;
|
||||
rtfprefix = AdjustRtfPrefix(rtfprefix, m.Value);
|
||||
width++;
|
||||
}
|
||||
else
|
||||
{
|
||||
m = Regex.Match(text.Substring(indx), @"^\\[^ ]*? ");
|
||||
if (m.Success)
|
||||
{
|
||||
indx += m.Length - 1;
|
||||
rtfprefix = AdjustRtfPrefix(rtfprefix, m.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1044,11 +1044,29 @@ namespace Volian.Print.Library
|
||||
DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart);
|
||||
if (EmptyTopMostPart) yPageStart += SixLinesPerInch;
|
||||
myMsg = docstyle.Continue.Top.Message;
|
||||
MyPageHelper.TopMessageR = null;
|
||||
if (myMsg != null && myMsg != "")
|
||||
{
|
||||
yPageStart -= 2 * SixLinesPerInch;// Allow two lines for top continue message
|
||||
if (myMsg.IndexOf(@"%sR") > -1) // KBR NEEDS MUCH MORE WORK, i.e. substep tabs concatenated onto step tabs, AER vs RNO
|
||||
myMsg = myMsg.Replace(@"%sR", MyItemInfo.MyParent.MyTab.Text);
|
||||
if (myMsg.IndexOf(@"%sR") > -1)
|
||||
{
|
||||
ItemInfo myAer = MyItemInfo.IsHigh?MyItemInfo:MyItemInfo.MyParent;
|
||||
if (MyItemInfo.IsInRNO)
|
||||
{
|
||||
if (MyItemInfo.IsNote || MyItemInfo.IsCaution)
|
||||
myMsg = myMsg.Replace(@"%sR", MyItemInfo.MyParent.MyParent.CombinedTab);
|
||||
else
|
||||
myMsg = myMsg.Replace(@"%sR", MyItemInfo.MyParent.CombinedTab);
|
||||
float xor = MyTopRNO.MyTab.XOffset;
|
||||
MyPageHelper.TopMessageR = new vlnText(cb, this, myMsg, myMsg, xor, yTopMargin + 0.1F, docstyle.Continue.Top.Font);
|
||||
// get aer message, go up parent until find aer and use its combined tab:
|
||||
myAer = MyItemInfo;
|
||||
while (myAer.IsInRNO) myAer = myAer.MyParent;
|
||||
}
|
||||
myMsg = docstyle.Continue.Top.Message.Replace(@"%sR", myAer.CombinedTab);
|
||||
}
|
||||
if (myMsg.IndexOf(@"%s") > -1)
|
||||
myMsg = myMsg.Replace(@"%s", MyItemInfo.MyParent.CombinedTab);
|
||||
if (myMsg.IndexOf(@"%3d") > -1)
|
||||
myMsg = myMsg.Replace(@"%3d", MyItemInfo.MyHLS.Ordinal.ToString());
|
||||
if (myMsg.IndexOf(@"%d") > -1)
|
||||
@@ -1188,20 +1206,28 @@ namespace Volian.Print.Library
|
||||
{
|
||||
msg_yLocation = yTopMargin - (float)(docstyle.End.Flag * SixLinesPerInch);
|
||||
}
|
||||
|
||||
if (docstyle.End.Flag < 0) // Adjust this many lines down the page.
|
||||
{
|
||||
float adjMsgY = (float)(-docstyle.End.Flag * SixLinesPerInch);
|
||||
if (msg_yLocation - adjMsgY > docstyle.Layout.FooterLength) msg_yLocation = msg_yLocation - adjMsgY;
|
||||
}
|
||||
if (myMsg.Contains("{Section Number}")) myMsg = myMsg.Replace("{Section Number}", MyItemInfo.ActiveSection.DisplayNumber);
|
||||
//jcb code
|
||||
//if (myMsg.Contains("%-8s"))
|
||||
// myMsg = myMsg.Replace("%-8s", MyItemInfo.MyProcedure.DisplayNumber.PadRight(8));
|
||||
if (myMsg.Contains("%-12s"))
|
||||
myMsg = myMsg.Replace("%-12s", MyItemInfo.MyProcedure.DisplayNumber.PadRight(12));
|
||||
//end jb code
|
||||
// center the message.
|
||||
float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin;
|
||||
float centerpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2;
|
||||
centerpos = Math.Max(centerpos, XOffsetBox + (float)docstyle.Layout.LeftMargin);
|
||||
MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, centerpos, msg_yLocation, docstyle.End.Font);
|
||||
MyPageHelper.MyGaps.Add(new Gap(msg_yLocation, msg_yLocation - MyPageHelper.BottomMessage.Height));
|
||||
float xpos = 0;
|
||||
if ((docstyle.End.Margin ?? 0) != 0)
|
||||
xpos = (float)docstyle.Layout.LeftMargin + (float)docstyle.End.Margin;
|
||||
else
|
||||
{
|
||||
float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin;
|
||||
xpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2;
|
||||
xpos = Math.Max(xpos, XOffsetBox + (float)docstyle.Layout.LeftMargin);
|
||||
MyPageHelper.MyGaps.Add(new Gap(msg_yLocation, msg_yLocation - MyPageHelper.BottomMessage.Height));
|
||||
}
|
||||
MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font);
|
||||
}
|
||||
}
|
||||
if (yLocalypagestart != yPageStart) DebugText.WriteLine("ToPdf-yPagestartDiff:{0},{1},{2},{3}", MyPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, MyItemInfo.ItemID, yLocalypagestart, yPageStart);
|
||||
@@ -2603,6 +2629,7 @@ namespace Volian.Print.Library
|
||||
stText = stText.Replace(@"\ulnone ", "");
|
||||
stText = stText.Replace(@"\ulnone", "");
|
||||
}
|
||||
if (stText.Contains("{IND}")) stText = stText.Replace("{IND}", "\x5");
|
||||
if (itemInfo.IsSection && itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.SectionNumber.Level0Big && itemInfo.MyParent.IsProcedure)
|
||||
myFont = new System.Drawing.Font(myFont.FontFamily, 14, myFont.Style | FontStyle.Bold);
|
||||
_RtfSB.Append(AddFontTable(myFont));
|
||||
|
Reference in New Issue
Block a user