From d27eb9a2b29af848bdb2bc7f0d7eae17ec02b301 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 18 Sep 2017 13:57:05 +0000 Subject: [PATCH] B2017-208 The Bold, Italics, Underline buttons were staying checked when applying to a multiple cell selection, even when you selected a different table cell. . This would be true if you move off the table then back on it, but would not be true if you exited PROMS then got back in. B2017-200 Newly entered text in a table cell will now be saved when the Copy Row, Column, or Selection is performed. Prior to this, if a table cell was actively being edited (still had the dark blue background), the new text would not be save before the copy/paste of a table row, column, or selection was performed. --- .../Volian.Controls.Library/StepTabRibbon.cs | 37 +++++++++++++----- .../StepTabRibbon.designer.cs | Bin 543056 -> 543060 bytes PROMS/Volian.Controls.Library/VlnFlexGrid.cs | 3 ++ 3 files changed, 30 insertions(+), 10 deletions(-) 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 709233c5885e19f7b6636f5c4d6d4e45fde500ab..66fb582bc7c866a601ed7a9350ae0d6f8624a098 100644 GIT binary patch delta 142 zcmcaGN%6`g#fBEf7N!>FEi8Fq)9XT6c&6VoXEd8GV9z2ky}<*>{TI%{wf#;Q%Lx`R zbNVw|p!9)cp!B-GY+BPDVp*ix9b#C3n032D4BL!(NTxWPV&j>7VXxSBtKV!gOmO`c Y(-)j!=0h1s#F8}}l delta 120 zcmcaIN%6uY#fBEf7N!>FEi8Fq)0>=GBBm>ZvxsfK7shgeWxAgltIu?SI2NAvf6**J z%)0$wG~1nd(~EAf`AojBS8Ti8Z#EgG>HluA0hJwQt<8 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();