This commit is contained in:
2013-06-07 11:11:54 +00:00
parent 92588ad059
commit 05f3fcf8a4
7 changed files with 182 additions and 85 deletions

View File

@@ -50,7 +50,6 @@ namespace Volian.Print.Library
yoff = Add(cb, childItemInfo.Notes, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo);
int? bxIndx = childItemInfo.FormatStepData==null?-1:childItemInfo.FormatStepData.StepLayoutData.STBoxindex;
bool boxHLS = false;
if ((bxIndx != -1 && (bxIndex != bxIndx || childItemInfo.FormatStepData.BoxIt)))
{
if (childItemInfo.FormatStepData.BoxIt) // this is a boxed HLS
@@ -74,7 +73,7 @@ namespace Volian.Print.Library
box.YOffset = yoff;
int ln = 1; // a format flag determines whether there is a space before the note/caution.
if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++;
//if (boxHLS && !childItemInfo.HasCautionOrNote)
if (!boxHLS || (boxHLS && !childItemInfo.HasCautionOrNote))
yoff += ln * vlnPrintObject.SixLinesPerInch;
}
}
@@ -116,8 +115,8 @@ namespace Volian.Print.Library
}
if (boxHLS)
{
box.YOffset = para.YTop;
box.Height = para.YBottomMost - para.YTop - (1.1F * vlnPrintObject.SixLinesPerInch);
box.YOffset = para.YTop - (2 * vlnPrintObject.SixLinesPerInch);
box.Height = para.YBottomMost - box.YOffset; // para.YTop - (1.1F * vlnPrintObject.SixLinesPerInch);
box = null;
}
boxHLS = false;
@@ -697,6 +696,21 @@ namespace Volian.Print.Library
DebugText.WriteLine("Paginate2");
if (MyItemInfo.FoldoutIndex()>-1)
PromsPrinter.DoFoldoutPage(cb, "Break within Step", MyPageHelper.TextLayer, MyPageHelper, MyItemInfo.FoldoutIndex()); // temporary foldout
// if there is a 'container vlnbox' around the HLS, flag that the drawn box must also break:
if (MyHighLevelParagraph != null && MyHighLevelParagraph.PartsContainer != null && MyHighLevelParagraph.PartsContainer.Count > 0)
{
foreach (vlnPrintObject vpo in MyHighLevelParagraph.PartsContainer)
{
vlnBox vb = vpo as vlnBox;
if (vb != null)
{
vb.ContainsPageBreak = true;
PartsContainer.Add(vb);
}
}
}
// If there is a box, adjust the yTopMost to include it.
float yTopMost = YTopMost;
//if (YVeryTop < yTopMost) Console.WriteLine("{0},{1},{2}", MyItemInfo.DBSequence, yTopMost, YVeryTop);
@@ -1087,10 +1101,20 @@ namespace Volian.Print.Library
yoff = ChildrenAbove.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
}
if (itemInfo.Notes != null && !(itemInfo.IsCaution || itemInfo.IsNote))
{
if (itemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
yoffLeft = Math.Max(yoffLeft, ChildrenLeft.Add(cb, itemInfo.Notes, xoff + 6 + (float)(itemInfo.ActiveFormat.MyStepSectionLayoutData.WidT), yoff, yoff, rnoLevel, maxRNO, formatInfo));
else
yoff = ChildrenAbove.Add(cb, itemInfo.Notes, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
yoff = ChildrenAbove.Add(cb, itemInfo.Notes, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
}
// if this is a hls with a box, adjust the starting y location for the hls. this is done here
// in case this hls had a boxed caution and/or note before it. Also, this code is here rather
// than in the vlnparagraphs.add code because the yoff in that code will position the box, but
// this code positions the hls (in y direction), without this, the hls starts on the box line.
int bxIndx = itemInfo.IsSection ? 0 : itemInfo.FormatStepData.StepLayoutData.STBoxindex ?? 0;
if (itemInfo.IsHigh && bxIndx > 0) yoff += (2 * SixLinesPerInch);
// If the format has that extra space should be put out before the step, then
// handle this by using the 'PartsAbove' structure. By using the parts above, the extra
// space above will be done regardless of where page breaks fall.
@@ -1214,7 +1238,7 @@ namespace Volian.Print.Library
{
Rtf = GetRtf(itemInfo, prefix, suffix);
// Need the following with some modifications for WCNCKL format:
while (Rtf.Contains("{Backspace}"))
if (Rtf.Contains("{Backspace}"))
{
XOffset -= 25;
Width += 24;
@@ -1258,6 +1282,20 @@ namespace Volian.Print.Library
PartsAbove.Add(new vlnMacro(xoff, yoff, macro));
}
}
// if this step has a prefix but it's not checklist... do a partsleft for prefix
if (_MyItemInfo.IsStep && !_MyItemInfo.FormatStepData.UseSmartTemplate)
{
if (_MyItemInfo.FormatStepData.Prefix != null && _MyItemInfo.FormatStepData.Prefix != "")
{
string pref = _MyItemInfo.FormatStepData.Prefix.Replace("{Backspace}", "");
float xPref = XOffset - (pref.Length * (72 / (float)_MyItemInfo.FormatStepData.Font.CPI));
E_Style es = (E_Style)_MyItemInfo.FormatStepData.Font.Style & E_Style.Bold;
VE_Font tmpFont = new VE_Font(_MyItemInfo.FormatStepData.Font.Family, (int)_MyItemInfo.FormatStepData.Font.Size, es, (float)_MyItemInfo.FormatStepData.Font.CPI);
PartsLeft.Add(new vlnText(cb, this, pref, pref, xPref, yoff, tmpFont));
}
}
// If checklists, the substeps are printed in a row, need to keep track of the 'longest' in
// y direction (bottommost) across the row.
if (itemInfo.IsStep && itemInfo.MyHLS.FormatStepData.UseSmartTemplate && (TheStepLevel(itemInfo) >= 0))
@@ -1777,6 +1815,8 @@ namespace Volian.Print.Library
if (itemInfo.IsHigh && itemInfo.MyDocStyle.UndSpecialStepsFoldout) myFont = new System.Drawing.Font(myFont.FontFamily, myFont.Size, myFont.Style | FontStyle.Underline);
_RtfSB.Append(AddFontTable(myFont));
_RtfSB.Append(vlntxt.StartText);
if (_MyItemInfo.IsStep && !itemInfo.FormatStepData.UseSmartTemplate && _MyItemInfo.FormatStepData.Suffix != null && _MyItemInfo.FormatStepData.Suffix != "")
_RtfSB.Append(_MyItemInfo.FormatStepData.Suffix.Replace("{ulnone}",@"\ulnone "));
_RtfSB.Append("}");
return _RtfSB.ToString();
}
@@ -2008,7 +2048,7 @@ namespace Volian.Print.Library
iilvl = iilvl.MyParent;
}
level = level <= 2 ? 1 : level - 1;
if (level==1)
if (level == 1)
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (level * (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos);
else
{
@@ -2022,41 +2062,16 @@ namespace Volian.Print.Library
int typ = ((int)itemInfo.MyContent.Type) % 10000;
int? bxIndx = formatInfo.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex;
float? colOvrd = formatInfo.PlantFormat.FormatData.StepDataList[typ].ColOverride;
if (bxIndx != null)
{
Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
if (bx == null)
{
if ((colOvrd??0)!=0)
{
// 16-bit code subtracted the left margin
//xoff = ((float)colOvrd - (float)itemInfo.MyDocStyle.Layout.LeftMargin) - XOffset;
//XOffset += xoff;
//if (myTab != null) myTab.XOffset += xoff;
//xoff = MyParent.XOffset - myTab.XOffset;
//XOffset += xoff;
float tabOffset = (myTab == null?0: myTab.XOffset) - XOffset;
XOffset = (float)colOvrd;
if (myTab != null) myTab.XOffset = XOffset + tabOffset;
return;
}
else
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + tabWidth + XOffsetBox;
}
else
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)bx.TxtStart + tabWidth + XOffsetBox;
if (myTab != null) myTab.XOffset = XOffset - tabWidth;
}
else if (itemInfo.IsHigh)
if (itemInfo.IsHigh)
{
float x = 0;
float xoff = 0;
if ((colOvrd??0)!=0)
if ((colOvrd ?? 0) != 0)
x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)colOvrd;
else
x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS;
xoff = x - XOffset;
// ColSByLevel will specify the column in which the High Level Step starts with
// respect to the overall level calculation based on sections & meta-sections.
@@ -2068,7 +2083,7 @@ namespace Volian.Print.Library
float colsbylevel = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel;
float seclvlindent = colsbylevel - (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS;
float adjCols = (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS + seclvlindent;
float xtabcol = adjCols - ((myTab==null||myTab.Text==null)?0:(myTab.Text.Length * 7.2f));
float xtabcol = adjCols - ((myTab == null || myTab.Text == null) ? 0 : (myTab.Text.Length * 7.2f));
if (indxLevel > 1 && myTab != null) myTab.XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + xtabcol;
else if (myTab != null) myTab.XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + colsbylevel;
if (myTab != null)
@@ -2099,6 +2114,32 @@ namespace Volian.Print.Library
}
}
}
else if (bxIndx != null)
{
Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
if (bx == null)
{
if ((colOvrd ?? 0) != 0)
{
// 16-bit code subtracted the left margin
//xoff = ((float)colOvrd - (float)itemInfo.MyDocStyle.Layout.LeftMargin) - XOffset;
//XOffset += xoff;
//if (myTab != null) myTab.XOffset += xoff;
//xoff = MyParent.XOffset - myTab.XOffset;
//XOffset += xoff;
float tabOffset = (myTab == null ? 0 : myTab.XOffset) - XOffset;
XOffset = (float)colOvrd;
if (myTab != null) myTab.XOffset = XOffset + tabOffset;
return;
}
else
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + tabWidth + XOffsetBox;
}
else
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)bx.TxtStart + tabWidth + XOffsetBox;
if (myTab != null) myTab.XOffset = XOffset - tabWidth;
}
//else if (itemInfo.IsRNOPart && !((ItemInfo)itemInfo.ActiveParent).IsHigh)
//{
// // don't adjust for rno
@@ -2116,7 +2157,7 @@ namespace Volian.Print.Library
}
// if the step is within the rno and we're numbering the high level rno, we've got to account for the
// indenting (increased x offset) for the top level rno's tab, if there is no top level rno:
if (itemInfo.FormatStepData.NumberHighLevel && (itemInfo.MyHLS.RNOs == null || itemInfo.MyHLS.RNOs.Count<=0))
if (itemInfo.FormatStepData.NumberHighLevel && (itemInfo.MyHLS.RNOs == null || itemInfo.MyHLS.RNOs.Count <= 0))
{
// add in the size that an RNO off HLS would take.
XOffset += tabWidth;
@@ -2133,7 +2174,7 @@ namespace Volian.Print.Library
// the tab. The offset of text needs to be adjusted by the 'leftjustify' format variable
// if it existed for this level.
myTab.XOffset += tabWidth;
if (tableftadj != 0 && myTab.Width<tableftadj)
if (tableftadj != 0 && myTab.Width < tableftadj)
tabWidth = myTab.Width = tableftadj;
XOffset += tabWidth;
myTab.Rtf = myTab.Rtf.Replace(myTab.Text, myTab.Text.TrimStart(" ".ToCharArray()));
@@ -2190,22 +2231,8 @@ namespace Volian.Print.Library
if (bxIndx == null) return;
}
float tabWidth = (myTab == null) ? 0 : myTab.Width;
if (bxIndx != null)
{
Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
if (bx == null)
{
// NOT SURE IF WE NEED TO TEST FOR THE NULLBOX FORMAT FLAG, MAYBE "bx == null" IS THE SAME THING
//if (formatInfo.MyStepSectionLayoutData.NullBox)
if (widOvrd != 0)
Width = (float)widOvrd - tabWidth;
else
Width = (float)formatInfo.MyStepSectionLayoutData.WidT - tabWidth;
}
else
Width = _WidthAdjustBox + (float)bx.TxtWidth - tabWidth; // add 1 to get it to wrap like 16Bit
}
else if (itemInfo.IsHigh)
if (itemInfo.IsHigh)
{
float CheckOffAdj = 0;
if (itemInfo.MyDocStyle.UseCheckOffs)
@@ -2249,6 +2276,21 @@ namespace Volian.Print.Library
if (itemInfo.MyDocStyle.AlignHLSTabWithSect)
Width = Width - (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos;
}
else if (bxIndx != null)
{
Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
if (bx == null)
{
// NOT SURE IF WE NEED TO TEST FOR THE NULLBOX FORMAT FLAG, MAYBE "bx == null" IS THE SAME THING
//if (formatInfo.MyStepSectionLayoutData.NullBox)
if (widOvrd != 0)
Width = (float)widOvrd - tabWidth;
else
Width = (float)formatInfo.MyStepSectionLayoutData.WidT - tabWidth;
}
else
Width = _WidthAdjustBox + (float)bx.TxtWidth - tabWidth; // add 1 to get it to wrap like 16Bit
}
else if (itemInfo.IsCaution || itemInfo.IsNote)
{
float mycolT = (float)formatInfo.MyStepSectionLayoutData.ColT;