This commit is contained in:
Kathy Ruffing 2013-02-20 11:45:14 +00:00
parent 4c673f0ea3
commit 0a1d868d4a
7 changed files with 522 additions and 38 deletions

View File

@ -0,0 +1,192 @@
namespace Volian.Controls.Library
{
partial class DisplayFoldoutMaint
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupFoldouts = new DevComponents.DotNetBar.Controls.GroupPanel();
this.listBoxFoldouts = new System.Windows.Forms.ListBox();
this.groupSteps = new DevComponents.DotNetBar.Controls.GroupPanel();
this.lvSteps = new System.Windows.Forms.ListView();
this.lblStepSelect = new DevComponents.DotNetBar.LabelX();
this.btnSave = new DevComponents.DotNetBar.ButtonX();
this.groupFoldouts.SuspendLayout();
this.groupSteps.SuspendLayout();
this.SuspendLayout();
//
// groupFoldouts
//
this.groupFoldouts.CanvasColor = System.Drawing.SystemColors.Control;
this.groupFoldouts.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.groupFoldouts.Controls.Add(this.listBoxFoldouts);
this.groupFoldouts.Dock = System.Windows.Forms.DockStyle.Top;
this.groupFoldouts.Location = new System.Drawing.Point(0, 0);
this.groupFoldouts.Name = "groupFoldouts";
this.groupFoldouts.Size = new System.Drawing.Size(340, 154);
//
//
//
this.groupFoldouts.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
this.groupFoldouts.Style.BackColorGradientAngle = 90;
this.groupFoldouts.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
this.groupFoldouts.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.groupFoldouts.Style.BorderBottomWidth = 1;
this.groupFoldouts.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.groupFoldouts.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.groupFoldouts.Style.BorderLeftWidth = 1;
this.groupFoldouts.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.groupFoldouts.Style.BorderRightWidth = 1;
this.groupFoldouts.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.groupFoldouts.Style.BorderTopWidth = 1;
this.groupFoldouts.Style.CornerDiameter = 4;
this.groupFoldouts.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
this.groupFoldouts.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
this.groupFoldouts.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.groupFoldouts.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
//
//
//
this.groupFoldouts.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
//
//
//
this.groupFoldouts.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.groupFoldouts.TabIndex = 0;
this.groupFoldouts.Text = "Foldouts";
//
// listBoxFoldouts
//
this.listBoxFoldouts.Dock = System.Windows.Forms.DockStyle.Fill;
this.listBoxFoldouts.FormattingEnabled = true;
this.listBoxFoldouts.ItemHeight = 16;
this.listBoxFoldouts.Location = new System.Drawing.Point(0, 0);
this.listBoxFoldouts.Name = "listBoxFoldouts";
this.listBoxFoldouts.Size = new System.Drawing.Size(334, 116);
this.listBoxFoldouts.TabIndex = 0;
this.listBoxFoldouts.SelectedIndexChanged += new System.EventHandler(this.listBoxFoldouts_SelectedIndexChanged);
//
// groupSteps
//
this.groupSteps.CanvasColor = System.Drawing.SystemColors.Control;
this.groupSteps.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.groupSteps.Controls.Add(this.btnSave);
this.groupSteps.Controls.Add(this.lblStepSelect);
this.groupSteps.Controls.Add(this.lvSteps);
this.groupSteps.Location = new System.Drawing.Point(0, 142);
this.groupSteps.Name = "groupSteps";
this.groupSteps.Size = new System.Drawing.Size(337, 427);
//
//
//
this.groupSteps.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
this.groupSteps.Style.BackColorGradientAngle = 90;
this.groupSteps.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
this.groupSteps.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.groupSteps.Style.BorderBottomWidth = 1;
this.groupSteps.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.groupSteps.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.groupSteps.Style.BorderLeftWidth = 1;
this.groupSteps.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.groupSteps.Style.BorderRightWidth = 1;
this.groupSteps.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.groupSteps.Style.BorderTopWidth = 1;
this.groupSteps.Style.CornerDiameter = 4;
this.groupSteps.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
this.groupSteps.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
this.groupSteps.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.groupSteps.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
//
//
//
this.groupSteps.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
//
//
//
this.groupSteps.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.groupSteps.TabIndex = 1;
this.groupSteps.Text = "Steps";
//
// lvSteps
//
this.lvSteps.Dock = System.Windows.Forms.DockStyle.Bottom;
this.lvSteps.Location = new System.Drawing.Point(0, 80);
this.lvSteps.MultiSelect = false;
this.lvSteps.Name = "lvSteps";
this.lvSteps.Size = new System.Drawing.Size(331, 324);
this.lvSteps.TabIndex = 0;
this.lvSteps.UseCompatibleStateImageBehavior = false;
this.lvSteps.View = System.Windows.Forms.View.List;
this.lvSteps.SelectedIndexChanged += new System.EventHandler(this.lvSteps_SelectedIndexChanged);
//
// lblStepSelect
//
//
//
//
this.lblStepSelect.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.lblStepSelect.Location = new System.Drawing.Point(3, 3);
this.lblStepSelect.Name = "lblStepSelect";
this.lblStepSelect.Size = new System.Drawing.Size(296, 23);
this.lblStepSelect.TabIndex = 1;
//
// btnSave
//
this.btnSave.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnSave.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnSave.FocusOnLeftMouseButtonDown = true;
this.btnSave.Location = new System.Drawing.Point(29, 42);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(101, 23);
this.btnSave.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSave.TabIndex = 2;
this.btnSave.Text = "Save Selection";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// DisplayFoldoutMaint
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupSteps);
this.Controls.Add(this.groupFoldouts);
this.Name = "DisplayFoldoutMaint";
this.Size = new System.Drawing.Size(340, 588);
this.groupFoldouts.ResumeLayout(false);
this.groupSteps.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private DevComponents.DotNetBar.Controls.GroupPanel groupFoldouts;
private System.Windows.Forms.ListBox listBoxFoldouts;
private DevComponents.DotNetBar.Controls.GroupPanel groupSteps;
private System.Windows.Forms.ListView lvSteps;
private DevComponents.DotNetBar.LabelX lblStepSelect;
private DevComponents.DotNetBar.ButtonX btnSave;
}
}

