This commit is contained in:
Kathy Ruffing 2010-10-15 16:43:02 +00:00
parent 2d396f6c01
commit ffd881ae42
2 changed files with 87 additions and 83 deletions

View File

@ -33,8 +33,6 @@ namespace Volian.Controls.Library
this.btnTranCancel = new DevComponents.DotNetBar.ButtonX();
this.btnTranSave = new DevComponents.DotNetBar.ButtonX();
this.groupPanelTranFmt = new DevComponents.DotNetBar.Controls.GroupPanel();
this.rbEntireSec = new System.Windows.Forms.RadioButton();
this.rbEntireProc = new System.Windows.Forms.RadioButton();
this.listBoxTranFmt = new System.Windows.Forms.ListBox();
this.groupPanelTransitionSets = new DevComponents.DotNetBar.Controls.GroupPanel();
this.vlnTreeComboSets = new Volian.Controls.Library.vlnTreeCombo();
@ -45,6 +43,7 @@ namespace Volian.Controls.Library
this.groupPanelTranstionSteps = new DevComponents.DotNetBar.Controls.GroupPanel();
this.tvTran = new Volian.Controls.Library.vlnTreeView3();
this.pnlTranStepBtns = new System.Windows.Forms.Panel();
this.cbIncStepNum = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.lblxTranRangeTip = new DevComponents.DotNetBar.LabelX();
this.btnTranRangeClear = new DevComponents.DotNetBar.ButtonX();
this.btnUp1 = new DevComponents.DotNetBar.ButtonX();
@ -140,8 +139,6 @@ namespace Volian.Controls.Library
//
this.groupPanelTranFmt.CanvasColor = System.Drawing.SystemColors.Control;
this.groupPanelTranFmt.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.groupPanelTranFmt.Controls.Add(this.rbEntireSec);
this.groupPanelTranFmt.Controls.Add(this.rbEntireProc);
this.groupPanelTranFmt.Controls.Add(this.listBoxTranFmt);
this.groupPanelTranFmt.Dock = System.Windows.Forms.DockStyle.Top;
this.groupPanelTranFmt.Location = new System.Drawing.Point(0, 44);
@ -182,40 +179,16 @@ namespace Volian.Controls.Library
this.groupPanelTranFmt.TabIndex = 27;
this.groupPanelTranFmt.Text = "Select Format";
//
// rbEntireSec
//
this.rbEntireSec.AutoSize = true;
this.rbEntireSec.Dock = System.Windows.Forms.DockStyle.Right;
this.rbEntireSec.Location = new System.Drawing.Point(419, 116);
this.rbEntireSec.Name = "rbEntireSec";
this.rbEntireSec.Size = new System.Drawing.Size(76, 43);
this.rbEntireSec.TabIndex = 15;
this.rbEntireSec.TabStop = true;
this.rbEntireSec.Text = "Entire\r\nSection";
this.rbEntireSec.UseVisualStyleBackColor = true;
//
// rbEntireProc
//
this.rbEntireProc.AutoSize = true;
this.rbEntireProc.Dock = System.Windows.Forms.DockStyle.Left;
this.rbEntireProc.Location = new System.Drawing.Point(0, 116);
this.rbEntireProc.Name = "rbEntireProc";
this.rbEntireProc.Size = new System.Drawing.Size(95, 43);
this.rbEntireProc.TabIndex = 14;
this.rbEntireProc.TabStop = true;
this.rbEntireProc.Text = "Entire\r\nProcedure";
this.rbEntireProc.UseVisualStyleBackColor = true;
//
// listBoxTranFmt
//
this.listBoxTranFmt.Dock = System.Windows.Forms.DockStyle.Top;
this.listBoxTranFmt.Dock = System.Windows.Forms.DockStyle.Fill;
this.listBoxTranFmt.FormattingEnabled = true;
this.listBoxTranFmt.HorizontalScrollbar = true;
this.listBoxTranFmt.ItemHeight = 16;
this.listBoxTranFmt.Location = new System.Drawing.Point(0, 0);
this.listBoxTranFmt.Margin = new System.Windows.Forms.Padding(4);
this.listBoxTranFmt.Name = "listBoxTranFmt";
this.listBoxTranFmt.Size = new System.Drawing.Size(495, 116);
this.listBoxTranFmt.Size = new System.Drawing.Size(495, 148);
this.superToolTipDispTran.SetSuperTooltip(this.listBoxTranFmt, new DevComponents.DotNetBar.SuperTooltipInfo("", "", resources.GetString("listBoxTranFmt.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.listBoxTranFmt.TabIndex = 13;
this.listBoxTranFmt.SelectedIndexChanged += new System.EventHandler(this.listBoxTranFmt_Click);
@ -448,6 +421,7 @@ namespace Volian.Controls.Library
//
// pnlTranStepBtns
//
this.pnlTranStepBtns.Controls.Add(this.cbIncStepNum);
this.pnlTranStepBtns.Controls.Add(this.lblxTranRangeTip);
this.pnlTranStepBtns.Controls.Add(this.btnTranRangeClear);
this.pnlTranStepBtns.Controls.Add(this.btnUp1);
@ -458,6 +432,21 @@ namespace Volian.Controls.Library
this.pnlTranStepBtns.Size = new System.Drawing.Size(495, 57);
this.pnlTranStepBtns.TabIndex = 30;
//
// cbIncStepNum
//
//
//
//
this.cbIncStepNum.BackgroundStyle.Class = "";
this.cbIncStepNum.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.cbIncStepNum.Location = new System.Drawing.Point(10, 15);
this.cbIncStepNum.Name = "cbIncStepNum";
this.cbIncStepNum.Size = new System.Drawing.Size(168, 23);
this.cbIncStepNum.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.cbIncStepNum.TabIndex = 0;
this.cbIncStepNum.Text = "Include Step Number";
this.cbIncStepNum.CheckedChanged += new System.EventHandler(this.cbIncStepNum_CheckedChanged);
//
// lblxTranRangeTip
//
//
@ -482,7 +471,7 @@ namespace Volian.Controls.Library
this.btnTranRangeClear.CallBasePaintBackground = true;
this.btnTranRangeClear.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnTranRangeClear.Dock = System.Windows.Forms.DockStyle.Left;
this.btnTranRangeClear.Location = new System.Drawing.Point(57, 0);
this.btnTranRangeClear.Location = new System.Drawing.Point(0, 0);
this.btnTranRangeClear.Margin = new System.Windows.Forms.Padding(4);
this.btnTranRangeClear.Name = "btnTranRangeClear";
this.btnTranRangeClear.Size = new System.Drawing.Size(77, 57);
@ -496,16 +485,15 @@ namespace Volian.Controls.Library
this.btnUp1.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnUp1.CallBasePaintBackground = true;
this.btnUp1.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnUp1.Dock = System.Windows.Forms.DockStyle.Left;
this.btnUp1.Image = global::Volian.Controls.Library.Properties.Resources.GoToParentFolderHS;
this.btnUp1.Location = new System.Drawing.Point(0, 0);
this.btnUp1.Location = new System.Drawing.Point(280, 0);
this.btnUp1.Margin = new System.Windows.Forms.Padding(4);
this.btnUp1.Name = "btnUp1";
this.btnUp1.Size = new System.Drawing.Size(57, 57);
this.superToolTipDispTran.SetSuperTooltip(this.btnUp1, new DevComponents.DotNetBar.SuperTooltipInfo("", "", "This will display the tree for selecting the transition one level higher than cur" +
"rently shown.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
"rently shown. If already showing High Level Steps, this button has no effect.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnUp1.TabIndex = 30;
this.btnUp1.Click += new System.EventHandler(this.btnUp1_Click);
this.btnUp1.Visible = false;
//
// superToolTipDispTran
//
@ -527,7 +515,6 @@ namespace Volian.Controls.Library
this.groupPanelBtns.ResumeLayout(false);
this.groupPanelBtns.PerformLayout();
this.groupPanelTranFmt.ResumeLayout(false);
this.groupPanelTranFmt.PerformLayout();
this.groupPanelTransitionSets.ResumeLayout(false);
this.groupPanelTransitionProcs.ResumeLayout(false);
this.groupPanelTransitionSect.ResumeLayout(false);
@ -557,7 +544,6 @@ namespace Volian.Controls.Library
private DevComponents.DotNetBar.LabelX lblxTranRangeTip;
private vlnTreeView3 tvTran;
private DevComponents.DotNetBar.SuperTooltip superToolTipDispTran;
private System.Windows.Forms.RadioButton rbEntireSec;
private System.Windows.Forms.RadioButton rbEntireProc;
private DevComponents.DotNetBar.Controls.CheckBoxX cbIncStepNum;
}
}

View File

@ -115,6 +115,7 @@ namespace Volian.Controls.Library
if (_RangeNode1 != null || _RangeNode2 != null) ClearRangeTransition();
InitControls();
btnTranCancel.Enabled = false;
_InitializingTrans = false;
}
private void InitControls()
@ -402,51 +403,34 @@ namespace Volian.Controls.Library
}
private void tvTranFillIn(ItemInfo startitm)
{
bool nostep = false;
tvTran.Nodes.Clear();
groupPanelTranstionSteps.Style.BackColor = _OrigGroupPanelSteps;
if (startitm == null) return;
// if the transition to point is a section or procedure, just return
if (startitm.MyContent.Type < 20000) nostep = true;
if (startitm.MyContent.Type < 20000) return;
groupPanelTranstionSteps.Style.BackColor = Color.Cornsilk;
// For the tree view, use parent, unless already at HLS. If at HLS, use this level.
ItemInfo selitm = startitm;
if (!nostep)
{
if (_CurTrans == null)
{
//if (!startitm.IsHigh)
//{
// startitm = startitm.MyParent;
// selitm = startitm;
//}
selitm = startitm.MyHLS;
}
}
else
selitm = null;
ItemInfo selitm = startitm.MyHLS;
//if (_CurTrans == null)selitm = startitm.MyHLS;
E_TransUI etm = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[listBoxTranFmt.SelectedIndex].TransUI;
// no step
VETreeNode nost = null;
if ((etm & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone)
{
VETreeNode tvn = new VETreeNode("No step");
tvTran.Nodes.Add(tvn);
nost = tvn;
}
if (startitm.IsInRNO)
startitm = selitm.FirstSibling; // if in RNO tree, start out with HLS
else
startitm = selitm!=null? selitm.FirstSibling:startitm.FirstSibling;
bool setsel = false;
while (startitm != null)
{
VETreeNode tvn = new VETreeNode(startitm, false);
tvn.Tag = startitm;
int active = this.tvTran.Nodes.Add(tvn);
if (nost == null && startitm.ItemID == selitm.ItemID) tvTran.SelectedNode = tvTran.Nodes[active];
if (startitm.ItemID == selitm.ItemID)
{
tvTran.SelectedNode = tvTran.Nodes[active];
setsel = true;
}
startitm = (startitm.NextItemCount > 0 ? startitm.NextItems[0] : null);
}
if (!setsel) tvTran.SelectedNode = tvTran.Nodes[0];
tvTran.BeforeExpand += new TreeViewCancelEventHandler(tvTran_BeforeExpand);
// bug fix. TreeView needs the next two lines to properly display the bottom node. jsj 01/08/2010
tvTran.ItemHeight++;
@ -544,7 +528,33 @@ namespace Volian.Controls.Library
// if any previous nodes selected for range - clear them here
if (!_DoingRange && _RangeNode1 != null) ClearRangeTransition();
// Always allow for step selection if there are items.
if (tvTran.Nodes.Count>0)tvTran.Enabled = true;
if (tvTran.Nodes.Count > 0) tvTran.Enabled = true;
// if a step doesn't need to be specified, then show the cbIncStepNum which allows
// user to define whether a step number is to be included in transition.
if ((etm & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone)
{
cbIncStepNum.Visible = true;
// may or may not allow steps to be selected, i.e. if this is checked then enable
// tree view for step selection:
cbIncStepNum.Checked = true;
if (_CurTrans != null && _CurTrans.MyItemToID.MyContent.Type < 20000)
{
cbIncStepNum.Checked = false;
tvTran.Enabled = false;
}
// the following test is for Section/Optional Step (type 4 and related). If is a step section and its
// the only step section in the procedure then a step number must be selected.
int cntsect = 0;
foreach (ItemInfo ii in _CurItemFrom.MyProcedure.Sections) if (ii.IsStepSection) cntsect++;
if (((etm & E_TransUI.ProcCur) == E_TransUI.ProcCur) && ((etm & E_TransUI.SectMenuAny) == E_TransUI.SectMenuAny) && cntsect==1)
{
tvTran.Enabled = true;
cbIncStepNum.Visible = false;
}
}
else
cbIncStepNum.Visible = false;
}
#endregion
#region Events
@ -695,21 +705,22 @@ namespace Volian.Controls.Library
}
SetControlsEnabling();
}
private void btnUp1_Click(object sender, EventArgs e)
{
// if StepAllowNone, then use the second node in the tree view.
int indx = 0;
if (tvTran.Nodes[0].Tag == null) indx = 1;
// if at HLS, don't do anything.
ItemInfo curitm = (ItemInfo)((VETreeNode)tvTran.Nodes[indx]).VEObject;
if (curitm.IsHigh) return;
tvTranFillIn(curitm);
}
//private void btnUp1_Click(object sender, EventArgs e)
//{
// // if StepAllowNone, then use the second node in the tree view.
// int indx = 0;
// if (tvTran.Nodes[0].Tag == null) indx = 1;
// // if at HLS, don't do anything.
// ItemInfo curitm = (ItemInfo)((VETreeNode)tvTran.Nodes[indx]).VEObject;
// if (curitm.IsHigh) return;
// tvTranFillIn(curitm);
//}
private void tvTran_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
VETreeNode tn = ((VETreeNode)e.Node);
// true fixes empty expand, but allows for transitions 'way down' in RNO tree. HVJ & PAL wanted to
// allow this (12/2/09)
// allow this (12/2/09). Note that this was changed to not allow transitions
// to RNOs (10/2010), this 'feature' will be added at some later date.
tn.ChildrenLoaded = false;
tn.LoadChildren(false);
}
@ -906,12 +917,14 @@ namespace Volian.Controls.Library
}
else if ((etm & E_TransUI.StepFirst) == E_TransUI.StepFirst)
{
VETreeNode vtn = (VETreeNode)tvTran.SelectedNode;
if (vtn != null && vtn.Tag != null)
if (tvTran.SelectedNode != null && (cbIncStepNum.Visible == false || cbIncStepNum.Checked))
{
toItem = (ItemInfo)vtn.VEObject; // is this cast valid?
linktxt = string.Format("#Link:Transition:{0} <NewID> {1}", listBoxTranFmt.SelectedIndex, toItem.ItemID);
VETreeNode vtn = (VETreeNode)tvTran.SelectedNode;
toItem = (ItemInfo)vtn.VEObject;
}
else
toItem = (ItemInfo)cbTranSects.SelectedItem; // didn't select a step.
linktxt = string.Format("#Link:Transition:{0} <NewID> {1}", listBoxTranFmt.SelectedIndex, toItem.ItemID);
}
// toItem may have been set in the 'Range' selection code above.
if (toItem == null && (etm & E_TransUI.SectMenuAny) == E_TransUI.SectMenuAny)
@ -1048,5 +1061,10 @@ namespace Volian.Controls.Library
top2.BackColor = on ? _RangeColor : tvTran.BackColor;
}
#endregion
private void cbIncStepNum_CheckedChanged(object sender, EventArgs e)
{
tvTran.Enabled=cbIncStepNum.Checked;
}
}
}