From ecff8237a2992e3df98fae785be681aeeaaf5e15 Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 4 Dec 2009 14:16:40 +0000 Subject: [PATCH] --- .../DisplayTransition.cs | 23 ++++++++++++++++++- PROMS/Volian.Controls.Library/LinkText.cs | 5 ++-- PROMS/Volian.Controls.Library/StepRTB.cs | 6 +++++ 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayTransition.cs b/PROMS/Volian.Controls.Library/DisplayTransition.cs index b6e54a79..3a1ace07 100644 --- a/PROMS/Volian.Controls.Library/DisplayTransition.cs +++ b/PROMS/Volian.Controls.Library/DisplayTransition.cs @@ -657,7 +657,9 @@ namespace Volian.Controls.Library private void tvTran_BeforeExpand(object sender, TreeViewCancelEventArgs e) { VETreeNode tn = ((VETreeNode)e.Node); - tn.LoadChildren(false); + // true fixes empty expand, but allows for transitions 'way down' in RNO tree. HVJ & PAL wanted to + // allow this (12/2/09) + tn.LoadChildren(true); } private void cbTranSects_SelectedIndexChanged(object sender, EventArgs e) { @@ -703,6 +705,25 @@ namespace Volian.Controls.Library private void tvTran_AfterSelect(object sender, TreeViewEventArgs e) { if (_InitializingTrans) return; + // check if node is a true end-point, i.e. not a 'part' node. If part node, don't + // allow selection. + bool allowSave = false; + VETreeNode vt = tvTran.SelectedNode as VETreeNode; + if (vt != null) + { + ItemInfo ii = vt.VEObject as ItemInfo; + if (ii != null) allowSave = true; + } + if (!_DoingRange) + { + btnTranSave.Enabled = allowSave; + return; + } + if (!allowSave) + { + MessageBox.Show("Must select a valid step, not a grouping part such as 'RNO', 'Steps', etc"); + return; + } if (_DoingRange) { if (_RangeNode1 == null || (_RangeNode1 != null && _RangeNode2 != null)) diff --git a/PROMS/Volian.Controls.Library/LinkText.cs b/PROMS/Volian.Controls.Library/LinkText.cs index a168a31f..a9edbe47 100644 --- a/PROMS/Volian.Controls.Library/LinkText.cs +++ b/PROMS/Volian.Controls.Library/LinkText.cs @@ -26,7 +26,7 @@ namespace VEPROMS.CSLA.Library case "ReferencedObject": _MyParsedLinkType = ParsedLinkType.ReferencedObject; string[] subs = m.Groups[3].Value.Split(" ".ToCharArray()); - if (subs[0] == "") + if (subs[0].IndexOf("CROUSGID")>-1) _MyRoUsageInfo = null; else { @@ -37,7 +37,8 @@ namespace VEPROMS.CSLA.Library case "Transition": case "TransitionRange": _MyParsedLinkType = (ParsedLinkType)Enum.Parse(_MyParsedLinkType.GetType(), m.Groups[2].Value); - if (m.Groups[3].Value.Split(" ".ToCharArray())[1] == "") + string[] subst = m.Groups[3].Value.Split(" ".ToCharArray()); + if (subst[0].IndexOf("CTID") > -1) _MyTransitionInfo = null; else { diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index ce839cc1..094bd06b 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -168,6 +168,12 @@ namespace Volian.Controls.Library _SelectedRtfSB.Remove(0, _SelectedRtfSB.Length); DisplayText vlntxt = new DisplayText(_MyItemInfo, EpMode, VwMode, !edit, FieldToEdit); + if (_origDisplayText != null && vlntxt.StartText == _origDisplayText.StartText) + { + ReadOnly = !(EpMode == E_EditPrintMode.Edit && VwMode == E_ViewMode.Edit); + if (!ReadOnly && !edit) ReadOnly = true; + return; + } _origDisplayText = vlntxt; #if(DEBUG) // Use Times New Roman for Debugging