diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 383918b6..3a001ce9 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -145,7 +145,7 @@ namespace Volian.Controls.Library StepItem hlsStepItem = _MyStepItem; while (!hlsStepItem.MyItemInfo.IsHigh) hlsStepItem = hlsStepItem.ActiveParent; - hlsStepItem.AddSiblingAfter(); // (contenttype); + hlsStepItem.AddSiblingAfter((int ?)contenttype); } else { @@ -166,9 +166,9 @@ namespace Volian.Controls.Library /// private void SetButtonForStyle() { - btnBold.Enabled = !((_MyStepRTB.MyStyleFont.Style & E_Style.Bold) == E_Style.Bold || (_MyStepRTB.MyStyleFont.Style & E_Style.MmBold) == E_Style.MmBold); - btnUnderline.Enabled = !((_MyStepRTB.MyStyleFont.Style & E_Style.Underline) == E_Style.Underline); - btnItalics.Enabled = !((_MyStepRTB.MyStyleFont.Style & E_Style.Italics) == E_Style.Italics); + btnBold.Enabled = btnCMBold.Enabled = (!((_MyStepRTB.MyStyleFont.Style & E_Style.Bold) == E_Style.Bold || (_MyStepRTB.MyStyleFont.Style & E_Style.MmBold) == E_Style.MmBold)); + btnUnderline.Enabled = btnCMUnderline.Enabled = (!((_MyStepRTB.MyStyleFont.Style & E_Style.Underline) == E_Style.Underline)); + btnItalics.Enabled = btnCMItalics.Enabled = (!((_MyStepRTB.MyStyleFont.Style & E_Style.Italics) == E_Style.Italics)); } private void SetButtonAndMenuEnabling() { @@ -181,9 +181,8 @@ namespace Volian.Controls.Library btnCMSubscript.Checked = btnSubscript.Checked = RTBAPI.IsSubScript(_MyStepRTB); btnCMSuperscript.Checked = btnSuperscript.Checked = RTBAPI.IsSuperScript(_MyStepRTB); } - //if (_MyStepItem.MyItemInfo.MyContent.Type == 20006 || _MyStepItem.MyItemInfo.MyContent.Type == 20007) - // Console.WriteLine("debug"); SetButtonForStyle(); + btnCMCut.Enabled = btnCMCopy.Enabled = btnCut.Enabled = btnCopy.Enabled = _MyStepRTB.SelectionLength > 0; btnCMUndo.Enabled = btnUndo.Enabled = _MyStepRTB.CanUndo; btnCMRedo.Enabled = btnRedo.Enabled = _MyStepRTB.CanRedo; @@ -191,7 +190,8 @@ namespace Volian.Controls.Library // for paste, see if there is clipboard data, & if so, of a type we can use. IDataObject iData = Clipboard.GetDataObject(); 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.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...