BGE: Fix RNO tab when AER has ending parenthesis

BGE: Fix bug that left a ‘page number’ transition setting turned on for transition types that did not have this option.
BGE: Support for section continue messages (fix crash when access of null pointer), improved tabs for top continue messages in RNO column & when cautions/notes; adjust width of note/caution
This commit is contained in:
Kathy Ruffing 2014-05-23 12:40:40 +00:00
parent 0081eed6bc
commit 89c7496c57
3 changed files with 36 additions and 9 deletions

View File

@ -2703,6 +2703,12 @@ namespace VEPROMS.CSLA.Library
if (MyParent != null && MyParent.IsRNOPart)
ord = System.Convert.ToInt32(MyParent.MyTab.CleanText.Substring(MyParent.MyTab.CleanText.LastIndexOf(".") + 1));
incSub = (ord + 1).ToString();
if (MyParent.MyTab.CleanText.Trim().EndsWith(")"))
{
_MyTab.CleanText = MyParent.MyTab.CleanText.Trim() + "." + incSub;
_MyTab.Text = _MyTab.CleanText;
return;
}
_MyTab.CleanText = MyParent.MyTab.CleanText.Substring(0, MyParent.MyTab.CleanText.IndexOf(".") + 1) + incSub;
_MyTab.Text = MyParent.MyTab.CleanText.Substring(0, MyParent.MyTab.Text.IndexOf(".") + 1) + incSub;
return;

View File

@ -599,9 +599,9 @@ namespace Volian.Controls.Library
}
}
cbPageNum.Checked = false;
if (cbPageNum.Visible)
{
cbPageNum.Checked = false;
if (CurTrans != null)
{
TransitionConfig tc = new TransitionConfig(CurTrans.Config);
@ -1052,7 +1052,7 @@ namespace Volian.Controls.Library
MessageBox.Show(sb.ToString());
return;
}
bool doTranmod = this.cbPageNum.Checked;
bool doTranmod = cbPageNum.Visible && cbPageNum.Checked;
trantxt = TransitionText.GetResolvedText(MyRTB.MyItemInfo, listBoxTranFmt.SelectedIndex, toItem, rangeItem ?? toItem, doTranmod);
int ss = MyRTB.SelectionStart;// Remember where the link is being added
int sl = MyRTB.SelectionLength;

View File

@ -1129,12 +1129,22 @@ namespace Volian.Print.Library
yPageStart -= 2 * SixLinesPerInch;// Allow two lines for top continue message
if (myMsg.IndexOf(@"%sR") > -1)
{
if (MyItemInfo.ItemID == 461 || MyItemInfo.ItemID == 446) Console.WriteLine("Here");
ItemInfo myAer = MyItemInfo.IsHigh ? MyItemInfo : MyItemInfo.MyParent;
if (MyItemInfo.IsInRNO)
{
if (MyItemInfo.IsNote || MyItemInfo.IsCaution)
myMsg = myMsg.Replace(@"%sR", MyItemInfo.MyParent.MyParent.CombinedTab);
// If this is an RNO part, find the parent that is not an RNO (the reason for this is
// that RNO parts are structured as parent/child not sibling relationships, for
// example, RNO part 1.2 is the child of 1.1 not sibling). Also, if this is a caution
// or note of the RNO part, do the same because it should not use the RNO part's tab.
// However, the RNO Part will have the combined tab using its parent because this is
// needed if any of its children, for example substeps, need the combined tab.
if (((MyItemInfo.IsNote || MyItemInfo.IsCaution) && MyItemInfo.MyParent.IsRNOPart) || MyItemInfo.IsRNOPart)
{
ItemInfo ip = MyItemInfo.MyParent;
while (ip.IsRNOPart) ip = ip.MyParent;
myMsg = myMsg.Replace(@"%sR", ip.CombinedTab);
}
else
myMsg = myMsg.Replace(@"%sR", MyItemInfo.MyParent.CombinedTab);
float xor = MyTopRNO.MyTab.XOffset;
@ -1143,6 +1153,11 @@ namespace Volian.Print.Library
myAer = MyItemInfo;
while (myAer.IsInRNO) myAer = myAer.MyParent;
}
else if (!MyItemInfo.IsHigh && (MyItemInfo.IsNote || MyItemInfo.IsCaution))
{
ItemInfo ip1 = MyItemInfo.MyParent;
if (!ip1.IsHigh) myAer = ip1.MyParent;
}
myMsg = docstyle.Continue.Top.Message.Replace(@"%sR", myAer.CombinedTab);
}
if (myMsg.IndexOf(@"%s") > -1)
@ -1225,7 +1240,7 @@ namespace Volian.Print.Library
break;
case E_ContBottomLoc.BtwnTextAndBottom2:
// Like BtwnTextAndBottom but accounts for line spacing of step & is 1 line up on page (for BGE - Procedure Steps - 2 column)
float adj = (MyItemInfo.FormatStepData.StepLayoutData.EveryNLines == 1) ? SixLinesPerInch : 0;
float adj = (!MyItemInfo.IsSection && MyItemInfo.FormatStepData.StepLayoutData.EveryNLines == 1) ? SixLinesPerInch : 0;
msg_yLocation = msg_yLocation + yLocation - ((yLocation - yBottomMargin) / 2) + adj + SixLinesPerInch;
if (msg_yLocation < yBottomMargin) msg_yLocation = yBottomMargin;
break;
@ -1278,7 +1293,11 @@ namespace Volian.Print.Library
private string ReplaceStepBottomContinue(string myMsg)
{
string tb = MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols;
string tb = null;
if (MyItemInfo.IsSection)
tb = MyItemInfo.MyTab.CleanText.Trim();
else
tb = MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols;
// if the tab ends with .0, remove it if it was added because of the virtualdotinhls flag.
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.VirtualDotInHLSTab && tb.Contains(".0")) tb = tb.Replace(".0", "");
if (myMsg.IndexOf(@"%d") > -1)
@ -1719,7 +1738,7 @@ namespace Volian.Print.Library
else
{
XOffset = MyHighLevelParagraph.MyTab.XOffset;
Width = MyHighLevelParagraph.MyTab.Width + MyHighLevelParagraph.Width;
Width = MyHighLevelParagraph.MyTab.Width + MyHighLevelParagraph.Width - 6; // make width 1/2 char smaller so it doesn't touch line
}
}
if (UseTemplateWidthOrXOff(itemInfo)) XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + GetWidthOrStartFromTemplate(itemInfo, itemInfo.ActiveFormat, false);
@ -3145,7 +3164,9 @@ namespace Volian.Print.Library
}
else if (itemInfo.IsRNOPart && itemInfo.MyParent != null && itemInfo.MyParent.IsRNOPart && itemInfo.FormatStepData.NumberWithLevel)
{
// xoffset is same as parent RNO (this is a BGE format flag)
// xoffset is same as parent RNO (this is a BGE format flag). Instead of RNO's being siblings,
// they had a parent/child relationship. So want the child to have same xoffset as parent, i.e.
// the same xoffset.
XOffset = MyParent.XOffset;
myTab.XOffset = MyParent.MyTab.XOffset;
return;