This commit is contained in:
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) &&