From b1669a3a95f49afddb0c3c4c9fd2fd6a4346ffb4 Mon Sep 17 00:00:00 2001 From: Kathy Date: Tue, 5 May 2009 13:38:29 +0000 Subject: [PATCH] --- .../Volian.Controls.Library/StepTabRibbon.cs | 9 ++++----- .../StepTabRibbon.designer.cs | Bin 157372 -> 157364 bytes 2 files changed, 4 insertions(+), 5 deletions(-) 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 0a76f51bad4b45fc3ccafd52a1fa373002a503ac..a17918fca300c8ba3915bfeee5b1b739b6aa817c 100644 GIT binary patch delta 274 zcmdmUmUGKl&JA1~lN;`HOuiy$x7k2ajDPZj7@o~y99IOUe{f~wnVezjH93JpWBLOh zM!v}*242$*w3*l@%c&_$ZwO%&nrtCvH#tGcWV(YMBg=G$NJf^;=QPz6fClnR_VTg< zn#DKyiI>)N0e40P5M%NNeWB?WCNWBEe&(gX#b`A7;tlD^4nA_59YUuuZf?67z{Y4W z-O-a#8E696W|jvmY|NGn=93pb*4=FNEJO~>VN8iueZd4qvCU7sl(?qPQe(2(><~JQak7;c&-A<>j4G3kNNqMa zl-9KQT37(vl?fw|*U7c{ zNKb$oSSn_t$Yzht^Z2Ikabe<_?zf3iZL))g(DVtejBMK