From 4f4513ffe5600bcf860feeec3f4e80fa0153ea36 Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 13 Jul 2015 15:49:08 +0000 Subject: [PATCH] Added CenterToStepThenPage format flag which smothly transitions the left margin of a table as the table width increases from the high-level step width to the page width. --- PROMS/Formats/fmtall/SUMall.xml | Bin 120552 -> 121672 bytes .../VEPROMS.CSLA.Library/Format/DocStyles.cs | 12 +++++++ PROMS/Volian.Print.Library/vlnParagraph.cs | 33 ++++++++++++------ 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/PROMS/Formats/fmtall/SUMall.xml b/PROMS/Formats/fmtall/SUMall.xml index 907e1d9db9e313aeb202df3ec5dcaec9fe7c32f3..2519a3fa5be120b2c6453d1b5aa9a0b0ada8aedc 100644 GIT binary patch delta 1411 zcmb`Hze_?<6vyw^^gSnWaCl-hxCag8RzyLALj*-cQx0WNSV#_OgElk-f(CWq1=25Q zsR#+fVyC>inhU2aq2%rm{02n z>pqb<9B1zcQB42~pbGMA#CYQbUz&FGFcr-f{__8Qj%gDBN&Z*ayFyNv;#)a+4M#Wa zy?@+mj8pj;6BHRiil6S`=*C2#1N_rO%GS)hzg?uOCC#x|07D^@%Vo8>Ar?Ej b1|}p}W>^l;TM-uRuEU|$ErR_1f&hL2hTKiK delta 375 zcmX@Hjs3-1_J%EtP3hC8oM4pL&UcP+7VGw$T*hxqV1elds~FR!KiI{%YP;Nd#&68i zKg?ld+rF=qQG^99uQIKTQEvLbt&9niVpyi<++b9gtgx|Q^13R4=?=RYRkrt3Gsdxk zREtf&)5`d1`n;2jeA6E+WGvghu8Hvh*dDR%Kp82pkzl3`77g?x(cv3fmaDz*17%Yj!c3u_H+VgCl`yde1G!mgyH}Fe+`&I|_8_ ecA%wNU~hs$F^v;d!!O3^3KxMvr*(@_ju8N~wwag! diff --git a/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs b/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs index e6a9abc4..07fa6aa3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs @@ -508,6 +508,18 @@ namespace VEPROMS.CSLA.Library } } #endregion + #region CenterToStepThenPage + [Category("Layout")] + [Description("CenterToStepThenPage")] + private LazyLoad _CenterToStepThenPage; + public bool CenterToStepThenPage + { + get + { + return LazyLoad(ref _CenterToStepThenPage, "@CenterToStepThenPage"); + } + } + #endregion } #endregion #region SectTop diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index d2a28446..035c688c 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -4058,18 +4058,31 @@ namespace Volian.Print.Library XOffset = hls1.XOffset + hls1.Width - Width; // align with the right edge of hls text } } + if (itemInfo.MyDocStyle.Layout.CenterToStepThenPage) + { + if (Width > hls1.Width) + { + float XOffsetPage = leftMargin + ((pageWidth - leftMargin) - Width) / 2; + float fraction = (Width - hls1.Width) / ((pageWidth - leftMargin) - hls1.Width); + float XOffsetNew = (1 - fraction) * XOffset + fraction * XOffsetPage; + _MyLog.WarnFormat("***XOffsetAdjust-CenterToStepThenPage*** ItemID, XOffset, XOffsetPage, XOffsetNew ={0},{1},{2},{3}", itemInfo.ItemID, XOffset, XOffsetPage, XOffsetNew); + XOffset = XOffsetNew; + } + } + else + { + // if the XOffset < High Level Step Text's XOffset , then align with the High Level Step Text + if (XOffset < xLowerLimit && Width < (xUpperLimit - xLowerLimit)) + XOffset = xLowerLimit; - // if the XOffset < High Level Step Text's XOffset , then align with the High Level Step Text - if (XOffset < xLowerLimit && Width < (xUpperLimit - xLowerLimit)) - XOffset = xLowerLimit; + // if the right margin exceeds the right edge of the rightmost RNO, then adjust right edge to match. + if (XOffset + Width > xUpperLimit) + XOffset = xUpperLimit - Width; - // if the right margin exceeds the right edge of the rightmost RNO, then adjust right edge to match. - if (XOffset + Width > xUpperLimit) - XOffset = xUpperLimit - Width; - - // because of the above, if it pushes beyond the left margin, use the left margin. - if (XOffset < (float)itemInfo.MyDocStyle.Layout.LeftMargin) - XOffset = XOffsetBox = (float)itemInfo.MyDocStyle.Layout.LeftMargin; + // because of the above, if it pushes beyond the left margin, use the left margin. + if (XOffset < (float)itemInfo.MyDocStyle.Layout.LeftMargin) + XOffset = XOffsetBox = (float)itemInfo.MyDocStyle.Layout.LeftMargin; + } } private float AdjustForBlankLines() {