Added logic to not extend the change bar on different types of Notes and Cautions if using the LimitCautionNoteWidthToHLS

Logic to adjust the Note/Caution width when off of a substep and when using the LimitCautionNoteWidthToHLS format flag. Logic to adjust the Yoffset of a note when off of a borderless table.
This commit is contained in:
2015-05-13 17:26:03 +00:00
parent 7cb179f085
commit ae47368d34
2 changed files with 49 additions and 27 deletions

View File

@@ -2719,7 +2719,16 @@ namespace Volian.Print.Library
}
}
if (adjustAgain)
{
AdjustXOffsetForTab(itemInfo, maxRNO, formatInfo, mytab, xMetaAdj);
// Used in Ginna's Attachment format.
// if the Note/Caution is off of a sub-step, then adjust the width so that the Caution/Note text box does not extend past the HLS text box
if (itemInfo.IsCautionOrNotePart && maxRNO == 0 && itemInfo.MyActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.LimitCautionNoteWidthToHLS)
{
float wMax = MyHighLevelParagraph.Width + MyHighLevelParagraph.XOffset - XOffset;
if (wMax < Width && (Width + XOffset > MyItemInfo.MyDocStyle.Layout.PageWidth) ) Width = wMax;
}
}
// For Calvert Alarms: if within the CONDITION/RESPONSE table, indent by 1 character.
// Sequential substeps are ok because of the tab string, but items without a tab & other step
@@ -2785,7 +2794,13 @@ namespace Volian.Print.Library
// yoff from this. Without this, an overlap of text between the note and the bottom of the
// RNO was occurring for FNP - Unit 2/AOP, AOP-4.0.
if (yoffRightParent > yoff && ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) != E_DocStructStyle.DoubleBoxHLS)) yoff = yoffRightParent;
if (loadChildren) yoff = ChildrenAbove.Add(cb, itemInfo.Notes, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
if (loadChildren)
{
float yoffadj = 0;
if (itemInfo.IsTable && MyFlexGrid.BorderStyle == C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None && !MyFlexGrid.TopRowHasBorder())
yoffadj = SixLinesPerInch; // adjust the yoffset if the note is off of a borderless table
yoff = ChildrenAbove.Add(cb, itemInfo.Notes, xoff, yoff + yoffadj, yoff + yoffadj, rnoLevel, maxRNO, formatInfo) - yoffadj;
}
}
}
@@ -3771,14 +3786,14 @@ namespace Volian.Print.Library
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm ||
(MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert && MyItemInfo.IsStep && MyItemInfo.FormatStepData.StepLayoutData.STBoxindex != null))
{
if ((MyItemInfo.IsCaution || MyItemInfo.IsNote || MyItemInfo.MyParent.IsCaution || MyItemInfo.MyParent.IsNote) && !MyItemInfo.FormatStepData.SpaceIn
&& (MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0)
&& (MyItemInfo.NextItem == null || MyItemInfo.MyContent.Type != MyItemInfo.NextItem.MyContent.Type)) return 0;
if ((MyItemInfo.IsCaution || MyItemInfo.IsNote || MyItemInfo.MyParent.IsCaution || MyItemInfo.MyParent.IsNote) && !MyItemInfo.FormatStepData.SpaceIn
&& (MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0)
&& (MyItemInfo.NextItem == null || MyItemInfo.MyContent.Type != MyItemInfo.NextItem.MyContent.Type)) return 0;
if (everyNLines == 99 && MyItemInfo.NextItem == null)
{
if (MyItemInfo.Steps != null && MyItemInfo.Steps.Count > 0 && MyItemInfo.Steps[0].MyContent.Type == MyItemInfo.MyContent.Type) return 0;
if (MyItemInfo.MyParent.NextItem != null && MyItemInfo.MyParent.NextItem.MyContent.Type == MyItemInfo.MyContent.Type) return 0;
}
{
if (MyItemInfo.Steps != null && MyItemInfo.Steps.Count > 0 && MyItemInfo.Steps[0].MyContent.Type == MyItemInfo.MyContent.Type) return 0;
if (MyItemInfo.MyParent.NextItem != null && MyItemInfo.MyParent.NextItem.MyContent.Type == MyItemInfo.MyContent.Type) return 0;
}
}
if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == null) return SixLinesPerInch;
// Pagination issue to be used with yEndsWithBlankLine in Pagination code, but not checked in yet.
@@ -4827,11 +4842,11 @@ namespace Volian.Print.Library
XOffset += mycolT; // adjust caution/note text position
if (PartsLeft != null && PartsLeft.Count > 0)// adjust tab position
{
if(myTab!=null && (itemInfo.IsNote || itemInfo.IsCaution))
if (myTab != null && (itemInfo.IsNote || itemInfo.IsCaution))
Width -= myTab.Width;
foreach (vlnPrintObject vpo in PartsLeft)
vpo.XOffset += mycolT;
}
}
}
else if (itemInfo.IsSection)
{
@@ -4868,10 +4883,10 @@ namespace Volian.Print.Library
}
else if (itemInfo.MyParent.IsCaution || itemInfo.MyParent.IsNote)
{
if(itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset != null)
if (itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset != null)
Width = MyParent.MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign);
else
Width = MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign);
Width = MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign);
Width -= 72 * (itemInfo.FormatStepData.CautionOrNoteSubstepIndent == null ? 0 : (float)itemInfo.FormatStepData.CautionOrNoteSubstepIndent / (float)itemInfo.FormatStepData.Font.CPI);
}
else
@@ -4884,7 +4899,7 @@ namespace Volian.Print.Library
else if (MyParent.WidthNoLimit != 0)
Width = adjwidth + MyParent.WidthNoLimit - tabWidth + (myTab == null ? 0 : myTab.TabAlign);
else if ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)
Width = adjwidth + MyParent.Width - (MyTab!=null?MyTab.Width:0);
Width = adjwidth + MyParent.Width - (MyTab != null ? MyTab.Width : 0);
else
Width = adjwidth + MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign);
}