Mercurial > hg > xemacs-beta
comparison lisp/vm/vm-toolbar.el @ 10:49a24b4fd526 r19-15b6
Import from CVS: tag r19-15b6
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:47:52 +0200 |
parents | 376386a54a3c |
children | 859a2309aef8 |
comparison
equal
deleted
inserted
replaced
9:6f2bbbbbe05a | 10:49a24b4fd526 |
---|---|
16 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 16 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
18 (provide 'vm-toolbar) | 18 (provide 'vm-toolbar) |
19 | 19 |
20 (defvar vm-toolbar-specifier nil) | 20 (defvar vm-toolbar-specifier nil) |
21 (defvar vm-toolbar nil) | |
22 | 21 |
23 (defvar vm-toolbar-next-button | 22 (defvar vm-toolbar-next-button |
24 [vm-toolbar-next-icon | 23 [vm-toolbar-next-icon |
25 vm-toolbar-next-command | 24 vm-toolbar-next-command |
26 (vm-toolbar-any-messages-p) | 25 (vm-toolbar-any-messages-p) |
154 (setq this-command vm-toolbar-helper-command) | 153 (setq this-command vm-toolbar-helper-command) |
155 (call-interactively vm-toolbar-helper-command)) | 154 (call-interactively vm-toolbar-helper-command)) |
156 | 155 |
157 (defvar vm-toolbar-quit-button | 156 (defvar vm-toolbar-quit-button |
158 [vm-toolbar-quit-icon vm-toolbar-quit-command t | 157 [vm-toolbar-quit-icon vm-toolbar-quit-command t |
159 "Quit VM.\n | 158 "Quit visiting this folder.\n |
160 The command `vm-toolbar-quit-command' is run, which is normally | 159 The command `vm-toolbar-quit-command' is run, which is normally |
161 bound to `vm-quit'. | 160 bound to `vm-quit'. |
162 You can make this button run some other command by using a Lisp | 161 You can make this button run some other command by using a Lisp |
163 s-expression like this one in your .vm file: | 162 s-expression like this one in your .vm file: |
164 (fset 'vm-toolbar-quit-command 'some-other-command)"]) | 163 (fset 'vm-toolbar-quit-command 'some-other-command)"]) |
233 'vm-toolbar-delete/undelete-icon | 232 'vm-toolbar-delete/undelete-icon |
234 'vm-toolbar-helper-command | 233 'vm-toolbar-helper-command |
235 'vm-toolbar-helper-icon)) | 234 'vm-toolbar-helper-icon)) |
236 (and vm-toolbar-specifier | 235 (and vm-toolbar-specifier |
237 (progn | 236 (progn |
238 (let ((locale (if (memq 'vm-delete-buffer-frame kill-buffer-hook) | 237 (set-specifier vm-toolbar-specifier (cons (current-buffer) nil)) |
239 (selected-frame) | 238 (set-specifier vm-toolbar-specifier (cons (current-buffer) |
240 (current-buffer)))) | 239 vm-toolbar))))) |
241 (set-specifier vm-toolbar-specifier (cons locale nil)) | |
242 (set-specifier vm-toolbar-specifier (cons locale vm-toolbar)))))) | |
243 | 240 |
244 (defun vm-toolbar-install-toolbar () | 241 (defun vm-toolbar-install-toolbar () |
245 (vm-toolbar-initialize) | 242 (vm-toolbar-initialize) |
246 (let ((toolbar (vm-toolbar-make-toolbar-spec)) | 243 (let ((height (+ 4 (glyph-height (car vm-toolbar-help-icon)))) |
247 (height (+ 4 (glyph-height (car vm-toolbar-help-icon)))) | |
248 (width (+ 4 (glyph-width (car vm-toolbar-help-icon)))) | 244 (width (+ 4 (glyph-width (car vm-toolbar-help-icon)))) |
249 (locale (if (memq 'vm-delete-buffer-frame kill-buffer-hook) | 245 toolbar ) |
250 (selected-frame) | 246 ;; honor user setting of vm-toolbar if they are daring enough |
251 (current-buffer)))) | 247 ;; to set it. |
252 (setq vm-toolbar toolbar) | 248 (if vm-toolbar |
249 (setq toolbar vm-toolbar) | |
250 (setq toolbar (vm-toolbar-make-toolbar-spec) | |
251 vm-toolbar toolbar)) | |
253 (cond ((eq vm-toolbar-orientation 'right) | 252 (cond ((eq vm-toolbar-orientation 'right) |
254 (setq vm-toolbar-specifier right-toolbar) | 253 (setq vm-toolbar-specifier right-toolbar) |
255 (set-specifier right-toolbar (cons locale toolbar)) | 254 (set-specifier right-toolbar (cons (current-buffer) toolbar)) |
256 (set-specifier right-toolbar-width (cons (selected-frame) width))) | 255 (set-specifier right-toolbar-width |
256 (cons (selected-frame) width))) | |
257 ((eq vm-toolbar-orientation 'left) | 257 ((eq vm-toolbar-orientation 'left) |
258 (setq vm-toolbar-specifier left-toolbar) | 258 (setq vm-toolbar-specifier left-toolbar) |
259 (set-specifier left-toolbar (cons locale toolbar)) | 259 (set-specifier left-toolbar (cons (current-buffer) toolbar)) |
260 (set-specifier left-toolbar-width (cons (selected-frame) width))) | 260 (set-specifier left-toolbar-width |
261 (cons (selected-frame) width))) | |
261 ((eq vm-toolbar-orientation 'bottom) | 262 ((eq vm-toolbar-orientation 'bottom) |
262 (setq vm-toolbar-specifier bottom-toolbar) | 263 (setq vm-toolbar-specifier bottom-toolbar) |
263 (set-specifier bottom-toolbar (cons locale toolbar)) | 264 (set-specifier bottom-toolbar (cons (current-buffer) toolbar)) |
264 (set-specifier bottom-toolbar-height (cons (selected-frame) | 265 (set-specifier bottom-toolbar-height |
265 height))) | 266 (cons (selected-frame) height))) |
266 (t | 267 (t |
267 (setq vm-toolbar-specifier top-toolbar) | 268 (setq vm-toolbar-specifier top-toolbar) |
268 (set-specifier top-toolbar (cons locale toolbar)) | 269 (set-specifier top-toolbar (cons (current-buffer) toolbar)) |
269 (set-specifier top-toolbar-height (cons (selected-frame) | 270 (set-specifier top-toolbar-height |
270 height)))))) | 271 (cons (selected-frame) height)))))) |
271 | 272 |
272 (defun vm-toolbar-make-toolbar-spec () | 273 (defun vm-toolbar-make-toolbar-spec () |
273 (let ((button-alist '( | 274 (let ((button-alist '( |
274 (autofile . vm-toolbar-autofile-button) | 275 (autofile . vm-toolbar-autofile-button) |
275 (compose . vm-toolbar-compose-button) | 276 (compose . vm-toolbar-compose-button) |