comparison lisp/toolbar.el @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents de805c49cfc1
children 95016f13131a
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
52 (setq toolbar-captioned-p val)) 52 (setq toolbar-captioned-p val))
53 ) 53 )
54 54
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, 'bootom, '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
129 ;; 126 ;;
130 ;; It really sucks that we also have to tie onto 127 ;; It really sucks that we also have to tie onto
131 ;; default-mouse-motion-handler to make sliding buttons work right. 128 ;; default-mouse-motion-handler to make sliding buttons work right.
132 ;; 129 ;;
133 (defun press-toolbar-button (event) 130 (defun press-toolbar-button (event)
144 (progn 141 (progn
145 (set-toolbar-button-down-flag button t) 142 (set-toolbar-button-down-flag button t)
146 (setq last-pressed-toolbar-button button)) 143 (setq last-pressed-toolbar-button button))
147 ;; Added by Bob Weiner, Motorola Inc., 10/6/95, to handle 144 ;; Added by Bob Weiner, Motorola Inc., 10/6/95, to handle
148 ;; presses on blank portions of toolbars. 145 ;; presses on blank portions of toolbars.
149 (when (functionp toolbar-blank-press-function) 146 (and (boundp 'toolbar-blank-press-function)
150 (funcall toolbar-blank-press-function event))))) 147 (functionp toolbar-blank-press-function)
148 (funcall toolbar-blank-press-function event)))))
151 149
152 (defun release-and-activate-toolbar-button (event) 150 (defun release-and-activate-toolbar-button (event)
153 "Release a toolbar button and activate its callback. 151 "Release a toolbar button and activate its callback.
154 Call function stored in `toolbar-blank-release-function,' if any, with EVENT 152 Call function stored in `toolbar-blank-release-function,' if any, with EVENT
155 as an argument if release is over a blank area of the toolbar." 153 as an argument if release is over a blank area of the toolbar."
198 196
199 (defun release-previous-toolbar-button (event) 197 (defun release-previous-toolbar-button (event)
200 (setq zmacs-region-stays t) 198 (setq zmacs-region-stays t)
201 (release-toolbar-button-internal event nil)) 199 (release-toolbar-button-internal event nil))
202 200
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
220 ;;; toolbar.el ends here 201 ;;; toolbar.el ends here