diff --git a/PROMS/Volian.Controls.Library/DisplayTransition.cs b/PROMS/Volian.Controls.Library/DisplayTransition.cs index d1375932..917a2948 100644 --- a/PROMS/Volian.Controls.Library/DisplayTransition.cs +++ b/PROMS/Volian.Controls.Library/DisplayTransition.cs @@ -402,7 +402,6 @@ namespace Volian.Controls.Library 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 (_CurTrans == null) @@ -783,6 +782,8 @@ namespace Volian.Controls.Library return; } toItem = (ItemInfo)_RangeNode1.VEObject; + + if (_RangeNode2 == null && tvTran.SelectedNode == null) // If this is Transition type 2, then make 'rangenode2' same as rangenode1 // This will get resolved when transition text is resolved. This case represents // range from rangenode1 to last sibling. Otherwise, get the second item in the @@ -801,6 +802,22 @@ namespace Volian.Controls.Library if (_RangeNode2 == null) _RangeNode2 = (VETreeNode)tvTran.SelectedNode; rangeItem = (ItemInfo)_RangeNode2.VEObject; } + if (_RangeNode2 == null) _RangeNode2 = (VETreeNode)tvTran.SelectedNode; + rangeItem = (ItemInfo)_RangeNode2.VEObject; + // If this is Transition type 2, then make 'rangenode2' same as rangenode1 + // This will get resolved when transition text is resolved. This case represents + // range from rangenode1 to last sibling. Otherwise, get the second item in the + // range, based on current tree view selection. + if (listBoxTranFmt.SelectedIndex == 2) + { + // if type 2 and not a HLS and the range is within the same hls, them set + // to and range to be equal. When text gets resolved, this case generates + // a list represent the toid,,,lastsibling. + if (!toItem.IsHigh && toItem.MyHLS.ItemID == rangeItem.MyHLS.ItemID) + rangeItem = toItem; + else + rangeItem = rangeItem.MyHLS; + } // Check that the two items are of the below the section type. if (toItem.MyContent.Type < 20000 || rangeItem.MyContent.Type < 20000) { @@ -847,7 +864,7 @@ namespace Volian.Controls.Library // Can I build the text right now? trantxt = TransitionText.GetResolvedText(_MyRTB.MyItemInfo, listBoxTranFmt.SelectedIndex,toItem,rangeItem ?? toItem); _MyRTB.InsertTran(trantxt, linktxt); - _MyRTB.Select(_MyRTB.SelectionStart + trantxt.Length + linktxt.Length,0); + _MyRTB.Select(_MyRTB.SelectionStart + trantxt.Length + linktxt.Length, 0); _MyRTB.SaveText(); _MyRTB.Focus(); }