annotate lisp/x11/x-toolbar.el @ 4:b82b59fe008d r19-15b3

Import from CVS: tag r19-15b3
author cvs
date Mon, 13 Aug 2007 08:46:56 +0200
parents 376386a54a3c
children 49a24b4fd526
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;; Toolbar support for X.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;; Copyright (C) 1994 Andy Piper <andyp@parallax.demon.co.uk>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1995 Board of Trustees, University of Illinois
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; Copyright (C) 1996 Ben Wing <wing@666.com>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; along with XEmacs; see the file COPYING. If not, write to the Free
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; toolbar ispell variables and defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 (defun toolbar-ispell ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 "Intelligently spell the region or buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 (if (region-active-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (ispell-region (region-beginning) (region-end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (ispell-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; toolbar mail variables and defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (defvar toolbar-use-separate-mail-frame nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 "If non-nil run mail in a separate frame.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (defvar toolbar-mail-frame nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 "The frame in which mail is displayed.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (defvar toolbar-mail-command 'vm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 "The mail reader to run.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (defun toolbar-mail ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 "Run mail in a separate frame."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (if (not toolbar-use-separate-mail-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (funcall toolbar-mail-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (if (or (not toolbar-mail-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (not (frame-live-p toolbar-mail-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (setq toolbar-mail-frame (make-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (add-hook 'vm-quit-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 '(lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (if (frame-live-p toolbar-mail-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (delete-frame toolbar-mail-frame)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (select-frame toolbar-mail-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (raise-frame toolbar-mail-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (funcall toolbar-mail-command)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (if (frame-iconified-p toolbar-mail-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (deiconify-frame toolbar-mail-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (select-frame toolbar-mail-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (raise-frame toolbar-mail-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ;; toolbar info variables and defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (defvar toolbar-info-frame nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 "The frame in which info is displayed.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (defun toolbar-info ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 "Run info in a separate frame."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (if (or (not toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (not (frame-live-p toolbar-info-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (setq toolbar-info-frame (make-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (select-frame toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (raise-frame toolbar-info-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (if (frame-iconified-p toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (deiconify-frame toolbar-info-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (select-frame toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (raise-frame toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (info))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 ;; toolbar debug variables and defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (defun toolbar-debug ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (if (featurep 'eos-debugger)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (call-interactively 'eos::start-debugger)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (require 'gdbsrc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (call-interactively 'gdbsrc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (defvar compile-command)
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
103 (defvar toolbar-compile-already-run nil)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (defun toolbar-compile ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 "Run compile without having to touch the keyboard."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (require 'compile)
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
109 (if toolbar-compile-already-run
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
110 (compile compile-command)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
111 (setq toolbar-compile-already-run t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
112 (popup-dialog-box
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
113 `(,(concat "Compile:\n " compile-command)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
114 ["Compile" (compile compile-command) t]
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
115 ["Edit command" compile t]
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
116 nil
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
117 ["Cancel" (message "Quit") t]))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ;; toolbar news variables and defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (defvar toolbar-news-frame nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 "The frame in which news is displayed.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (defun toolbar-news ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 "Run GNUS in a separate frame."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (if (or (not toolbar-news-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (not (frame-live-p toolbar-news-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (setq toolbar-news-frame (make-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (add-hook 'gnus-exit-gnus-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 '(lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (if (frame-live-p toolbar-news-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (delete-frame toolbar-news-frame))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (select-frame toolbar-news-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (raise-frame toolbar-news-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (gnus)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (if (frame-iconified-p toolbar-news-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (deiconify-frame toolbar-news-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (select-frame toolbar-news-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (raise-frame toolbar-news-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
145 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
146 ;; toolbar printing variable and defun
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
147 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
148 (defvar toolbar-print-command 'lpr-buffer
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
149 "Command to run when the Print Icon is selected from the toolbar.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
150 Set this to `ps-print-buffer-with-faces' if you primarily print with
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
151 a postscript printer.")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
152
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
153 (defun toolbar-print ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
154 "Print current buffer."
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
155 (funcall toolbar-print-command))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
156
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
157 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
158 ;; toolbar replacement variable and defun
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
159 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
160 (defvar toolbar-replace-command 'query-replace
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
161 "Command to run when the Replace Icon is selected from the toolbar.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
162 One possibility for a different value would be `query-replace-regexp'.")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
163
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
164 (defun toolbar-replace ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
165 "Run a query-replace -type function on the current buffer."
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
166 (funcall toolbar-replace-command))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
167
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (defvar toolbar-last-win-icon nil "A `last-win' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (defvar toolbar-next-win-icon nil "A `next-win' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (defvar toolbar-file-icon nil "A `file' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (defvar toolbar-folder-icon nil "A `folder' icon set")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (defvar toolbar-disk-icon nil "A `disk' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (defvar toolbar-printer-icon nil "A `printer' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (defvar toolbar-cut-icon nil "A `cut' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (defvar toolbar-copy-icon nil "A `copy' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (defvar toolbar-paste-icon nil "A `paste' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (defvar toolbar-undo-icon nil "An `undo' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (defvar toolbar-spell-icon nil "A `spell' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (defvar toolbar-replace-icon nil "A `replace' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (defvar toolbar-mail-icon nil "A `mail' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (defvar toolbar-info-icon nil "An `info' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (defvar toolbar-compile-icon nil "A `compile' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (defvar toolbar-debug-icon nil "A `debugger' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (defvar toolbar-news-icon nil "A `news' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 ;;; each entry maps a variable to the prefix used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (defvar init-x-toolbar-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 '((toolbar-last-win-icon . "last-win")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (toolbar-next-win-icon . "next-win")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (toolbar-file-icon . "file")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (toolbar-folder-icon . "folder")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (toolbar-disk-icon . "disk")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (toolbar-printer-icon . "printer")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (toolbar-cut-icon . "cut")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (toolbar-copy-icon . "copy")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (toolbar-paste-icon . "paste")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (toolbar-undo-icon . "undo")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (toolbar-spell-icon . "spell")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (toolbar-replace-icon . "replace")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (toolbar-mail-icon . "mail")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (toolbar-info-icon . "info-def")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (toolbar-compile-icon . "compile")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (toolbar-debug-icon . "debug")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (toolbar-news-icon . "news")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (defun init-x-toolbar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 #'(lambda (cons)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (let ((prefix (expand-file-name (cdr cons) toolbar-icon-directory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (set (car cons)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (if (featurep 'xpm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (toolbar-make-button-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (concat prefix "-up.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (concat prefix "-xx.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (concat prefix "-cap-up.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (concat prefix "-cap-xx.xpm"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (toolbar-make-button-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (concat prefix "-up.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (concat prefix "-dn.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (concat prefix "-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 )))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 init-x-toolbar-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 ;; do this now because errors will occur if the icon symbols
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 ;; are not initted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (set-specifier default-toolbar initial-toolbar-spec))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (defvar initial-toolbar-spec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 '(;[toolbar-last-win-icon pop-window-configuration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 ;;; #### illicit knowledge?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 ;;; #### these don't work right!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 ;;; #### not consistent.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 ;;; I don't know what's wrong;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 ;;; perhaps `selected-frame' is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 ;;; wrong sometimes when this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 ;;; is evaluated. Note that I
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 ;;; even tried to kludge-fix this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 ;;; by calls to `set-specifier-dirty-flag'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 ;;; in pop-window-configuration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ;;; and such.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 ;(frame-property (selected-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ; 'window-config-stack)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 ; t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 ; "Most recent window config"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 ;[toolbar-next-win-icon unpop-window-configuration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 ;;; #### illicit knowledge?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 ;(frame-property (selected-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 ; 'window-config-unpop-stack)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 ; t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 ; "Undo \"Most recent window config\""]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 [toolbar-file-icon find-file t "Open a file" ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 [toolbar-folder-icon dired t "View directory"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 [toolbar-disk-icon save-buffer t "Save buffer" ]
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
256 [toolbar-printer-icon toolbar-print t "Print buffer" ]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 [toolbar-cut-icon x-kill-primary-selection t "Kill region"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 [toolbar-copy-icon x-copy-primary-selection t "Copy region"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 [toolbar-paste-icon x-yank-clipboard-selection t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 "Paste from clipboard"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 [toolbar-undo-icon undo t "Undo edit" ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 [toolbar-spell-icon toolbar-ispell t "Spellcheck" ]
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
263 [toolbar-replace-icon toolbar-replace t "Replace text" ]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 [toolbar-mail-icon toolbar-mail t "Mail" ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 [toolbar-info-icon toolbar-info t "Information" ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 [toolbar-compile-icon toolbar-compile t "Compile" ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 [toolbar-debug-icon toolbar-debug t "Debug" ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 [toolbar-news-icon toolbar-news t "News" ])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 "The initial toolbar for a buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (defun x-init-toolbar-from-resources (locale)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (x-init-specifier-from-resources
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 top-toolbar-height 'natnum locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 '("topToolBarHeight" . "TopToolBarHeight"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (x-init-specifier-from-resources
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 bottom-toolbar-height 'natnum locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 '("bottomToolBarHeight" . "BottomToolBarHeight"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (x-init-specifier-from-resources
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 left-toolbar-width 'natnum locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 '("leftToolBarWidth" . "LeftToolBarWidth"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (x-init-specifier-from-resources
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 right-toolbar-width 'natnum locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 '("rightToolBarWidth" . "RightToolBarWidth")))