smoothed out Enter Key logic, show menus only if they contain more than one item.

This commit is contained in:
2009-12-14 15:45:21 +00:00
parent 5e6c39ed26
commit ef638a804b
3 changed files with 34 additions and 16 deletions

View File

@@ -983,7 +983,7 @@ namespace Volian.Controls.Library
ShortCutContextMenu("InsSubStps");
}
else if (!deletedHLS)
ShortCutContextMenu("InsRNO"); // create a new RNO
CreateNewRNO();
}
}
else if (MyItemInfo.IsRNO)
@@ -1007,7 +1007,7 @@ namespace Volian.Controls.Library
if (deletedEmpty)
{
MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlLeft);
ShortCutContextMenu("InsRNO"); // create a new RNO
CreateNewRNO();
}
else
InsertSiblingBeforeOrAfter("after");
@@ -1024,7 +1024,7 @@ namespace Volian.Controls.Library
else if (MyStepItem.MyRNOStepItems != null && MyStepItem.MyRNOStepItems.Count > 0)
MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlRight); // jump to RNO
else
ShortCutContextMenu("InsRNO"); // create a new RNO
CreateNewRNO();
}
else if (MyItemInfo.IsCaution)
{
@@ -1032,7 +1032,7 @@ namespace Volian.Controls.Library
{
MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlDown);
if (deletedCaution)
ShortCutContextMenu("InsNote");
CreateNewNote();
}
else
InsertSiblingBeforeOrAfter("after");
@@ -1054,6 +1054,21 @@ namespace Volian.Controls.Library
}
}
private void CreateNewRNO()
{
if (btnInsRNO.SubItems.Count > 1)
ShortCutContextMenu("InsRNO");
else
btnInsRNO.RaiseClick();
}
private void CreateNewNote()
{
if (btnInsNote.SubItems.Count > 1)
ShortCutContextMenu("InsNote");
else
btnInsNote.RaiseClick();
}
}
public enum E_FieldToEdit { StepText, Text, Number };