diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index d10b2917..8ce3f491 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -37,7 +37,7 @@ namespace Volian.Controls.Library { //Console.WriteLine(string.Format("StepTabRibbon: In set of MyStepRTB, Selected Text = {0}", MyStepRTB.SelectedText)); _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit); - //_MyStepRTB.SelectionChanged += new EventHandler(MyStepRTB_SelectionChanged); + _MyStepRTB.KeyDown += new KeyEventHandler(MyStepRTB_SelectionChanged); _MyStepRTB.MouseUp += new MouseEventHandler(MyStepRTB_SelectionChanged); _MyStepRTB.Leave += new EventHandler(MyStepRTB_Leave); _MyStepRTB.LinkChanged += new StepRTBLinkEvent(_MyStepRTB_LinkChanged); @@ -96,7 +96,7 @@ namespace Volian.Controls.Library void _MyStepRTB_LinkChanged(object sender, StepPanelLinkEventArgs args) { // do all Transition and ReferencedObject menu items/buttons based on whether a 'link is selected' and the link type. - btnCMGoTo.Enabled = btnGoTo.Enabled = _MyStepRTB.SelectionProtected; + btnCMGoTo.Enabled = btnGoTo.Enabled = _MyStepRTB.IsSelectionLinked(_MyStepRTB.SelectionStart, _MyStepRTB.SelectionLength); if (btnCMGoTo.Enabled == true && _MyStepRTB.MyLinkText != null) // must have some link test, use it to set edit of transition or ro... { btnCMEditTran.Enabled = _MyStepRTB.MyLinkText.IndexOf("Transition") > -1; // selected link must be a transition @@ -110,7 +110,6 @@ namespace Volian.Controls.Library } void MyStepRTB_Leave(object sender, EventArgs e) { - //_MyStepRTB.SelectionChanged -= new EventHandler(MyStepRTB_SelectionChanged); _MyStepRTB.MouseUp -= new MouseEventHandler(MyStepRTB_SelectionChanged); _MyStepRTB.Leave -= new EventHandler(MyStepRTB_Leave); _MyStepRTB.LinkChanged -= new StepRTBLinkEvent(_MyStepRTB_LinkChanged); @@ -174,7 +173,7 @@ namespace Volian.Controls.Library } //if (_MyStepItem.MyItemInfo.MyContent.Type == 20006 || _MyStepItem.MyItemInfo.MyContent.Type == 20007) // Console.WriteLine("debug"); - //SetButtonForStyle(); + SetButtonForStyle(); btnCMCut.Enabled = btnCMCopy.Enabled = btnCut.Enabled = btnCopy.Enabled = _MyStepRTB.SelectionLength > 0; btnCMUndo.Enabled = btnUndo.Enabled = _MyStepRTB.CanUndo; btnCMRedo.Enabled = btnRedo.Enabled = _MyStepRTB.CanRedo; @@ -184,7 +183,7 @@ namespace Volian.Controls.Library btnCMPaste.Enabled = btnPaste.Enabled = (iData.GetDataPresent(DataFormats.Text) || iData.GetDataPresent(DataFormats.Rtf)); // do all Transition and ReferencedObject menu items/buttons based on whether a 'link is selected' and the link type. - btnCMGoTo.Enabled = btnGoTo.Enabled = _MyStepRTB.SelectionProtected; //(_MyStepRTB.MyLinkText != null); + btnCMGoTo.Enabled = btnGoTo.Enabled = _MyStepRTB.IsSelectionLinked(_MyStepRTB.SelectionStart, _MyStepRTB.SelectionLength); //(_MyStepRTB.MyLinkText != null); if (btnCMGoTo.Enabled == true && _MyStepRTB.MyLinkText != null) // must have some link test, use it to set edit of transition or ro... { btnCMEditTran.Enabled = _MyStepRTB.MyLinkText.IndexOf("Transition")>-1; // selected link must be a transition diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs index 0a76f51b..a17918fc 100644 Binary files a/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs and b/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs differ