menu shortcuts remain in effect when a menu is disabled

svn: r1648
This commit is contained in:
Matthew Flatt 2005-12-19 17:45:55 +00:00
parent 30df6e05ea
commit ee7684dd9f
3 changed files with 3 additions and 12 deletions

View File

@ -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")

View File

@ -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)))])

View File

@ -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)))))