diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 3a001ce9..a9fa6043 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -37,7 +37,8 @@ namespace Volian.Controls.Library { //Console.WriteLine(string.Format("StepTabRibbon: In set of MyStepRTB, Selected Text = {0}", MyStepRTB.SelectedText)); _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit); - _MyStepRTB.KeyDown += new KeyEventHandler(MyStepRTB_SelectionChanged); + //_MyStepRTB.KeyDown += new KeyEventHandler(MyStepRTB_SelectionChanged); + _MyStepRTB.KeyUp += new KeyEventHandler(MyStepRTB_SelectionChanged); _MyStepRTB.MouseUp += new MouseEventHandler(MyStepRTB_SelectionChanged); _MyStepRTB.Leave += new EventHandler(MyStepRTB_Leave); _MyStepRTB.LinkChanged += new StepRTBLinkEvent(_MyStepRTB_LinkChanged); @@ -64,7 +65,7 @@ namespace Volian.Controls.Library // to name button use unicode rather than desc, desc may have spaces or odd chars btn.Name = "btn" + sym.Unicode.ToString(); btn.Tooltip = sym.Desc; - btn.Tag = string.Format(@"\u{0}", sym.Unicode); + btn.Tag = string.Format(@"{0}", sym.Unicode); btn.FontBold = true; btn.Click += new System.EventHandler(btnSym_Click); galleryContainerSymbols.SubItems.Add(btn); @@ -73,7 +74,7 @@ namespace Volian.Controls.Library // to name button use unicode rather than desc, desc may have spaces or odd chars btnCM.Name = "btnCM" + sym.Unicode.ToString(); btnCM.Tooltip = sym.Desc; - btnCM.Tag = string.Format(@"\u{0}", sym.Unicode); + btnCM.Tag = string.Format(@"{0}", sym.Unicode); btnCM.FontBold = true; btnCM.Click += new System.EventHandler(btnSym_Click); galleryContainerSymbolsCM.SubItems.Add(btnCM); @@ -221,6 +222,9 @@ namespace Volian.Controls.Library btnChgTyp.Enabled = false; btnInsHLS.Enabled = btnInsCaut.Enabled = btnInsNote.Enabled = btnInsRNO.Enabled = btnInsFig.Enabled = btnInsTable.Enabled = btnInsSubstep.Enabled = btnInsBefore.Enabled = btnInsAfter.Enabled = false; + // if on a procedure or section title, don't allow for insert of ROs or Transitions: + // disable buttons. Info panels for ROs and Transitions are made invisible in frmVEPROMS.cs + btnInsTrans.Enabled = btnCMTransition.Enabled = btnInsRO.Enabled = btnCMRO.Enabled = false; return; } @@ -260,6 +264,8 @@ namespace Volian.Controls.Library if (btnInsFig.Enabled) GalleryForSubTypes(_MyStepItem.MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Fig, sd, btnInsFig, (int)E_FromType.Table); if (btnInsTable.Enabled) GalleryForSubTypes(_MyStepItem.MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Table, sd, btnInsTable, (int)E_FromType.Table); if (btnInsSubstep.Enabled) GalleryForSubTypes(_MyStepItem.MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Substep, sd, btnInsSubstep, (int)E_FromType.Step); + + btnInsTrans.Enabled = btnCMTransition.Enabled = btnInsRO.Enabled = btnCMRO.Enabled = true; } /// /// set up a gallery of step types whose parent are defined by input StepData. Can be below @@ -324,7 +330,7 @@ namespace Volian.Controls.Library private void btnSym_Click(object sender, EventArgs e) { DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender; - _MyStepRTB.InsertSymbol((string)b.Tag); + _MyStepRTB.InsertSymbol(Convert.ToInt32(b.Tag)); } private void btnInsPgBrk_Click(object sender, EventArgs e) { @@ -335,6 +341,14 @@ namespace Volian.Controls.Library cfg.Step_ManualPagebreak = !cfg.Step_ManualPagebreak; btnInsPgBrk.Checked = cfg.Step_ManualPagebreak; } + private void btnIndent_Click(object sender, EventArgs e) + { + _MyStepRTB.InsertIndent(); + } + private void btnCMIndent_Click(object sender, EventArgs e) + { + _MyStepRTB.InsertIndent(); + } #endregion #region Home Tab private void btnPaste_Click(object sender, EventArgs e) @@ -344,6 +358,7 @@ namespace Volian.Controls.Library _MyStepRTB.SelectedRtf = myDO.GetData(DataFormats.Rtf).ToString(); else if (myDO.GetDataPresent(DataFormats.Text)) _MyStepRTB.SelectedText = myDO.GetData(DataFormats.Text).ToString(); + if (_MyStepRTB.SelectionLength == 0) _MyStepRTB.SelectionFont = _MyStepRTB.MyStyleFont.WindowsFont; } private void btnCut_Click(object sender, EventArgs e) { @@ -424,11 +439,24 @@ namespace Volian.Controls.Library private void btnRedo_Click(object sender, EventArgs e) { _MyStepRTB.Redo(); + btnCMUndo.Enabled = btnUndo.Enabled = _MyStepRTB.CanUndo; + btnCMRedo.Enabled = btnRedo.Enabled = _MyStepRTB.CanRedo; } private void btnUndo_Click(object sender, EventArgs e) { _MyStepRTB.Undo(); + if (_MyStepRTB.WasXDelete && (_MyStepRTB.Text[_MyStepRTB.SelectionStart - 1] == 'X')) + { + _MyStepRTB.Undo(); + _MyStepRTB.WasXDelete = false; + + // only allow one of these - not best case, but at least can get + // one undo + _MyStepRTB.ClearUndo(); + } + btnCMRedo.Enabled = btnRedo.Enabled = _MyStepRTB.CanRedo; + btnCMUndo.Enabled = btnUndo.Enabled = _MyStepRTB.CanUndo; } private void btnGoTo_Click(object sender, EventArgs e) { @@ -487,6 +515,14 @@ namespace Volian.Controls.Library foreach (StepItem itm in list) OutputAllChildren(itm); } + + private void btnCMToggle_Click(object sender, EventArgs e) + { + MyStepRTB.ToggleViewEdit(); + } + + + #endif #endregion } diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs index a17918fc..5d9a8e11 100644 Binary files a/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs and b/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs differ diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.resx b/PROMS/Volian.Controls.Library/StepTabRibbon.resx index e9190492..994c06ba 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.resx +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.resx @@ -118,6 +118,15 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAScQAA + EnEB89x6jgAAAIBJREFUOE/FU9ESgCAIy///aAMU0DDYSxecV6KOObB1squRs3VyNY1Z4OWHATYTFHI1 + gp0RXdm+vlGoLC5zPowCHDeiAGkmhMHnAEFpDwwRjcFKV++/6xyLVgEk2UfhnuVTNsVBa5Njk8xV6c1k + hNwGBmaHAP5n4G8q6gFdoZLjBpE7j5KJdaRlAAAAAElFTkSuQmCC + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 @@ -128,15 +137,6 @@ t0ekztKvaA7ibixOyvoLADqYiGMXHIUWy7uQa+cSuZGUDb7FswWYwclx9oES/hqzGAmV1UTdSPiQ8Uqw DCdiNtgFHwAtVpjbIvESaA4ZqUrP2xELFPEBUMwlqmH7iDiNNQAph2DskIMaIF16YfCVIoZOmtyveQF9 2CVVWYKhQwAAAABJRU5ErkJggg== - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAScQAA - EnEB89x6jgAAAIBJREFUOE/FU9ESgCAIy///aAMU0DDYSxecV6KOObB1squRs3VyNY1Z4OWHATYTFHI1 - gp0RXdm+vlGoLC5zPowCHDeiAGkmhMHnAEFpDwwRjcFKV++/6xyLVgEk2UfhnuVTNsVBa5Njk8xV6c1k - hNwGBmaHAP5n4G8q6gFdoZLjBpE7j5KJdaRlAAAAAElFTkSuQmCC