B2018-014 - Shortcut Keys (Ctrl-Shft-T) doesn't add a table. Actually based upon the format (AcTable value) it should not be able to add a table on a single spaced substep (Equipment List). However it did not provide any feedback. The code has been changed to let the user know that the step type that they are on does not allow a table to be added. The code was fixed generically to handle the addition of Substeps, RNOs, Cautions, Notes, Figures and Equations.

This commit is contained in:
Rich 2018-02-23 20:36:46 +00:00
parent 7df2535d78
commit a7595775a3

View File

@ -3286,10 +3286,12 @@ namespace Volian.Controls.Library
break;
case "InsRNO":
displayMenu = ((actable & E_AccStep.AddingRNO) > 0) && btnCMInsRNO.Enabled;
LetUserKnowIfTheyCannotAdd(actable, E_AccStep.AddingRNO,"RNO"); // B2018-014 Inform user that they cannot add the specified step type
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsRNO);
break;
case "InsSubStps":
displayMenu = ((actable & E_AccStep.AddingSub) > 0) && btnCMInsSubStps.Enabled;
LetUserKnowIfTheyCannotAdd(actable, E_AccStep.AddingSub,"Sub-step"); // B2018-014 Inform user that they cannot add the specified step type
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsSubStps);
if (displayMenu) Cursor.Position = new Point(0, 0); // Enter Key hit, move mouse pointer out of way of context menu
foreach (DevComponents.DotNetBar.ButtonItem bi in btnCMInsSubStps.SubItems)
@ -3304,22 +3306,27 @@ namespace Volian.Controls.Library
break;
case "InsCaution":
displayMenu = ((actable & E_AccStep.AddingCaution) > 0) && btnCMInsCaution.Enabled;
LetUserKnowIfTheyCannotAdd(actable, E_AccStep.AddingCaution,"Caution"); // B2018-014 Inform user that they cannot add the specified step type
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsCaution);
break;
case "InsNote":
displayMenu = ((actable & E_AccStep.AddingNote) > 0) && btnCMInsNote.Enabled;
LetUserKnowIfTheyCannotAdd(actable, E_AccStep.AddingNote,"Note"); // B2018-014 Inform user that they cannot add the specified step type
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsNote);
break;
case "InsTable":
displayMenu = ((actable & E_AccStep.AddingTable) > 0) && btnCMInsTable.Enabled;
LetUserKnowIfTheyCannotAdd(actable, E_AccStep.AddingTable,"Table"); // B2018-014 Inform user that they cannot add the specified step type
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsTable);
break;
case "InsFigure":
displayMenu = ((actable & E_AccStep.AddingTable) > 0) && btnCMInsFigure.Enabled;
LetUserKnowIfTheyCannotAdd(actable, E_AccStep.AddingTable,"Figure"); // B2018-014 Inform user that they cannot add the specified step type
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsFigure);
break;
case "InsEquation":
displayMenu = ((actable & E_AccStep.AddingTable) > 0) && btnCMInsEquation.Enabled;
LetUserKnowIfTheyCannotAdd(actable, E_AccStep.AddingTable,"Equation"); // B2018-014 Inform user that they cannot add the specified step type
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsEquation);
break;
case "StepPaste":
@ -3340,7 +3347,13 @@ namespace Volian.Controls.Library
}
}
}
private void LetUserKnowIfTheyCannotAdd(E_AccStep? actable, E_AccStep e_AccStep, string stepType) // B2018-014 Inform user that they cannot add the specified step type
{
if ((actable & e_AccStep) > 0) return;
string msg = string.Format("Cannot add a {0} to this step type. If this is desired please contact Volian to change your format", stepType);
string cpt = string.Format("Cannot add {0}", stepType);
MessageBox.Show(msg, cpt, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void btnSpell_Click(object sender, EventArgs e)
{
//MessageBox.Show("Functionality not available.", "Spell Check");