changeset 6545:16300af5f9f5

RT0-35880: HelloSanity: Menu does not handle accelerator keys correctly Bug was in HelloSanity, not the mnemonic / accelerator code.
author jgiles
date Tue, 18 Mar 2014 14:57:58 +1300
parents 2f2379857779
children 35858482e928
files apps/toys/Hello/src/main/java/hello/TestBuilder.java
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/apps/toys/Hello/src/main/java/hello/TestBuilder.java	Tue Mar 18 14:17:09 2014 +1300
+++ b/apps/toys/Hello/src/main/java/hello/TestBuilder.java	Tue Mar 18 14:57:58 2014 +1300
@@ -393,13 +393,13 @@
         menu23.setDisable(true);
         // menu separator
         MenuItem menu24 = new MenuItem("Copy");
-        menu24.setAccelerator(KeyCombination.keyCombination("shortcut=C"));
+        menu24.setAccelerator(KeyCombination.keyCombination("shortcut+C"));
         menu24.setOnAction(actionHandler);
         MenuItem menu25 = new MenuItem("Paste");
         menu25.setAccelerator(KeyCombination.keyCombination("shortcut+V"));
         menu25.setOnAction(actionHandler);
         MenuItem menu26 = new MenuItem("Delete");
-        menu26.setAccelerator(KeyCombination.keyCombination("Alt+D"));
+        menu26.setAccelerator(KeyCombination.keyCombination("shortcut+D"));
         MenuItem menu27 = new MenuItem("Help");
         menu27.setAccelerator(new KeyCodeCombination(KeyCode.F1));
         menu27.setOnAction(actionHandler);
@@ -732,10 +732,10 @@
 
     private Menu makeMenu(String text, Node graphic) {
         Menu menu = new Menu(text, graphic);
-        menu.setOnShowing(showHideHandler);
-        menu.setOnShown(showHideHandler);
-        menu.setOnHiding(showHideHandler);
-        menu.setOnHidden(showHideHandler);
+//        menu.setOnShowing(showHideHandler);
+//        menu.setOnShown(showHideHandler);
+//        menu.setOnHiding(showHideHandler);
+//        menu.setOnHidden(showHideHandler);
         return menu;
     }