Added logic to support ColOverride on Caution and Note types in Enhanced Background Formats.

This commit is contained in:
John Jenko 2015-02-16 19:44:10 +00:00
parent bd72c82eb4
commit 469a8da0ba

View File

@ -4010,6 +4010,12 @@ namespace Volian.Print.Library
get { return _XOffsetCenter; } get { return _XOffsetCenter; }
set { _XOffsetCenter = value; } set { _XOffsetCenter = value; }
} }
public bool IsEnhancedBackgroundFormat(ItemInfo itminfo)
{
return ((itminfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds);
}
public void AdjustXOffsetForTab(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo, vlnTab myTab, float xMetaAdj) public void AdjustXOffsetForTab(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo, vlnTab myTab, float xMetaAdj)
{ {
float tabWidth = (myTab == null) ? 0 : myTab.Width; float tabWidth = (myTab == null) ? 0 : myTab.Width;
@ -4200,14 +4206,21 @@ namespace Volian.Print.Library
} }
} }
} }
else if (((colOvrd ?? 0) != 0) && formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.NullBox) else if (((colOvrd ?? 0) != 0) && (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.NullBox))
{ {
float tabOffset = (myTab == null ? 0 : myTab.XOffset) - XOffset; float tabOffset = (myTab == null ? 0 : myTab.XOffset) - XOffset;
XOffset = (float)colOvrd; XOffset = (float)colOvrd;
if (myTab != null) myTab.XOffset = XOffset + tabOffset; if (myTab != null) myTab.XOffset = XOffset + tabOffset;
return; return;
} }
else if (((colOvrd ?? 0) != 0) && (IsEnhancedBackgroundFormat(itemInfo) && (itemInfo.IsNote || itemInfo.IsCaution)))
{
float tabOffset = (myTab == null ? 0 : myTab.XOffset);
// Adjust the position of the Note/Caution text by the difference of the colOverride and the tab xoffset
XOffset += ((float)colOvrd - tabOffset);
if (myTab != null) myTab.XOffset = (float)colOvrd; // set the note/caution tab offset to the colOverride
return;
}
// put in for Point Beach (wep2) we don't want to do this if we are processing a boxed substep (cont. action substep) // put in for Point Beach (wep2) we don't want to do this if we are processing a boxed substep (cont. action substep)
else if (bxIndx != null && (itemInfo.IsCaution || itemInfo.IsNote || else if (bxIndx != null && (itemInfo.IsCaution || itemInfo.IsNote ||
!itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.ContActBoxOnSubSteps)) !itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.ContActBoxOnSubSteps))