comparison lisp/toolbar.el @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 3ecd8885ac67
children 54fa1a5c2d12
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
55 (defcustom default-toolbar-position ;; added for the options menu - dverna 55 (defcustom default-toolbar-position ;; added for the options menu - dverna
56 (default-toolbar-position) 56 (default-toolbar-position)
57 "The location of the default toolbar. It can be 'top, 'bottom, 'left or 57 "The location of the default toolbar. It can be 'top, 'bottom, 'left or
58 'right. This option can be customized through the options menu." 58 'right. This option can be customized through the options menu."
59 :group 'display 59 :group 'display
60 :type '(choice (const :tag "top" 'top) 60 :type '(choice (const :tag "top" top)
61 (const :tag "bottom" 'bottom) 61 (const :tag "bottom" bottom)
62 (const :tag "left" 'left) 62 (const :tag "left" left)
63 (const :tag "right" 'right)) 63 (const :tag "right" right))
64 :set #'(lambda (var val) 64 :set #'(lambda (var val)
65 (set-default-toolbar-position val) 65 (set-default-toolbar-position val)
66 (setq default-toolbar-position val)) 66 (setq default-toolbar-position val))
67 ) 67 )
68 68
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."
196 198
197 (defun release-previous-toolbar-button (event) 199 (defun release-previous-toolbar-button (event)
198 (setq zmacs-region-stays t) 200 (setq zmacs-region-stays t)
199 (release-toolbar-button-internal event nil)) 201 (release-toolbar-button-internal event nil))
200 202
203 (defun make-toolbar-specifier (spec-list)
204 "Return a new `toolbar' specifier object with the given specification list.
205 SPEC-LIST can be a list of specifications (each of which is a cons of a
206 locale and a list of instantiators), a single instantiator, or a list
207 of instantiators. See `make-specifier' for more information about
208 specifiers.
209
210 Toolbar specifiers are used to specify the format of a toolbar.
211 The values of the variables `default-toolbar', `top-toolbar',
212 `left-toolbar', `right-toolbar', and `bottom-toolbar' are always
213 toolbar specifiers.
214
215 Valid toolbar instantiators are called \"toolbar descriptors\"
216 and are lists of vectors. See `default-toolbar' for a description
217 of the exact format."
218 (make-specifier-and-init 'toolbar spec-list))
219
201 ;;; toolbar.el ends here 220 ;;; toolbar.el ends here