This commit is contained in:
Kathy Ruffing 2013-07-11 16:31:42 +00:00
parent 8eb68b9de3
commit 12f492516f
3 changed files with 37 additions and 17 deletions

View File

@ -1253,7 +1253,7 @@ namespace VEPROMS.CSLA.Library
#endregion #endregion
public int FoldoutIndex() public int FoldoutIndex()
{ {
if (ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && (ActiveSection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.UseSectionFoldout) != 0) return 0; if (ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && ((ActiveSection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.UseSectionFoldout) == E_DocStructStyle.UseSectionFoldout)) return 0;
// now check for floating foldouts. If there is a floating foldout, also find which one it uses. // now check for floating foldouts. If there is a floating foldout, also find which one it uses.
// This is data off of the ? // This is data off of the ?
if (ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && ActiveSection.IsDefaultSection) if (ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && ActiveSection.IsDefaultSection)
@ -2544,10 +2544,10 @@ namespace VEPROMS.CSLA.Library
} }
if (tbformat.IndexOf("#2#") > -1 || tbformat.IndexOf("#1#") > -1) if (tbformat.IndexOf("#2#") > -1 || tbformat.IndexOf("#1#") > -1)
{ {
string ofst = tbformat.Substring(0, 3); int indxlb = tbformat.IndexOf("#");
_MyTab.Offset = Convert.ToInt32(ofst.Substring(1, 1)); string ofst = tbformat.Substring(indxlb+1, 3);
cltext = tbformat.Replace("#2#", ""); _MyTab.Offset = Convert.ToInt32(ofst.Substring(0, 1)) * 10;
cltext = cltext.Replace("#1#", ""); tbformat = tbformat.Replace("#2#", "").Replace("#1#", "");
} }
// if this is a caution/note type determine where 'NOTE/CAUTION' tab goes, as tab or as 'header' // 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. // and also determine whether the tab itself gets converted to a bullet.

View File