View File

@ -0,0 +1,166 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
namespace Volian.Controls.Library
{
public partial class DisplayFoldoutMaint : UserControl
{
private ItemInfo _MyItemInfo;
public ItemInfo MyItemInfo
{
get { return _MyItemInfo; }
set
{
_MyItemInfo = value;
_MainStepSection = null;
FillInControls();
}
}
private SectionInfo _MainStepSection;
public SectionInfo MainStepSection
{
get
{
if (_MainStepSection == null)
{
foreach (SectionInfo si in MyItemInfo.MyProcedure.Sections)
{
SectionConfig sc = (SectionConfig)si.MyConfig;
if (sc.Section_OriginalSteps == "Y") _MainStepSection = si;
}
}
return _MainStepSection;
}
}
private ItemInfo _firstStep;
private ItemInfo _lastStep;
public DisplayFoldoutMaint()
{
InitializeComponent();
FillInControls();
}
private void FillInControls()
{
// for this iteminfo, get the procedure and then the list of sections. For any section, starting with
// Foldout, add it to list:
if (MyItemInfo != null)
{
ProcedureInfo pi = MyItemInfo.MyProcedure;
listBoxFoldouts.Items.Clear();
lvSteps.Items.Clear();
foreach (SectionInfo si in pi.Sections)
if (si.DisplayText.ToUpper().StartsWith("FOLDOUT"))listBoxFoldouts.Items.Add(si);
if (listBoxFoldouts.Items.Count > 0) listBoxFoldouts.SelectedIndex = 0;
else
{
listBoxFoldouts.Items.Add("No Foldouts Exist");
return;
}
// find default step section & use its steps to fill in tree.
ItemInfo startitm = MainStepSection.Steps != null && MainStepSection.Steps.Count > 0 ? MainStepSection.Steps[0] : null;
while (startitm != null)
{
lvSteps.Items.Add(startitm.ToString());
lvSteps.Items[lvSteps.Items.Count - 1].Tag = startitm;
startitm = (startitm.NextItem != null && startitm.NextItems.Count > 0 ? startitm.NextItems[0] : null);
}
}
ColorFoldoutSelection();
}
private void ColorFoldoutSelection()
{
if (MyItemInfo == null) return;
if (listBoxFoldouts.Items[0].ToString() == "No Foldouts Exist") return;
SectionInfo foldOutselected = listBoxFoldouts.Items[listBoxFoldouts.SelectedIndex] as SectionInfo;
ItemInfo tmpStep = null; // keep track of previous step, so can set _lastStep;
for (int i = 0; i<lvSteps.Items.Count;i++)
{
ItemInfo ii = lvSteps.Items[i].Tag as ItemInfo;
StepConfig sc = ii.MyConfig as StepConfig;
_firstStep = null;
_lastStep = null;
if (sc != null)
{
if (sc.Step_FloatingFoldout == foldOutselected.ItemID)
{
if (_firstStep == null) _firstStep = ii;
tmpStep = ii;
lvSteps.Items[i].BackColor = Color.Aquamarine;
}
else
lvSteps.Items[i].BackColor = lvSteps.BackColor;
}
}
_lastStep = tmpStep;
}
private void listBoxFoldouts_SelectedIndexChanged(object sender, EventArgs e)
{
ColorFoldoutSelection();
lblStepSelect.Text = "Select First Step";
}
private int _firstIndexForSelect = -1;
private void lvSteps_SelectedIndexChanged(object sender, EventArgs e)
{
if (lvSteps.SelectedIndices == null || lvSteps.SelectedIndices.Count == 0) return;
if (lblStepSelect.Text.Contains("Select First Step"))
{
// clear out background from list, and change label for instruct.,
// also set _firstStep to this one.
for (int i = 0; i < lvSteps.Items.Count; i++) lvSteps.Items[i].BackColor = lvSteps.BackColor;
lblStepSelect.Text = "Select Last Step";
_firstIndexForSelect = lvSteps.SelectedIndices[0];
_firstStep = (ItemInfo)lvSteps.Items[_firstIndexForSelect].Tag;
}
else
{
int lastind = lvSteps.SelectedIndices[0];
_lastStep = (ItemInfo)lvSteps.Items[lastind].Tag;
for (int i = _firstIndexForSelect; i < lastind; i++)
lvSteps.Items[i].BackColor = Color.Aquamarine;
lblStepSelect.Text = "Save or ReSelect First Step";
}
}
private void btnSave_Click(object sender, EventArgs e)
{
lblStepSelect.Text = "Select First Step";
// for all selected steps, set their cofig floating foldout item to
// the selected foldout.
bool sav = false;
SectionInfo foldOutselected = listBoxFoldouts.Items[listBoxFoldouts.SelectedIndex] as SectionInfo;
foreach (ItemInfo ii in MainStepSection.Steps)
{
if (ii.ItemID == _firstStep.ItemID)
sav = true;
if (sav)
{
StepConfig sc = ii.MyConfig as StepConfig;
sc.Step_FloatingFoldout = foldOutselected.ItemID;
using (Item itm = ii.Get())
{
itm.MyContent.Config = sc.ToString();
itm.MyContent.DTS = DateTime.Now;
itm.MyContent.UserID = Volian.Base.Library.VlnSettings.UserID;
itm.Save();
}
if (ii.ItemID == _lastStep.ItemID) sav = false;
}
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -95,6 +95,7 @@ namespace Volian.Controls.Library
get { return _textFont; }
set { _textFont = value; }
}
private bool PrintingSmartTemplate = false;
public string StartText;
public string OriginalText; // compare for save to see if change for links.
private FormatInfo _MyFormat;
@ -118,7 +119,11 @@ namespace Volian.Controls.Library
_MyItemInfo = itemInfo;
OriginalText = InfoText;
TextFont = itemInfo.GetItemFont();//GetItemFont();
string text = prefix + InfoText + suffix;
// if in print mode, and this is the HLS of a smart template (checklist formats), add a space before and
// after the HLS text - this allows for the vertical bar characters to be added.
if (itemInfo.IsStep && itemInfo.FormatStepData.UseSmartTemplate && epMode == E_EditPrintMode.Print) Console.WriteLine("here");
string addSpace = (itemInfo.IsStep && itemInfo.FormatStepData.UseSmartTemplate && epMode == E_EditPrintMode.Print) ? " " : "";
string text = prefix + addSpace + InfoText + addSpace + suffix;
_MyFormat = itemInfo.ActiveFormat;
bool tableShouldBeOutlined = (epMode == E_EditPrintMode.Print || vwMode == E_ViewMode.View || noEdit) &&

View File

@ -199,8 +199,8 @@ namespace Volian.Print.Library
// if the HLS is part of a Smart Template (i.e. WCNCKL table), don't add in an extra line because
// that makes pagination work incorrectly because the Smart Template has a 'table' line after the
// text.
BuildPageBreakList(yWithinMargins + SixLinesPerInch, yPageSizeNextPage + yExtra2, KeepStepsOnPage); // Case 5 - Determine items where page break(s) occur
//BuildPageBreakList(yWithinMargins + (MyItemInfo.FormatStepData.UseSmartTemplate?0:SixLinesPerInch), yPageSize + yExtra2, KeepStepsOnPage); // Case 5 - Determine items where page break(s) occur
//BuildPageBreakList(yWithinMargins + SixLinesPerInch, yPageSizeNextPage + yExtra2, KeepStepsOnPage); // Case 5 - Determine items where page break(s) occur
BuildPageBreakList(yWithinMargins + (MyItemInfo.FormatStepData.UseSmartTemplate?0:SixLinesPerInch), yPageSize + yExtra2, KeepStepsOnPage); // Case 5 - Determine items where page break(s) occur
return 0; // Stay on this page
}

View File

@ -270,31 +270,32 @@ namespace Volian.Print.Library
//}
int _StepPageNumber = 0;
private VlnSvgPageHelper _MyHelper = null;
private static PdfReader _MyFoldoutReader = null;
private static SectionInfo _MyFoldoutSection = null;
//private static List<PdfReader> _MyFoldoutReader = null;
//private static List<SectionInfo> _MyFoldoutSection = null;
//private static PdfReader _MyFoldoutReader = null;
//private static SectionInfo _MyFoldoutSection = null;
private static List<PdfReader> _MyFoldoutReader = null;
private static List<SectionInfo> _MyFoldoutSection = null;
private string Print(ProcedureInfo myProcedure, string pdfFolder)
{
_MyFoldoutReader = null;
//if (_MyFoldoutReader != null) _MyFoldoutReader.Clear();
//else _MyFoldoutReader = new List<PdfReader>();
if (_MyFoldoutReader != null) _MyFoldoutReader.Clear();
else _MyFoldoutReader = new List<PdfReader>();
//if (_MyFoldoutSection != null) _MyFoldoutSection.Clear();
//else _MyFoldoutSection = new List<SectionInfo>();
if (_MyFoldoutSection != null) _MyFoldoutSection.Clear();
else _MyFoldoutSection = new List<SectionInfo>();
if (myProcedure.Sections != null)
{
int cnt = 0;
foreach (SectionInfo mySection in myProcedure.Sections)
{
if (mySection.MyContent.Number.ToUpper() == "FOLDOUT"
|| (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && mySection.MyContent.Text.ToUpper().Contains("FOLDOUT")))
{
// if floating foldouts, need a list of sections & foldoutreaders. Just do first for now.
_MyFoldoutSection = mySection;
//_MyFoldoutSection.Add(mySection);
string foldoutPdf = PrintProcedureOrFoldout(myProcedure, true, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout.pdf");
_MyFoldoutReader = foldoutPdf != null ? new PdfReader(foldoutPdf) : null;
_MyFoldoutSection.Add(mySection);
string foldoutPdf = PrintProcedureOrFoldout(myProcedure, mySection, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout" + cnt.ToString() + @".pdf");
_MyFoldoutReader.Add(foldoutPdf != null ? new PdfReader(foldoutPdf) : null);
cnt++;
}
}
}
@ -306,7 +307,7 @@ namespace Volian.Print.Library
if (MessageBox.Show(outputFileName + " exists. Overwrite file?", "File Exists", MessageBoxButtons.YesNo) == DialogResult.No)
return null;
}
return PrintProcedureOrFoldout(myProcedure, false, outputFileName);
return PrintProcedureOrFoldout(myProcedure, null, outputFileName);
}
// Find the last section that has a Final Message defined in its format
// Return that section's itemID or a -1 if the Final Message is not defined
@ -329,8 +330,9 @@ namespace Volian.Print.Library
get { return _AllowAllWatermarks; }
set { _AllowAllWatermarks = value; }
}
private string PrintProcedureOrFoldout(ProcedureInfo myProcedure, bool doingFoldout, string outputFileName)
private string PrintProcedureOrFoldout(ProcedureInfo myProcedure, SectionInfo myFoldoutSection, string outputFileName)
{
bool doingFoldout = myFoldoutSection != null;
// The following line accounts for 16bit OverrideLeftMargin when the 'Absolute' attribute is used in the genmac.
// We don't want to use the OverrideLeftMargin when 'Absolute' is used in the genmac.
// It's set here because the Volian.Svg.Library cannot call back to Volian.Print.Library to get this value.
@ -356,6 +358,7 @@ namespace Volian.Print.Library
if ((mySection.MyContent.Number.ToUpper() == "FOLDOUT"
|| (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && mySection.MyContent.Text.ToUpper().Contains("FOLDOUT")))
!= doingFoldout) continue;
if (myFoldoutSection != null && myFoldoutSection.ItemID != mySection.ItemID) continue;
PrintOverride.CompressSuper = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper;
PrintOverride.CompressSub = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub;
OnStatusChanged((mySection.DisplayNumber ?? "") == "" ? mySection.DisplayText : mySection.DisplayNumber, PromsPrinterStatusType.Progress, progress++);
@ -419,7 +422,7 @@ namespace Volian.Print.Library
// get first step to send to floading foldout indx.&& MyItemInfo.FoldoutIndex>-1)
ItemInfo firstStep = mySection.Steps[0];
if (firstStep.FoldoutIndex() > -1)
DoFoldoutPage(cb, "Beginning of Step Section", _TextLayer, _MyHelper);
DoFoldoutPage(cb, "Beginning of Step Section", _TextLayer, _MyHelper, firstStep.FoldoutIndex());
}
CreateStepPdf(mySection, cb);
}
@ -489,7 +492,7 @@ namespace Volian.Print.Library
{
int pageNumber = 1 + ii;
if (((mySection.MyDocStyle.StructureStyle.Style ?? 0) & E_DocStructStyle.UseSectionFoldout) != 0)
DoFoldoutPage(cb, "Word Document", _TextLayer, _MyHelper);
DoFoldoutPage(cb, "Word Document", _TextLayer, _MyHelper, 0);
if (readerWord != null)
{
bool doimport2 = true;
@ -508,7 +511,7 @@ namespace Volian.Print.Library
{
float yoff = 0;
if (_MyHelper.DidFirstPageDocStyle) yoff = origYoff - (float)mySection.MyDocStyle.Layout.TopMargin;
AddImportedPageToLayer(cb.PdfWriter.DirectContent, _MSWordLayer, fgPage, 0, yoff);
AddImportedPageToLayer(cb.PdfWriter.DirectContent, _MSWordLayer, fgPage, (float)(mySection.MyDocStyle.Layout.MSWordXAdj??0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj??0)+yoff);
DebugPagination.WriteLine("{0},'{1}',{2}",
_MyHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, mySection.ShortPath,pageNumber);
@ -784,11 +787,11 @@ namespace Volian.Print.Library
PrintTextMessage(cb, "Foldout for: " + str, textLayer);
cb.PdfDocument.NewPage(); // Temporary for foldout/16bit-32bit page alignment
}
public static void DoFoldoutPage(PdfContentByte cb, string str, PdfLayer textLayer, VlnSvgPageHelper myPageHelper)
public static void DoFoldoutPage(PdfContentByte cb, string str, PdfLayer textLayer, VlnSvgPageHelper myPageHelper, int foldoutindx)
{
if (_MyFoldoutSection == null) return;
if (_MyFoldoutSection == null || _MyFoldoutSection.Count==0) return;
SectionInfo saveSect = myPageHelper.MySection;
myPageHelper.MySection = _MyFoldoutSection;
myPageHelper.MySection = _MyFoldoutSection[foldoutindx];
myPageHelper.OnFoldoutPage = true;
if (_MyFoldoutReader != null)
{
@ -796,7 +799,7 @@ namespace Volian.Print.Library
PdfImportedPage fgPage = null;
try
{
fgPage = cb.PdfWriter.GetImportedPage(_MyFoldoutReader,1);
fgPage = cb.PdfWriter.GetImportedPage(_MyFoldoutReader[foldoutindx],1);
}
catch (Exception ex)
{

View File

@ -369,7 +369,7 @@ namespace Volian.Print.Library
}
// Now do the bottom line for this item.
Paragraph crossLine = new Paragraph(bottomOfTable ? bx.BXLMID : bx.BXMID, iSymblFont);
float yloc = yPageStart - this.YBottomMost + 15;
float yloc = yPageStart - this.YBottomMost + 18;
Rtf2Pdf.TextAt(cb, leftLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yloc, lWidth, 100, null, yBottomMargin);
float hPos = float.Parse(vertPos[0]) + csize;
int doHorizCnt = 0;
@ -609,7 +609,7 @@ namespace Volian.Print.Library
}
// Only do foldout page if not done for section break, i.e. check the there's a previous step.
if (MyItemInfo.MyPrevious != null && MyItemInfo.FoldoutIndex()>-1)
PromsPrinter.DoFoldoutPage(cb, "HLS", MyPageHelper.TextLayer, MyPageHelper);
PromsPrinter.DoFoldoutPage(cb, "HLS", MyPageHelper.TextLayer, MyPageHelper, MyItemInfo.FoldoutIndex());
yPageStart = yTopMargin + YTopMost;
DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart);
MyPageHelper.YMultiplier = 1;
@ -650,7 +650,7 @@ namespace Volian.Print.Library
ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin);
DebugText.WriteLine("Paginate2");
if (MyItemInfo.FoldoutIndex()>-1)
PromsPrinter.DoFoldoutPage(cb, "Break within Step", MyPageHelper.TextLayer, MyPageHelper); // temporary foldout
PromsPrinter.DoFoldoutPage(cb, "Break within Step", MyPageHelper.TextLayer, MyPageHelper, MyItemInfo.FoldoutIndex()); // temporary foldout
// 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);
@ -689,7 +689,7 @@ namespace Volian.Print.Library
MyPageHelper.PageBookmarks.Add(MyItemInfo, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null);
}
if (MyItemInfo.FoldoutIndex() > -1)
PromsPrinter.DoFoldoutPage(cb, "HLS (7 lpi) break", MyPageHelper.TextLayer, MyPageHelper);
PromsPrinter.DoFoldoutPage(cb, "HLS (7 lpi) break", MyPageHelper.TextLayer, MyPageHelper, MyItemInfo.FoldoutIndex());
}
if (MyItemInfo.MyParent != null && MyItemInfo.MyParent.IsStepSection &&
MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles
@ -1194,20 +1194,17 @@ namespace Volian.Print.Library
PartsAbove.Add(new vlnMacro(xoff, yoff, macro));
}
}
// If WCN checklists, the substeps are printed in a row, need to keep track of the 'longest' in
// 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))
{
// do I need to get max of savCheckListBottomMost & (yoff+Height+SixLinesPerInch)
if (itemInfo.IsStep && itemInfo.MyHLS.FormatStepData.UseSmartTemplate && (TheStepLevel(itemInfo) >= 0))
savCheckListBottomMost = yoff + Height + SixLinesPerInch;
}
// Get Y offset for regular steps, or if section title is output or if not within row (not last column of
// text) for wcn checklist, i.e.
if ((!itemInfo.IsStepSection && !itemInfo.MyHLS.FormatStepData.UseSmartTemplate) // regular step
|| (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles
&& !MyItemInfo.MyDocStyle.CancelSectTitle
&& !MyItemInfo.MyDocStyle.SpecialStepsFoldout)
// In WCN Checklist: I don't have children or if I have children the first child doesn't alignwithparent.
// In Checklist: I don't have children or if I have children the first child doesn't alignwithparent.
|| (!itemInfo.IsStepSection && itemInfo.MyHLS.FormatStepData.UseSmartTemplate
&& ((itemInfo.Steps == null || itemInfo.Steps.Count == 0)
|| !itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab)))
@ -1307,9 +1304,10 @@ namespace Volian.Print.Library
}
YBottomMost = yoff;
// For WCN Checklist, the substeps are in rows of data. The YBottomMost is the bottom most for
// For Checklist, the substeps are in rows of data. The YBottomMost is the bottom most for
// the row.
if (savCheckListBottomMost != 0 && savCheckListBottomMost > YBottomMost) YBottomMost = savCheckListBottomMost;
if (savCheckListBottomMost != 0 && savCheckListBottomMost > YBottomMost)
YBottomMost = savCheckListBottomMost;
}
private string GetMacroName(string str)
@ -2101,7 +2099,7 @@ namespace Volian.Print.Library
int? bxIndx = itemInfo.IsStep ? formatInfo.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex : null;
float? widOvrd = 0;
float xwid = 0;
if (itemInfo.IsStep && itemInfo.MyHLS.FormatStepData.UseSmartTemplate && (xwid = GetWidthFromTemplate(itemInfo, formatInfo))>0)
if (itemInfo.IsStep && itemInfo.MyHLS.FormatStepData.UseSmartTemplate && (xwid = GetWidthFromTemplate(itemInfo, formatInfo)) > 0)
widOvrd = xwid;
else
widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride;