comparison lisp/toolbar.el @ 410:de805c49cfc1 r21-2-35

Import from CVS: tag r21-2-35
author cvs
date Mon, 13 Aug 2007 11:19:21 +0200
parents 501cfd01ee6d
children 697ef44129c6
comparison
equal deleted inserted replaced
409:301b9ebbdf3b 410:de805c49cfc1
121 (define-key toolbar-map 'button1 'press-toolbar-button) 121 (define-key toolbar-map 'button1 'press-toolbar-button)
122 (define-key toolbar-map 'button1up 'release-and-activate-toolbar-button) 122 (define-key toolbar-map 'button1up 'release-and-activate-toolbar-button)
123 (defvar last-pressed-toolbar-button nil) 123 (defvar last-pressed-toolbar-button nil)
124 (defvar toolbar-active nil) 124 (defvar toolbar-active nil)
125 125
126 (defvar toolbar-blank-press-function nil
127 "Function to call if a blank area of the toolbar is pressed.")
128
126 ;; 129 ;;
127 ;; It really sucks that we also have to tie onto 130 ;; It really sucks that we also have to tie onto
128 ;; default-mouse-motion-handler to make sliding buttons work right. 131 ;; default-mouse-motion-handler to make sliding buttons work right.
129 ;; 132 ;;
130 (defun press-toolbar-button (event) 133 (defun press-toolbar-button (event)
141 (progn 144 (progn
142 (set-toolbar-button-down-flag button t) 145 (set-toolbar-button-down-flag button t)
143 (setq last-pressed-toolbar-button button)) 146 (setq last-pressed-toolbar-button button))
144 ;; Added by Bob Weiner, Motorola Inc., 10/6/95, to handle 147 ;; Added by Bob Weiner, Motorola Inc., 10/6/95, to handle
145 ;; presses on blank portions of toolbars. 148 ;; presses on blank portions of toolbars.
146 (and (boundp 'toolbar-blank-press-function) 149 (when (functionp toolbar-blank-press-function)
147 (functionp toolbar-blank-press-function) 150 (funcall toolbar-blank-press-function event)))))
148 (funcall toolbar-blank-press-function event)))))
149 151
150 (defun release-and-activate-toolbar-button (event) 152 (defun release-and-activate-toolbar-button (event)
151 "Release a toolbar button and activate its callback. 153 "Release a toolbar button and activate its callback.
152 Call function stored in `toolbar-blank-release-function,' if any, with EVENT 154 Call function stored in `toolbar-blank-release-function,' if any, with EVENT
153 as an argument if release is over a blank area of the toolbar." 155 as an argument if release is over a blank area of the toolbar."