bug fix for B2011-070, the mouse and the enter key

This commit is contained in:
John Jenko 2011-06-22 14:00:00 +00:00
parent 87d3a95327
commit 85d4b1fafa

View File

@ -1451,6 +1451,8 @@ namespace Volian.Controls.Library
public void SetShortCutContextMenu(string menuName) public void SetShortCutContextMenu(string menuName)
{ {
bool displayMenu = false; bool displayMenu = false;
int moveDown = 0;
int cnt = 0;
E_AccStep? actable = 0; E_AccStep? actable = 0;
if (menuName.Contains("PSI")) Console.WriteLine("menu = {0}", menuName); if (menuName.Contains("PSI")) Console.WriteLine("menu = {0}", menuName);
@ -1469,7 +1471,14 @@ namespace Volian.Controls.Library
break; break;
case "InsHLS": case "InsHLS":
displayMenu = true; displayMenu = true;
Cursor.Position = new Point(0, 0); // Enter Key hit, move mouse pointer out of way of context menu
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsHLS); _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsHLS);
foreach (DevComponents.DotNetBar.ButtonItem bi in btnCMInsHLS.SubItems)
{
if (bi.Checked)
moveDown = cnt;
cnt++;
}
break; break;
case "InsRNO": case "InsRNO":
displayMenu = (actable & E_AccStep.AddingRNO) > 0; displayMenu = (actable & E_AccStep.AddingRNO) > 0;
@ -1478,6 +1487,13 @@ namespace Volian.Controls.Library
case "InsSubStps": case "InsSubStps":
displayMenu = (actable & E_AccStep.AddingSub) > 0; displayMenu = (actable & E_AccStep.AddingSub) > 0;
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsSubStps); _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)
{
if (bi.Checked)
moveDown = cnt;
cnt++;
}
break; break;
case "InsCaution": case "InsCaution":
displayMenu = (actable & E_AccStep.AddingCaution) > 0; displayMenu = (actable & E_AccStep.AddingCaution) > 0;
@ -1506,6 +1522,11 @@ namespace Volian.Controls.Library
if (displayMenu) if (displayMenu)
{ {
SendKeys.Send("+{F10}{DOWN}"); // Display Context menu SendKeys.Send("+{F10}{DOWN}"); // Display Context menu
while (moveDown > 0) // position to current type
{
SendKeys.Send("{DOWN}");
moveDown--;
}
} }
} }