From 61d2aa1a7775245e0c80b5159899cb7f5bab757e Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 19 Dec 2005 17:45:55 +0000 Subject: [PATCH] menu shortcuts remain in effect when a menu is disabled svn: r1648 original commit: ee7684dd9fa05ccf7542310a0f5b074c9fb4e7a4 --- collects/framework/private/keymap.ss | 5 ----- collects/mred/private/mrmenu.ss | 5 +++-- collects/mred/private/wxmenu.ss | 5 ----- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/collects/framework/private/keymap.ss b/collects/framework/private/keymap.ss index 36ac3313..2e912ccb 100644 --- a/collects/framework/private/keymap.ss +++ b/collects/framework/private/keymap.ss @@ -990,11 +990,6 @@ (map "c:x;c:g" "ring-bell") (map "c:c;c:g" "ring-bell") - ;; This mapping is here to avoid having ctl-z insert "z" - ;; when the "Undo" menu item is disabled, because inserting - ;; "z" empties the redo stack - (map "c:z" "ring-bell") - (map-meta "(" "insert-()-pair") (map-meta "[" "insert-[]-pair") (map-meta "{" "insert-{}-pair") diff --git a/collects/mred/private/mrmenu.ss b/collects/mred/private/mrmenu.ss index d271f2f0..547e43fb 100644 --- a/collects/mred/private/mrmenu.ss +++ b/collects/mred/private/mrmenu.ss @@ -222,8 +222,9 @@ (send keymap add-function "menu-item" ;; keymap function callback already in exit mode: (lambda (edit event) - (when (is-enabled?) - (callback this (make-object wx:control-event% 'menu))))) + (if (is-enabled?) + (callback this (make-object wx:control-event% 'menu)) + (wx:bell)))) (send keymap map-function key-binding "menu-item") keymap))]) (values new-label keymap)))]) diff --git a/collects/mred/private/wxmenu.ss b/collects/mred/private/wxmenu.ss index dd06f528..8b6835a4 100644 --- a/collects/mred/private/wxmenu.ss +++ b/collects/mred/private/wxmenu.ss @@ -160,11 +160,6 @@ ;; Only called if the item is not deleted (unless (eq? (send iwx is-enabled?) (and on? #t)) (send iwx set-enabled (and on? #t)) - (let ([k (send iwx get-keymap)]) - (when k - (if on? - (send keymap chain-to-keymap k #f) - (send keymap remove-chained-keymap k)))) (super-enable id on?)))]) (sequence (super-init popup-label popup-callback font)))))