diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 7c9f9bd7..1a74b713 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -1460,11 +1460,14 @@ namespace Volian.Controls.Library if (_MyStepRTB.SelectionFont != null) { - btnCMBold.Checked = btnBold.Checked = RTBAPI.IsBold(_MyStepRTB); - btnCMItalics.Checked = btnItalics.Checked = RTBAPI.IsItalic(_MyStepRTB); - btnCMUnderline.Checked = btnUnderline.Checked = RTBAPI.IsUnderline(_MyStepRTB); - btnCMSubscript.Checked = btnSubscript.Checked = RTBAPI.IsSubScript(_MyStepRTB); - btnCMSuperscript.Checked = btnSuperscript.Checked = RTBAPI.IsSuperScript(_MyStepRTB); + // B2017-208 added (MyFlexGrid == null || MyFlexGrid.TableCellEditor.EditMode) + // toggle on/off attributes button checks when you edit table cells, going from one cell to another + // Also don't keep the attributes buttons checked after setting a group of table cells all at one time + btnCMBold.Checked = btnBold.Checked = RTBAPI.IsBold(_MyStepRTB) && (MyFlexGrid == null || MyFlexGrid.TableCellEditor.EditMode); + btnCMItalics.Checked = btnItalics.Checked = RTBAPI.IsItalic(_MyStepRTB) && (MyFlexGrid == null || MyFlexGrid.TableCellEditor.EditMode); + btnCMUnderline.Checked = btnUnderline.Checked = RTBAPI.IsUnderline(_MyStepRTB) && (MyFlexGrid == null || MyFlexGrid.TableCellEditor.EditMode); + btnCMSubscript.Checked = btnSubscript.Checked = RTBAPI.IsSubScript(_MyStepRTB) && (MyFlexGrid == null || MyFlexGrid.TableCellEditor.EditMode); + btnCMSuperscript.Checked = btnSuperscript.Checked = RTBAPI.IsSuperScript(_MyStepRTB) && (MyFlexGrid == null || MyFlexGrid.TableCellEditor.EditMode); } SetButtonForStyle(); @@ -2614,12 +2617,16 @@ namespace Volian.Controls.Library private void btnBold_Click(object sender, EventArgs e) { ApplyStyleToCurrentStepOrGridSelection(SelectionOption.All,ToggleBold); - btnCMBold.Checked = btnBold.Checked = RTBAPI.IsBold(_MyStepRTB); + // B2017-208 toggle on/off attributes button checks when you edit table cells, going from one cell to another + // Also don't keep the attributes buttons checked after setting a group of table cells all at one time + btnCMBold.Checked = btnBold.Checked = RTBAPI.IsBold(_MyStepRTB) && (MyFlexGrid == null || MyFlexGrid.TableCellEditor.EditMode); } private void btnItalics_Click(object sender, EventArgs e) { ApplyStyleToCurrentStepOrGridSelection(SelectionOption.All,ToggleItalic); - btnCMItalics.Checked = btnItalics.Checked = RTBAPI.IsItalic(_MyStepRTB); + // B2017-208 toggle on/off attributes button checks when you edit table cells, going from one cell to another + // Also don't keep the attributes buttons checked after setting a group of table cells all at one time + btnCMItalics.Checked = btnItalics.Checked = RTBAPI.IsItalic(_MyStepRTB) && (MyFlexGrid == null || MyFlexGrid.TableCellEditor.EditMode); } private void ToggleItalic() @@ -2629,7 +2636,9 @@ namespace Volian.Controls.Library private void btnUnderline_Click(object sender, EventArgs e) { ApplyStyleToCurrentStepOrGridSelection(SelectionOption.All, ToggleUnderline); - btnCMUnderline.Checked = btnUnderline.Checked = RTBAPI.IsUnderline(_MyStepRTB); + // B2017-208 toggle on/off attributes button checks when you edit table cells, going from one cell to another + // Also don't keep the attributes buttons checked after setting a group of table cells all at one time + btnCMUnderline.Checked = btnUnderline.Checked = RTBAPI.IsUnderline(_MyStepRTB) && (MyFlexGrid == null || MyFlexGrid.TableCellEditor.EditMode); } private void ToggleUnderline() @@ -3824,12 +3833,12 @@ namespace Volian.Controls.Library MyFlexGrid.InsertRowAfter(); } - private void btnTblDgnInsertColumnAbove_Click(object sender, EventArgs e) + private void btnTblDgnInsertColumnBefore_Click(object sender, EventArgs e) { MyFlexGrid.InsertColumnBefore(); } - private void btnTblDgnInsertColumnBelow_Click(object sender, EventArgs e) + private void btnTblDgnInsertColumnAfter_Click(object sender, EventArgs e) { MyFlexGrid.InsertColumnAfter(); } @@ -3880,6 +3889,14 @@ namespace Volian.Controls.Library // set to true if editing cell, otherwise false for grids //bool enable = (MyFlexGrid != null && MyFlexGrid.Editor != null); + // B2017-208 toggle on/off attributes button checks when you edit table cells, going from one cell to another + // Also don't keep the attributes buttons checked after setting a group of table cells all at one time + btnCMBold.Checked = btnBold.Checked = RTBAPI.IsBold(_MyStepRTB) && (MyFlexGrid == null || MyFlexGrid.TableCellEditor.EditMode); + btnCMItalics.Checked = btnItalics.Checked = RTBAPI.IsItalic(_MyStepRTB) && (MyFlexGrid == null || MyFlexGrid.TableCellEditor.EditMode); + btnCMUnderline.Checked = btnUnderline.Checked = RTBAPI.IsUnderline(_MyStepRTB) && (MyFlexGrid == null || MyFlexGrid.TableCellEditor.EditMode); + btnCMSubscript.Checked = btnSubscript.Checked = RTBAPI.IsSubScript(_MyStepRTB) && (MyFlexGrid == null || MyFlexGrid.TableCellEditor.EditMode); + btnCMSuperscript.Checked = btnSuperscript.Checked = RTBAPI.IsSuperScript(_MyStepRTB) && (MyFlexGrid == null || MyFlexGrid.TableCellEditor.EditMode); + bool enable = (MyFlexGrid != null && MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit); //btnPasteText.Enabled = btnPasteStepText.Enabled = btnPaste.Enabled = enable; btnPaste.Enabled = (iData.GetDataPresent(DataFormats.Text) || iData.GetDataPresent(DataFormats.Rtf)) && enable; diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs index 709233c5..66fb582b 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/VlnFlexGrid.cs b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs index b9206ed8..c3f8e8a8 100644 --- a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs +++ b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs @@ -3132,6 +3132,7 @@ namespace Volian.Controls.Library public void CopyRow() { + _tableCellEditor.Hide(); // B2017-200 force save of changes from active edit session DialogResult dr = DialogResult.Yes; SelectRow(); if (Selection.r1 != Selection.r2) @@ -3145,6 +3146,7 @@ namespace Volian.Controls.Library public void CopyColumn() { + _tableCellEditor.Hide(); // B2017-200 force save of changes from active edit session SelectCol(); DialogResult dr = DialogResult.Yes; if (Selection.c1 != Selection.c2) @@ -3158,6 +3160,7 @@ namespace Volian.Controls.Library public void CopyCellSelection() { + _tableCellEditor.Hide(); // B2017-200 force save of changes from active edit session DialogResult dr = DialogResult.Yes; CellRange cr = Selection; MakeSelectionEven();