From 97427f9f05be2c66b24f8cf5fcda1a20f843cce5 Mon Sep 17 00:00:00 2001 From: Kathy Date: Mon, 10 Mar 2008 13:16:58 +0000 Subject: [PATCH] --- .../DisplayTransition.Designer.cs | 10 ++--- .../DisplayTransition.cs | 39 ++++++++++++++----- .../TemporaryFormat.cs | 10 ++--- 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayTransition.Designer.cs b/PROMS/Volian.Controls.Library/DisplayTransition.Designer.cs index a7897a3a..a7bfa13c 100644 --- a/PROMS/Volian.Controls.Library/DisplayTransition.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayTransition.Designer.cs @@ -319,13 +319,13 @@ namespace Volian.Controls.Library // // lblxTranRangeTip // - this.lblxTranRangeTip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.lblxTranRangeTip.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblxTranRangeTip.Location = new System.Drawing.Point(235, 0); + this.lblxTranRangeTip.Dock = System.Windows.Forms.DockStyle.Right; + this.lblxTranRangeTip.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblxTranRangeTip.Location = new System.Drawing.Point(265, 0); this.lblxTranRangeTip.Name = "lblxTranRangeTip"; - this.lblxTranRangeTip.Size = new System.Drawing.Size(135, 46); + this.lblxTranRangeTip.Size = new System.Drawing.Size(105, 46); this.lblxTranRangeTip.TabIndex = 33; - this.lblxTranRangeTip.Text = "Select First Transition\r\nfor Range"; + this.lblxTranRangeTip.Text = "Select First \r\nTransition\r\nfor Range"; // // btnTranRangeClear // diff --git a/PROMS/Volian.Controls.Library/DisplayTransition.cs b/PROMS/Volian.Controls.Library/DisplayTransition.cs index 9b131d42..17b09138 100644 --- a/PROMS/Volian.Controls.Library/DisplayTransition.cs +++ b/PROMS/Volian.Controls.Library/DisplayTransition.cs @@ -25,16 +25,16 @@ namespace Volian.Controls.Library set { _CurTrans = value; - if (_CurTrans == null) + if (_CurTrans == null) // Insert a transition { if (MyRTB == null) return; _CurItemFrom = MyRTB.MyItem; _TranFmtIndx = 0; } - else + else // Modify a transition { _TranFmtIndx = _CurTrans.TranType; - _CurItemFrom = ItemInfo.Get(_CurTrans.FromID); + _CurItemFrom = MyRTB.MyItem; } _SavCurItemFrom = _CurItemFrom; _SavTranFmtIndx = _TranFmtIndx; @@ -56,13 +56,15 @@ namespace Volian.Controls.Library get { return _RangeColor; } set { _RangeColor = value; } } - private DisplayRTB _MyRTB; // Current RichTextBox, i.e. insert transition to it. + private DisplayRTB _MyRTB; // Current MyDisplayRTB, i.e. insert transition to it. public DisplayRTB MyRTB { get { return _MyRTB; } set { _MyRTB = value; } } - private ItemInfo _CurrentProcedure; // current procedure flags + private ItemInfo _CurrentItemProcedure; // the selected item's procedure + private ItemInfo _CurrentToProcedure; // the 'to' location's procedure (may be same as _CurrentItemProcedure) + private ItemInfo _CurrentProcedure; // current procedure used to set all of the controls (may switch between above two) private int _CurrentProcIndex; private bool _AlwaysDisableSets; // true if there is only 1 item in tree/combo for sets #endregion @@ -101,6 +103,17 @@ namespace Volian.Controls.Library tmpitm = tmpitm.MyParent; } _CurrentProcedure = tmpitm; + _CurrentToProcedure = _CurrentProcedure; + if (_CurTrans == null) + _CurrentItemProcedure = _CurrentProcedure; + else + { + // use the transition from to get the procedure 'from'.... + ItemInfo curfrom = _CurItemFrom; + while (curfrom.MyContent.Type != 0) curfrom = curfrom.MyParent; + _CurrentItemProcedure = curfrom; + } + // set other procedure related private variables. vlnTreeComboSetsFillIn(_CurrentProcedure); cbTranProcsFillIn(_CurrentProcedure); if (_CurrentProcedure.Sections != null) @@ -354,7 +367,7 @@ namespace Volian.Controls.Library lblxTranRangeTip.BackColor = _RangeColor; // if any previous nodes selected for range - clear them here if (!_DoingRange && _RangeNode1 != null) ClearRangeTransition(); - + if (_DoingRange && _RangeNode1 == null) InitRangeTransition(); // Always allow for step selection if there are items. if (tvTran.Nodes.Count>0)tvTran.Enabled = true; } @@ -473,12 +486,14 @@ namespace Volian.Controls.Library if (listBoxTranFmt.SelectedIndex == _TranFmtIndx) return; if (_RangeNode1 != null) ClearRangeTransition(); - // if this selection needs a step, the section list may need to updated with step only sections, - // list the step sections of the current procedure..... + // if this selection needs a step, but not a procedure, use the current procedure & the section list may need to updated + // with step only section. List the step sections of the current procedure..... E_TransUI etmprev = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[_TranFmtIndx].TransUI; E_TransUI etmnew = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[listBoxTranFmt.SelectedIndex].TransUI; - if (((etmnew & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone) != ((etmprev & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone)) + if (((etmnew & E_TransUI.ProcCur) == E_TransUI.ProcCur) && ((etmprev & E_TransUI.ProcCur) == E_TransUI.ProcCur) != ((etmnew & E_TransUI.ProcCur) == E_TransUI.ProcCur)) { + _CurrentProcedure = _CurrentItemProcedure; + cbTranProcsFillIn(_CurrentProcedure); int sectstartid = FindSectionStart(_CurrentProcedure); IList chldrn = _CurrentProcedure.GetChildren(); if (chldrn != null && chldrn.Count > 0) cbTranSectsFillIn((ItemInfo)chldrn[0], sectstartid); @@ -652,6 +667,12 @@ namespace Volian.Controls.Library } #endregion #region VariousSupportMethods + private void InitRangeTransition() + { + if (_InitializingTrans) MessageBox.Show("To do, initialize range node highlighting in tree"); + // find rnage nodes to be highlighted & send it to tvTranRangeHilites to actually do the highlighting... + + } private void ClearRangeTransition() { if (_RangeNode1 == null && _RangeNode2 == null) return; diff --git a/PROMS/Volian.Controls.Library/TemporaryFormat.cs b/PROMS/Volian.Controls.Library/TemporaryFormat.cs index e88bcdee..18d6ebfd 100644 --- a/PROMS/Volian.Controls.Library/TemporaryFormat.cs +++ b/PROMS/Volian.Controls.Library/TemporaryFormat.cs @@ -62,20 +62,20 @@ namespace Volian.Controls.Library ") ", ") " }; - public static string TabFormat(DisplayItem myVlnCSLARTB) + public static string TabFormat(DisplayItem myDisplayItem) { string format = string.Empty; - if (myVlnCSLARTB.MyItem != null) + if (myDisplayItem.MyItem != null) { - int typ = (int)myVlnCSLARTB.MyItem.MyContent.Type; + int typ = (int)myDisplayItem.MyItem.MyContent.Type; if (typ >= 20000) { - if (myVlnCSLARTB.RNOLevel > 0 && IsRNO(myVlnCSLARTB.MyItem)) return ""; + if (myDisplayItem.RNOLevel > 0 && IsRNO(myDisplayItem.MyItem)) return ""; // Step 1: Get TabFormat from Format format = _TabFormats[typ % 10000]; if (format == "") { - format = SeqTabFormat[myVlnCSLARTB.SeqLevel % SeqTabFormat.Length]; + format = SeqTabFormat[myDisplayItem.SeqLevel % SeqTabFormat.Length]; } } }