@ -160,10 +160,12 @@ namespace Volian.Print.Library
cb.RestoreState(); cb.RestoreState();
} }
private void ResetDocStyleAndValues() private bool ResetDocStyleAndValues()
{ {
// if this document style has another style that is for pages other than first, we need to // if this document style has another style that is for pages other than first, we need to
// reset the document style off of this section AND reset docstyle values used. // reset the document style off of this section AND reset docstyle values used
// AND reset the 'svg' data.
bool forceLoadSvg = false;
if ((MySection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) > 0) if ((MySection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) > 0)
{ {
//Console.WriteLine("{0} ResetDocStyleAndValues", MySection.MyDocStyle.Name); //Console.WriteLine("{0} ResetDocStyleAndValues", MySection.MyDocStyle.Name);
@ -174,10 +176,17 @@ namespace Volian.Print.Library
if (ds.Index == indx) if (ds.Index == indx)
{ {
MySection.MyDocStyle = ds; MySection.MyDocStyle = ds;
forceLoadSvg = true;
break; break;
} }
} }
} }
return forceLoadSvg;
}
public void ResetSvg()
{
Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection, true);
if (sectSvg != null) MySvg = sectSvg;
} }
private void DrawRuler(PdfContentByte cb) private void DrawRuler(PdfContentByte cb)
{ {
@ -345,8 +354,10 @@ namespace Volian.Print.Library
{ {
_MySection = value; _MySection = value;
MySectionTitle = ((_MySection.DisplayNumber ?? "")=="" ? "" : _MySection.DisplayNumber + " - ") + _MySection.DisplayText; MySectionTitle = ((_MySection.DisplayNumber ?? "")=="" ? "" : _MySection.DisplayNumber + " - ") + _MySection.DisplayText;
if (DidFirstPageDocStyle) ResetDocStyleAndValues(); bool forceLoadSvg = false;
Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection); if (DidFirstPageDocStyle)
forceLoadSvg = ResetDocStyleAndValues(); // this method also gets the SVG (the 'else' part of this)
Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection, forceLoadSvg);
if (sectSvg != null) MySvg = sectSvg; if (sectSvg != null) MySvg = sectSvg;
} }
} }
@ -502,7 +513,7 @@ namespace Volian.Print.Library
MySection = mySection; MySection = mySection;
MyPromsPrinter = myPromsPrinter; MyPromsPrinter = myPromsPrinter;
} }
private Volian.Svg.Library.Svg BuildSvg(VEPROMS.CSLA.Library.SectionInfo mySection) private Volian.Svg.Library.Svg BuildSvg(VEPROMS.CSLA.Library.SectionInfo mySection, bool forceLoad)
{ {
// if mysection uses continuous pagination, and the previous section uses the same format, // if mysection uses continuous pagination, and the previous section uses the same format,
// and the docstyle is set to use on first page only, // and the docstyle is set to use on first page only,
@ -529,7 +540,7 @@ namespace Volian.Print.Library
mySvg.LeftMargin = (float)docStyle.Layout.LeftMargin; mySvg.LeftMargin = (float)docStyle.Layout.LeftMargin;
mySvg.TopMargin = 9.6F; mySvg.TopMargin = 9.6F;
VEPROMS.CSLA.Library.PageStyle pageStyle = docStyle.pagestyle; VEPROMS.CSLA.Library.PageStyle pageStyle = docStyle.pagestyle;
AddPageListItems(mySvg, pageStyle, mySection); AddPageListItems(mySvg, pageStyle, mySection, forceLoad);
mySvg.ProcessText += new SvgProcessTextEvent(mySvg_ProcessText); mySvg.ProcessText += new SvgProcessTextEvent(mySvg_ProcessText);
// if this section had a previous section and this is continuous, don't generate the svg for // if this section had a previous section and this is continuous, don't generate the svg for
// it, we'll use the previous section. The only thing we need to do is to process through the // it, we'll use the previous section. The only thing we need to do is to process through the
@ -542,6 +553,7 @@ namespace Volian.Print.Library
sPag = sc.Section_Pagination; sPag = sc.Section_Pagination;
} }
//if (sPag == SectionConfig.SectionPagination.Continuous && !mySection.DidFirstPageDocStyle) return null; //if (sPag == SectionConfig.SectionPagination.Continuous && !mySection.DidFirstPageDocStyle) return null;
if (forceLoad) return mySvg;
if (sPag == SectionConfig.SectionPagination.Continuous) return null; if (sPag == SectionConfig.SectionPagination.Continuous) return null;
return mySvg; return mySvg;
} }
@ -716,7 +728,7 @@ namespace Volian.Print.Library
public SvgText PageListCheckOffHeader = null; public SvgText PageListCheckOffHeader = null;
public Dictionary<string, bool> PgLogicals; public Dictionary<string, bool> PgLogicals;
private void AddPageListItems(Volian.Svg.Library.Svg mySvg, VEPROMS.CSLA.Library.PageStyle pageStyle, VEPROMS.CSLA.Library.SectionInfo section) private void AddPageListItems(Volian.Svg.Library.Svg mySvg, VEPROMS.CSLA.Library.PageStyle pageStyle, VEPROMS.CSLA.Library.SectionInfo section, bool forceLoad)
{ {
//Console.WriteLine("{0}", section.ActiveFormat.Name); //Console.WriteLine("{0}", section.ActiveFormat.Name);
//Console.WriteLine("{0} pgstyle {1} section", pageStyle.Name,section.DisplayText); //Console.WriteLine("{0} pgstyle {1} section", pageStyle.Name,section.DisplayText);
@ -745,7 +757,7 @@ namespace Volian.Print.Library
// Console.WriteLine("{0} - PageList Token", pageItem.Token); // Console.WriteLine("{0} - PageList Token", pageItem.Token);
VE_Font useFontForCheckOffHeader = null; VE_Font useFontForCheckOffHeader = null;
if (sPag == SectionConfig.SectionPagination.Separate || ((sPag == SectionConfig.SectionPagination.Continuous || sPag ==0 )&& (pageItem.Row < 0))) if (forceLoad || (sPag == SectionConfig.SectionPagination.Separate || ((sPag == SectionConfig.SectionPagination.Continuous || sPag ==0 )&& (pageItem.Row < 0))))
{ {
//if (PrevRow > 0) //if (PrevRow > 0)
//{ //{

View File

@ -37,7 +37,7 @@ namespace Volian.Print.Library
string lastHeader = null; string lastHeader = null;
foreach (ItemInfo childItemInfo in itemInfoList) foreach (ItemInfo childItemInfo in itemInfoList)
{ {
if (childItemInfo.FormatStepData.TabData != null && childItemInfo.FormatStepData.TabData.IsTransition) if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.TabData != null && childItemInfo.FormatStepData.TabData.IsTransition)
{ {
lastHeader = childItemInfo.DisplayText; lastHeader = childItemInfo.DisplayText;
} }
@ -620,8 +620,8 @@ namespace Volian.Print.Library
// if this document style has another style that is for pages other than first, we need to // if this document style has another style that is for pages other than first, we need to
// reset the document style off of this section AND reset docstyle values used. // reset the document style off of this section AND reset docstyle values used.
if ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) > 0) if ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) > 0)
{ {
float _PointsPerPage = 792; float _PointsPerPage = 792;
ItemInfo ii = (ItemInfo)MyItemInfo.MyActiveSection; ItemInfo ii = (ItemInfo)MyItemInfo.MyActiveSection;
int indx = (int)MyItemInfo.MyActiveSection.MyDocStyle.IndexOtherThanFirstPage; int indx = (int)MyItemInfo.MyActiveSection.MyDocStyle.IndexOtherThanFirstPage;
foreach (DocStyle ds in ii.ActiveFormat.PlantFormat.DocStyles.DocStyleList) foreach (DocStyle ds in ii.ActiveFormat.PlantFormat.DocStyles.DocStyleList)
@ -629,6 +629,9 @@ namespace Volian.Print.Library
if (ds.Index == indx) if (ds.Index == indx)
{ {
MyItemInfo.MyActiveSection.MyDocStyle = ds; MyItemInfo.MyActiveSection.MyDocStyle = ds;
MyPageHelper.MySection = MyItemInfo.MyActiveSection as SectionInfo;
MyPageHelper.MySection.MyDocStyle = ds;
MyPageHelper.ResetSvg();
break; break;
} }
} }
@ -701,6 +704,8 @@ namespace Volian.Print.Library
{ {
if (myMsg.IndexOf(@"%d") > -1) if (myMsg.IndexOf(@"%d") > -1)
myMsg = myMsg.Replace(@"%d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim()); myMsg = myMsg.Replace(@"%d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim());
if (myMsg.IndexOf(@"%0d") > -1)
myMsg = myMsg.Replace(@"%0d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim(" .".ToCharArray()));
if (myMsg.IndexOf(@"%2d") > -1) if (myMsg.IndexOf(@"%2d") > -1)
myMsg = myMsg.Replace(@"%2d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim(" .".ToCharArray()).PadLeft(2)); myMsg = myMsg.Replace(@"%2d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim(" .".ToCharArray()).PadLeft(2));
float msg_yLocation = 0; float msg_yLocation = 0;
@ -715,7 +720,7 @@ namespace Volian.Print.Library
msg_yLocation = msg_yLocation + yLocation - SixLinesPerInch; msg_yLocation = msg_yLocation + yLocation - SixLinesPerInch;
break; break;
case E_ContBottomLoc.BtwnTextAndBottom: // place continue string between end of text & bottom of page case E_ContBottomLoc.BtwnTextAndBottom: // place continue string between end of text & bottom of page
msg_yLocation = msg_yLocation + yLocation - ((yLocation - yBottomMargin) / 2); msg_yLocation = msg_yLocation + yLocation - ((yLocation - yBottomMargin) / 2); // +SixLinesPerInch; (need this for IP3)
break; break;
case E_ContBottomLoc.BottomOfPage: // place continue message at bottom of page case E_ContBottomLoc.BottomOfPage: // place continue message at bottom of page
//msg_yLocation = yBottomMargin + 2 * SixLinesPerInch + (float)docstyle.Layout.FooterLength; // 2 lines above bottom margin //msg_yLocation = yBottomMargin + 2 * SixLinesPerInch + (float)docstyle.Layout.FooterLength; // 2 lines above bottom margin
@ -1780,6 +1785,8 @@ namespace Volian.Print.Library
if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.Prefix != null && MyItemInfo.FormatStepData.Suffix != null && MyItemInfo.FormatStepData.UseSmartTemplate) return 0; if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.Prefix != null && MyItemInfo.FormatStepData.Suffix != null && MyItemInfo.FormatStepData.UseSmartTemplate) return 0;
int everyNLines = MyItemInfo.FormatStepData == null ? 1 : MyItemInfo.FormatStepData.StepLayoutData.EveryNLines ?? 1; int everyNLines = MyItemInfo.FormatStepData == null ? 1 : MyItemInfo.FormatStepData.StepLayoutData.EveryNLines ?? 1;
if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == null) return SixLinesPerInch; 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.
//if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == null) return SixLinesPerInch;
return 0; return 0;
} }
private void AddMacros(ItemInfo itemInfo, vlnTab mytab) private void AddMacros(ItemInfo itemInfo, vlnTab mytab)
@ -2324,6 +2331,7 @@ namespace Volian.Print.Library
} }
} }
} }
// FNP tabbing '#2#' and '#1#', not fully tested: XOffset -= itemInfo.MyTab.Offset;
} }
private static float GetLeftJustify(FormatInfo formatInfo, int indxLevels) private static float GetLeftJustify(FormatInfo formatInfo, int indxLevels)