comparison lisp/toolbar-items.el @ 288:e11d67e05968 r21-0b42

Import from CVS: tag r21-0b42
author cvs
date Mon, 13 Aug 2007 10:35:54 +0200
parents 558f606b08ae
children 70ad99077275
comparison
equal deleted inserted replaced
287:13a0bd77a29d 288:e11d67e05968
37 37
38 ;;; Code: 38 ;;; Code:
39 39
40 ;; Suppress warning message from bytecompiler 40 ;; Suppress warning message from bytecompiler
41 (eval-when-compile 41 (eval-when-compile
42 (defvar pending-delete-mode)) 42 (defvar pending-delete-mode)
43 ;; #### The compiler still warns about missing
44 ;; `pending-delete-pre-hook'. Any way to get rid of the warning?
45 )
43 46
44 (defgroup toolbar nil 47 (defgroup toolbar nil
45 "Configure XEmacs Toolbar functions and properties" 48 "Configure XEmacs Toolbar functions and properties"
46 :group 'environment) 49 :group 'environment)
47 50
51 ;; #### The following function is slightly obnoxious as it stands. I
52 ;; think it should print a message like "Toolbar not configured; press
53 ;; me again to configure it", and when the button is pressed again
54 ;; (within a reasonable period of time), `customize-variable' should
55 ;; be invoked for the appropriate variable.
48 56
49 (defun toolbar-not-configured () 57 (defun toolbar-not-configured ()
50 (interactive) 58 (interactive)
51 ;; Note: we don't use `susbtitute-command-keys' here, because 59 ;; Note: we don't use `susbtitute-command-keys' here, because
52 ;; Customize is bound to `C-h C' by default, and that binding is not 60 ;; Customize is bound to `C-h C' by default, and that binding is not
328 is the form used to start it." 336 is the form used to start it."
329 :type '(repeat (cons :format "%v" 337 :type '(repeat (cons :format "%v"
330 (symbol :tag "Reader") (sexp :tag "Start with"))) 338 (symbol :tag "Reader") (sexp :tag "Start with")))
331 :group 'toolbar) 339 :group 'toolbar)
332 340
333 (defcustom toolbar-news-reader 'not-configured 341 (defcustom toolbar-news-reader 'gnus
334 "*News reader toolbar will invoke. 342 "*News reader toolbar will invoke.
335 The legal values are the keys from `toolbar-news-command-alist', which should 343 The legal values are the keys from `toolbar-news-command-alist', which should
336 be used to add new news readers. 344 be used to add new news readers.
337 Newsreaders known by default are gnus, rn, nn, trn, xrn, slrn, pine 345 Newsreaders known by default are gnus, rn, nn, trn, xrn, slrn, pine
338 and netscape." 346 and netscape."
370 "Run Gnus in a separate frame." 378 "Run Gnus in a separate frame."
371 (interactive) 379 (interactive)
372 (if (not toolbar-news-use-separate-frame) 380 (if (not toolbar-news-use-separate-frame)
373 (gnus) 381 (gnus)
374 (unless (frame-live-p toolbar-news-frame) 382 (unless (frame-live-p toolbar-news-frame)
375 (setq toolbar-news-frame (make-frame toolbar-news-frame-properties)) 383 (setq toolbar-news-frame (make-frame toolbar-news-frame-plist))
376 (add-hook 'gnus-exit-gnus-hook 384 (add-hook 'gnus-exit-gnus-hook
377 (lambda () 385 (lambda ()
378 (when (frame-live-p toolbar-news-frame) 386 (when (frame-live-p toolbar-news-frame)
379 (if (cdr (frame-list)) 387 (if (cdr (frame-list))
380 (delete-frame toolbar-news-frame)) 388 (delete-frame toolbar-news-frame))
447 (if (eq icon-dir nil) 455 (if (eq icon-dir nil)
448 (setq icon-dir toolbar-icon-directory)) 456 (setq icon-dir toolbar-icon-directory))
449 (mapcar 457 (mapcar
450 (lambda (cons) 458 (lambda (cons)
451 (let ((prefix (expand-file-name (cdr cons) icon-dir))) 459 (let ((prefix (expand-file-name (cdr cons) icon-dir)))
460 ;; #### This should use a better mechanism for finding the
461 ;; glyphs, allowing for formats other than x[pb]m. Look at
462 ;; `widget-glyph-find' for an example how it might be done.
452 (set (car cons) 463 (set (car cons)
453 (if (featurep 'xpm) 464 (if (featurep 'xpm)
454 (toolbar-make-button-list 465 (toolbar-make-button-list
455 (concat prefix "-up.xpm") 466 (concat prefix "-up.xpm")
456 nil 467 nil
459 nil 470 nil
460 (concat prefix "-cap-xx.xpm")) 471 (concat prefix "-cap-xx.xpm"))
461 (toolbar-make-button-list 472 (toolbar-make-button-list
462 (concat prefix "-up.xbm") 473 (concat prefix "-up.xbm")
463 (concat prefix "-dn.xbm") 474 (concat prefix "-dn.xbm")
464 (concat prefix "-xx.xbm") 475 (concat prefix "-xx.xbm"))))))
465 ))))) 476 icon-list))
466 icon-list )
467 )
468 477
469 (defvar toolbar-vector-open 478 (defvar toolbar-vector-open
470 [toolbar-file-icon toolbar-open t "Open a file"] 479 [toolbar-file-icon toolbar-open t "Open a file"]
471 "Define the vector for the \"Open\" toolbar button") 480 "Define the vector for the \"Open\" toolbar button")
472 481
473 (defvar toolbar-vector-dired 482 (defvar toolbar-vector-dired
474 [toolbar-folder-icon toolbar-dired t "View directory"] 483 [toolbar-folder-icon toolbar-dired t "Edit a directory"]
475 "Define the vector for the \"Dired\" toolbar button") 484 "Define the vector for the \"Dired\" toolbar button")
476 485
477 (defvar toolbar-vector-save 486 (defvar toolbar-vector-save
478 [toolbar-disk-icon toolbar-save t "Save buffer"] 487 [toolbar-disk-icon toolbar-save t "Save buffer"]
479 "Define the vector for the \"Save\" toolbar button") 488 "Define the vector for the \"Save\" toolbar button")
497 (defvar toolbar-vector-undo 506 (defvar toolbar-vector-undo
498 [toolbar-undo-icon toolbar-undo t "Undo edit"] 507 [toolbar-undo-icon toolbar-undo t "Undo edit"]
499 "Define the vector for the \"Undo\" toolbar button") 508 "Define the vector for the \"Undo\" toolbar button")
500 509
501 (defvar toolbar-vector-spell 510 (defvar toolbar-vector-spell
502 [toolbar-spell-icon toolbar-ispell t "Spellcheck"] 511 [toolbar-spell-icon toolbar-ispell t "Check spelling"]
503 "Define the vector for the \"Spell\" toolbar button") 512 "Define the vector for the \"Spell\" toolbar button")
504 513
505 (defvar toolbar-vector-replace 514 (defvar toolbar-vector-replace
506 [toolbar-replace-icon toolbar-replace t "Replace text"] 515 [toolbar-replace-icon toolbar-replace t "Search & Replace"]
507 "Define the vector for the \"Replace\" toolbar button") 516 "Define the vector for the \"Replace\" toolbar button")
508 517
509 (defvar toolbar-vector-mail 518 (defvar toolbar-vector-mail
510 [toolbar-mail-icon toolbar-mail t "Mail"] 519 [toolbar-mail-icon toolbar-mail t "Read mail"]
511 "Define the vector for the \"Mail\" toolbar button") 520 "Define the vector for the \"Mail\" toolbar button")
512 521
513 (defvar toolbar-vector-info 522 (defvar toolbar-vector-info
514 [toolbar-info-icon toolbar-info t "Information"] 523 [toolbar-info-icon toolbar-info t "Info documentation"]
515 "Define the vector for the \"Info\" toolbar button") 524 "Define the vector for the \"Info\" toolbar button")
516 525
517 (defvar toolbar-vector-compile 526 (defvar toolbar-vector-compile
518 [toolbar-compile-icon toolbar-compile t "Compile"] 527 [toolbar-compile-icon toolbar-compile t "Start a compilation"]
519 "Define the vector for the \"Compile\" toolbar button") 528 "Define the vector for the \"Compile\" toolbar button")
520 529
521 (defvar toolbar-vector-debug 530 (defvar toolbar-vector-debug
522 [toolbar-debug-icon toolbar-debug t "Debug"] 531 [toolbar-debug-icon toolbar-debug t "Start a debugger"]
523 "Define the vector for the \"Debug\" toolbar button") 532 "Define the vector for the \"Debug\" toolbar button")
524 533
525 (defvar toolbar-vector-news 534 (defvar toolbar-vector-news
526 [toolbar-news-icon toolbar-news t "News"] 535 [toolbar-news-icon toolbar-news t "Read news"]
527 "Define the vector for the \"News\" toolbar button") 536 "Define the vector for the \"News\" toolbar button")
528 537
529 (defvar initial-toolbar-spec 538 (defvar initial-toolbar-spec
530 (list 539 (list
531 ;;[toolbar-last-win-icon pop-window-configuration 540 ;;[toolbar-last-win-icon pop-window-configuration