]> code.delx.au - gnu-emacs/blob - lisp/progmodes/idlw-toolbar.el
Merge from emacs-23
[gnu-emacs] / lisp / progmodes / idlw-toolbar.el
1 ;;; idlw-toolbar.el --- a debugging toolbar for IDLWAVE
2
3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
4 ;; Free Software Foundation, Inc.
5
6 ;; Author: Carsten Dominik <dominik@astro.uva.nl>
7 ;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
8 ;; Version: 6.1.22
9 ;; Keywords: processes
10 ;; Package: idlwave
11
12 ;; This file is part of GNU Emacs.
13
14 ;; GNU Emacs is free software: you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by
16 ;; the Free Software Foundation, either version 3 of the License, or
17 ;; (at your option) any later version.
18
19 ;; GNU Emacs is distributed in the hope that it will be useful,
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;; GNU General Public License for more details.
23
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
26
27 ;;; Commentary:
28
29 ;; This file implements a debugging toolbar for IDLWAVE. It requires
30 ;; Emacs or XEmacs with toolbar and xpm support.
31
32 ;; New versions of IDLWAVE, documentation, and more information
33 ;; available from:
34 ;; http://idlwave.org
35
36 \f
37 ;;; Code:
38
39 (eval-when-compile (require 'cl))
40
41 (defun idlwave-toolbar-make-button (image)
42 (if (featurep 'xemacs)
43 (toolbar-make-button-list image)
44 (list 'image :type 'xpm :data image)))
45
46 (defvar idlwave-toolbar)
47 (defvar default-toolbar)
48 (defvar idlwave-toolbar-is-possible)
49
50 (if (not (or (and (featurep 'xemacs) ; This is XEmacs
51 (featurep 'xpm) ; need xpm
52 (featurep 'toolbar)) ; ... and the toolbar
53 (and (not (featurep 'xemacs)) ; This is Emacs
54 (boundp 'tool-bar-button-margin) ; need toolbar
55 (fboundp 'image-type-available-p) ; need image stuff
56 (image-type-available-p 'xpm)) ; need xpm
57 ))
58 ;; oops - cannot do the toolbar
59 (message "Sorry, IDLWAVE xpm toolbar cannot be used on this version of Emacs")
60 ;; OK, we can define a toolbar
61
62 (defconst idlwave-toolbar-is-possible t
63 "When defined, indicates that a toolbar is possible with this Emacs.")
64 (defvar idlwave-toolbar-compile-icon
65 (idlwave-toolbar-make-button
66 "/* XPM */
67 static char * file[] = {
68 \"28 28 2 1\",
69 \" c None s backgroundToolBarColor\",
70 \". c #000000000000\",
71 \" \",
72 \" \",
73 \" \",
74 \" . \",
75 \" .. ... .. \",
76 \" .... ... .... \",
77 \" ............. \",
78 \" ........... \",
79 \" ................... \",
80 \" ........ ........ \",
81 \" ..... ........ \",
82 \" .... ......... \",
83 \" ..... .. ... ..... \",
84 \" ...... .. .. ...... \",
85 \" ..... ... .. ..... \",
86 \" ......... .... \",
87 \" ........ ..... \",
88 \" ........ ........ \",
89 \" ................... \",
90 \" ........... \",
91 \" ............. \",
92 \" .... ... .... \",
93 \" .. ... .. \",
94 \" . \",
95 \" \",
96 \" \",
97 \" \",
98 \" \"};")
99 "The compile icon.")
100
101 (defvar idlwave-toolbar-next-error-icon
102 (idlwave-toolbar-make-button
103 "/* XPM */
104 static char * file[] = {
105 \"28 28 3 1\",
106 \" c None s backgroundToolBarColor\",
107 \". c #000000000000\",
108 \"R c #FFFF00000000\",
109 \" \",
110 \" \",
111 \" R \",
112 \" RR RRR RR \",
113 \" RRRR RRR RRRR \",
114 \" RRRRRRRRRRRRR \",
115 \" RRRRRRRRRRR \",
116 \" RRRRRRRRRRRRRRRRRRR \",
117 \" RRRRRRRR \",
118 \" RRRRR \",
119 \" RRRR \",
120 \" ........ \",
121 \" ........ \",
122 \" ......... \",
123 \" ..... .. ... ..... \",
124 \" ...... .. .. ...... \",
125 \" ..... ... .. ..... \",
126 \" ......... .... \",
127 \" ........ ..... \",
128 \" ........ ........ \",
129 \" ................... \",
130 \" ........... \",
131 \" ............. \",
132 \" .... ... .... \",
133 \" .. ... .. \",
134 \" . \",
135 \" \",
136 \" \"};")
137 "The Next Error icon.")
138
139 (defvar idlwave-toolbar-stop-at-icon
140 (idlwave-toolbar-make-button
141 "/* XPM */
142 static char * file[] = {
143 \"28 28 3 1\",
144 \" c None s backgroundToolBarColor\",
145 \". c #000000000000\",
146 \"R c #FFFF00000000\",
147 \" \",
148 \" \",
149 \" \",
150 \" \",
151 \" ........ \",
152 \" .RRRRRRRR. \",
153 \" .RRRRRRRRRR. \",
154 \" .RRRRRRRRRRRR. \",
155 \" .RRRRRRRRRRRRRR. \",
156 \" .RRRRRRRRRRRRRRRR. \",
157 \" .RRRRRRRRRRRRRRRRRR. \",
158 \" .RRRRRRRRRRRRRRRRRR. \",
159 \" .RRRRRRRRRRRRRRRRRR. \",
160 \" .RRRRRRRRRRRRRRRRRR. \",
161 \" .RRRRRRRRRRRRRRRRRR. \",
162 \" .RRRRRRRRRRRRRRRRRR. \",
163 \" .RRRRRRRRRRRRRRRRRR. \",
164 \" .RRRRRRRRRRRRRRRRRR. \",
165 \" .RRRRRRRRRRRRRRRR. \",
166 \" .RRRRRRRRRRRRRR. \",
167 \" .RRRRRRRRRRRR. \",
168 \" .RRRRRRRRRR. \",
169 \" .RRRRRRRR. \",
170 \" ........ \",
171 \" \",
172 \" \",
173 \" \",
174 \" \"};")
175 "The Stop At icon.")
176
177
178 (defvar idlwave-toolbar-clear-at-icon
179 (idlwave-toolbar-make-button
180 "/* XPM */
181 static char * file[] = {
182 \"28 28 3 1\",
183 \" c None s backgroundToolBarColor\",
184 \". c #000000000000\",
185 \"R c #FFFF00000000\",
186 \" \",
187 \" \",
188 \" \",
189 \" ... ... \",
190 \" ... ........ ... \",
191 \" ... .RRRRRRRR. ... \",
192 \" ....RRRRRRRRRR.... \",
193 \" ...RRRRRRRRRR... \",
194 \" ....RRRRRRRR.... \",
195 \" .RR...RRRRRR...RR. \",
196 \" .RRRR...RRRR...RRRR. \",
197 \" .RRRRR...RR...RRRRR. \",
198 \" .RRRRRR......RRRRRR. \",
199 \" .RRRRRRR....RRRRRRR. \",
200 \" .RRRRRRR....RRRRRRR. \",
201 \" .RRRRRR......RRRRRR. \",
202 \" .RRRRR...RR...RRRRR. \",
203 \" .RRRR...RRRR...RRRR. \",
204 \" .RR...RRRRRR...RR. \",
205 \" ....RRRRRRRR.... \",
206 \" ...RRRRRRRRRR... \",
207 \" ....RRRRRRRRRR.... \",
208 \" ... .RRRRRRRR. ... \",
209 \" ... ........ ... \",
210 \" ... ... \",
211 \" \",
212 \" \",
213 \" \"};")
214 "The Clear At icon.")
215
216 (defvar idlwave-toolbar-clear-all-icon
217 (idlwave-toolbar-make-button
218 "/* XPM */
219 static char * file[] = {
220 \"28 28 4 1\",
221 \" c None s backgroundToolBarColor\",
222 \". c #000000000000\",
223 \"X c #FFFFFFFFFFFF\",
224 \"R c #FFFF00000000\",
225 \" \",
226 \" \",
227 \" \",
228 \" .. .... .... .. \",
229 \" ...RRRR. .RRRR... \",
230 \" ...RRRR. .RRRR... \",
231 \" .R...RRRR. .RRRR...R. \",
232 \" .RR...RRR. .RRR...RR. \",
233 \" .RRR...RR. .RR...RRR. \",
234 \" .RRRR...R. .R...RRRR. \",
235 \" .RRRR... ...RRRR. \",
236 \" .RRRR... ...RRRR. \",
237 \" .... ... ... .... \",
238 \" ..... \",
239 \" ... \",
240 \" .... ..... .... \",
241 \" .RRRR.... ....RRRR. \",
242 \" .RRRRR... ...RRRRR. \",
243 \" .RRRRR.... ....RRRRR. \",
244 \" .RRRR...R. .R...RRRR. \",
245 \" .RRR...RR. .RR...RRR. \",
246 \" .RR...RRR. .RRR...RR. \",
247 \" ....RRR. .RRR.... \",
248 \" ...RRR. .RRR... \",
249 \" ....... ....... \",
250 \" \",
251 \" \",
252 \" \"};")
253 "The Clear-All icon.")
254
255 (defvar idlwave-toolbar-stop-beginning-icon
256 (idlwave-toolbar-make-button
257 "/* XPM */
258 static char * file[] = {
259 \"28 28 4 1\",
260 \" c None s backgroundToolBarColor\",
261 \". c #000000000000\",
262 \"X c #FFFF00000000\",
263 \"_ c #FFFFFFFFFFFF\",
264 \" \",
265 \" \",
266 \" \",
267 \" \",
268 \" ........ \",
269 \" .XXXXXXXX. \",
270 \" .XXXXXXXXXX. \",
271 \" .XXXXXXXXXXXX. \",
272 \" .XX..XXXXXXXXXX. \",
273 \" .XX.XX.X______XXX. \",
274 \" .XXX.XX.X______XXXX. \",
275 \" .XXXX..XXXXXXXXXXXX. \",
276 \" .XXXXXXXXXX____XXXX. \",
277 \" .XXXXXXXXXX____XXXX. \",
278 \" .XXXXXXXXXXXXXXXXXX. \",
279 \" .XXXXXXXXXX____XXXX. \",
280 \" .XXXXXXXXXX____XXXX. \",
281 \" .XXXXXXXXXXXXXXXXXX. \",
282 \" .XXXXXXXXX____XXX. \",
283 \" .XXXXXXXX____XX. \",
284 \" .XXXXXXXXXXXX. \",
285 \" .XXXXXXXXXX. \",
286 \" .XXXXXXXX. \",
287 \" ........ \",
288 \" \",
289 \" \",
290 \" \",
291 \" \"};")
292 "The Stop at Beginning icon.")
293
294 (defvar idlwave-toolbar-stop-in-icon
295 (idlwave-toolbar-make-button
296 "/* XPM */
297 static char * file[] = {
298 \"28 28 4 1\",
299 \" c None s backgroundToolBarColor\",
300 \"_ c #FFFFFFFFFFFF\",
301 \". c #000000000000\",
302 \"R c #FFFF00000000\",
303 \" \",
304 \" \",
305 \" \",
306 \" \",
307 \" ........ \",
308 \" .RRRRRRRR. \",
309 \" .RRRRRRRRRR. \",
310 \" .RRRRRRRRRRRR. \",
311 \" .RRR___RR___RRR. \",
312 \" .RRRR__RRRR__RRRR. \",
313 \" .RRRRR__RRRR__RRRRR. \",
314 \" .RRRRR__RRRR__RRRRR. \",
315 \" .RRRRR__RRRR__RRRRR. \",
316 \" .RRRR__RRRRRR__RRRR. \",
317 \" .RRRRR__RRRR__RRRRR. \",
318 \" .RRRRR__RRRR__RRRRR. \",
319 \" .RRRRR__RRRR__RRRRR. \",
320 \" .RRRRR__RRRR__RRRRR. \",
321 \" .RRRR___RR___RRRR. \",
322 \" .RRRRRRRRRRRRRR. \",
323 \" .RRRRRRRRRRRR. \",
324 \" .RRRRRRRRRR. \",
325 \" .RRRRRRRR. \",
326 \" ........ \",
327 \" \",
328 \" \",
329 \" \",
330 \" \"};")
331 "The Stop in icon.")
332
333 (defvar idlwave-toolbar-edit-cmd-icon
334 (idlwave-toolbar-make-button
335 "/* XPM */
336 static char * file[] = {
337 \"28 28 2 1\",
338 \" c None s backgroundToolBarColor\",
339 \". c #000000000000\",
340 \" \",
341 \" \",
342 \" \",
343 \" \",
344 \" \",
345 \" \",
346 \" \",
347 \" \",
348 \" \",
349 \" \",
350 \" \",
351 \" .. \",
352 \" .. \",
353 \" .. \",
354 \" .. \",
355 \" .. \",
356 \" \",
357 \" \",
358 \" ................. \",
359 \" \",
360 \" \",
361 \" \",
362 \" \",
363 \" \",
364 \" \",
365 \" \",
366 \" \",
367 \" \"};")
368 "The edit-cmd icon")
369
370 (defvar idlwave-toolbar-run-icon
371 (idlwave-toolbar-make-button
372 "/* XPM */
373 static char * file[] = {
374 \"28 28 3 1\",
375 \" c None s backgroundToolBarColor\",
376 \". s FgColor c #000000000000\",
377 \"G c #0000BBBB0000\",
378 \" \",
379 \" \",
380 \" \",
381 \" \",
382 \" ..... \",
383 \" .GGG. \",
384 \" .GGG. \",
385 \" .GGG. ....... \",
386 \" .GGG. \",
387 \" .GGG. \",
388 \" .GGG. ....... \",
389 \" .GGG. \",
390 \" ....GGG.... \",
391 \" .GGGGGGG. ....... \",
392 \" .GGGGG. \",
393 \" .GGG. \",
394 \" .G. ....... \",
395 \" . \",
396 \" \",
397 \" ....... \",
398 \" \",
399 \" \",
400 \" ....... \",
401 \" \",
402 \" \",
403 \" \",
404 \" \",
405 \" \"};")
406 "The Run icon.")
407
408 (defvar idlwave-toolbar-cont-icon
409 (idlwave-toolbar-make-button
410 "/* XPM */
411 static char * file[] = {
412 \"28 28 3 1\",
413 \" c None s backgroundToolBarColor\",
414 \". s FgColor c #000000000000\",
415 \"G c #0000BBBB0000\",
416 \" \",
417 \" \",
418 \" \",
419 \" ....... \",
420 \" \",
421 \" ....... \",
422 \" .GGGGGG. ....... \",
423 \" .GGGGGGG. \",
424 \" .GGG..... \",
425 \" .GGG. ....... \",
426 \" .GGG. \",
427 \" .GGG. \",
428 \" .GGG. ....... \",
429 \" .GGG. \",
430 \" ....GGG.... \",
431 \" .GGGGGGG. ....... \",
432 \" .GGGGG. \",
433 \" .GGG. \",
434 \" .G. ....... \",
435 \" . \",
436 \" \",
437 \" ....... \",
438 \" \",
439 \" \",
440 \" \",
441 \" \",
442 \" \",
443 \" \"};")
444 "The Cont icon.")
445
446 (defvar idlwave-toolbar-to-here-icon
447 (idlwave-toolbar-make-button
448 "/* XPM */
449 static char * file[] = {
450 \"28 28 4 1\",
451 \" c None s backgroundToolBarColor\",
452 \". c #000000000000\",
453 \"G c #0000BBBB0000\",
454 \"R c #FFFF00000000\",
455 \" \",
456 \" \",
457 \" \",
458 \" \",
459 \" \",
460 \" \",
461 \" ..... ........ \",
462 \" .GGGG. \",
463 \" .GGGGG. \",
464 \" .GG.... ........ \",
465 \" .GG. \",
466 \" .GG. . \",
467 \" .GG. .. \",
468 \" .GG. .G. ...... \",
469 \" .GG...GG. \",
470 \" .GGGGGGGG. RRRRRR \",
471 \" .GGGGGGGGG. RRRRRR \",
472 \" .GGGGGGG. RRRRRR \",
473 \" ....GG. \",
474 \" .G. ...... \",
475 \" .. \",
476 \" . \",
477 \" \",
478 \" \",
479 \" \",
480 \" \",
481 \" \",
482 \" \"};")
483 "The Cont-to-here icon.")
484
485 (defvar idlwave-toolbar-step-over-icon
486 (idlwave-toolbar-make-button
487 "/* XPM */
488 static char * file[] = {
489 \"28 28 3 1\",
490 \" c None s backgroundToolBarColor\",
491 \". c #000000000000\",
492 \"G c #0000BBBB0000\",
493 \" \",
494 \" \",
495 \" \",
496 \" \",
497 \" \",
498 \" \",
499 \" ..... \",
500 \" .GGGG. ....... \",
501 \" .GGGGG. \",
502 \" .GG.... \",
503 \" .GG. ....... \",
504 \" .GG. . \",
505 \" .GG. .. \",
506 \" .GG. .G. ....... \",
507 \" .GG...GG. \",
508 \" .GGGGGGGG. \",
509 \" .GGGGGGGGG. ....... \",
510 \" .GGGGGGG. \",
511 \" ....GG. \",
512 \" .G. ....... \",
513 \" .. \",
514 \" . \",
515 \" ....... \",
516 \" \",
517 \" \",
518 \" \",
519 \" \",
520 \" \"};")
521 "The Step Over icon.")
522
523 (defvar idlwave-toolbar-step-into-icon
524 (idlwave-toolbar-make-button
525 "/* XPM */
526 static char * file[] = {
527 \"28 28 3 1\",
528 \" c None s backgroundToolBarColor\",
529 \". c #000000000000\",
530 \"G c #0000BBBB0000\",
531 \" \",
532 \" \",
533 \" \",
534 \" \",
535 \" \",
536 \" \",
537 \" ..... ....... \",
538 \" .GGGG. \",
539 \" .GGGGG. \",
540 \" .GG.... ........ \",
541 \" .GG. \",
542 \" .GG. . \",
543 \" .GG. .. \",
544 \" .GG. .G. \",
545 \" .GG...GG. ....... \",
546 \" .GGGGGGGG. \",
547 \" .GGGGGGGGG. \",
548 \" .GGGGGGG. ....... \",
549 \" ....GG. \",
550 \" .G. \",
551 \" .. ....... \",
552 \" . \",
553 \" \",
554 \" \",
555 \" \",
556 \" \",
557 \" \",
558 \" \"};")
559 "The Step Into icon.")
560
561 (defvar idlwave-toolbar-step-out-icon
562 (idlwave-toolbar-make-button
563 "/* XPM */
564 static char * file[] = {
565 \"28 28 3 1\",
566 \" c None s backgroundToolBarColor\",
567 \". c #000000000000\",
568 \"G c #0000BBBB0000\",
569 \" \",
570 \" \",
571 \" \",
572 \" \",
573 \" \",
574 \" \",
575 \" . \",
576 \" .. ........ \",
577 \" .G. \",
578 \" ....GG. \",
579 \" .GGGGGGG. ........ \",
580 \" .GGGGGGGGG. \",
581 \" .GGGGGGGG. \",
582 \" .GG...GG. ........ \",
583 \" .GG. .G. \",
584 \" .GG. .. \",
585 \" .GG. . \",
586 \" .GG. \",
587 \" .GG....... ....... \",
588 \" .GGGGGGGG. \",
589 \" .GGGGGGG. \",
590 \" ........ ....... \",
591 \" \",
592 \" \",
593 \" \",
594 \" \",
595 \" \",
596 \" \"};")
597 "The Step up icon.")
598
599
600 (defvar idlwave-toolbar-eval-icon
601 (idlwave-toolbar-make-button
602 "/* XPM */
603 static char * file[] = {
604 \"28 28 2 1\",
605 \" c None s backgroundToolBarColor\",
606 \". c #000000000000\",
607 \" \",
608 \" \",
609 \" \",
610 \" \",
611 \" \",
612 \" \",
613 \" \",
614 \" \",
615 \" \",
616 \" \",
617 \" \",
618 \" .... \",
619 \" .. .. ...... \",
620 \" .. .. ...... \",
621 \" .. .. \",
622 \" .. .. ...... \",
623 \" .. .. ...... \",
624 \" .... \",
625 \" .. \",
626 \" .. \",
627 \" \",
628 \" \",
629 \" \",
630 \" \",
631 \" \",
632 \" \",
633 \" \",
634 \" \"};")
635 "The Evaluate icon.")
636
637 (defvar idlwave-toolbar-stack-up-icon
638 (idlwave-toolbar-make-button
639 "/* XPM */
640 static char * file[] = {
641 \"28 28 5 1\",
642 \" c None s backgroundToolBarColor\",
643 \". s FgColor c #000000000000\",
644 \"_ c #FFFFFFFFFFFF\",
645 \"G c #0000BBBB0000\",
646 \"R c #FFFF00000000\",
647 \" \",
648 \" \",
649 \" \",
650 \" \",
651 \" \",
652 \" ........ . \",
653 \" .______. ... \",
654 \" .______. ..... \",
655 \" .______. ....... \",
656 \" .______. ... \",
657 \" .______. ... \",
658 \" ........ ... \",
659 \" .GGGGGG. ... \",
660 \" .GGGGGG. ... \",
661 \" .GGGGGG. \",
662 \" .GGGGGG. \",
663 \" .GGGGGG. \",
664 \" ........ \",
665 \" .RRRRRR. \",
666 \" .RRRRRR. \",
667 \" .RRRRRR. \",
668 \" .RRRRRR. \",
669 \" .RRRRRR. \",
670 \" ........ \",
671 \" \",
672 \" \",
673 \" \",
674 \" \"};")
675 "The Stack Up icon.")
676
677 (defvar idlwave-toolbar-stack-down-icon
678 (idlwave-toolbar-make-button
679 "/* XPM */
680 static char * file[] = {
681 \"28 28 5 1\",
682 \" c None s backgroundToolBarColor\",
683 \". s FgColor c #000000000000\",
684 \"_ c #FFFFFFFFFFFF\",
685 \"G c #0000BBBB0000\",
686 \"R c #FFFF00000000\",
687 \" \",
688 \" \",
689 \" \",
690 \" \",
691 \" \",
692 \" ........ \",
693 \" .______. \",
694 \" .______. \",
695 \" .______. \",
696 \" .______. \",
697 \" .______. \",
698 \" ........ \",
699 \" .GGGGGG. \",
700 \" .GGGGGG. \",
701 \" .GGGGGG. \",
702 \" .GGGGGG. ... \",
703 \" .GGGGGG. ... \",
704 \" ........ ... \",
705 \" .RRRRRR. ... \",
706 \" .RRRRRR. ... \",
707 \" .RRRRRR. ....... \",
708 \" .RRRRRR. ..... \",
709 \" .RRRRRR. ... \",
710 \" ........ . \",
711 \" \",
712 \" \",
713 \" \",
714 \" \"};")
715 "The Stack Down icon.")
716
717 (defvar idlwave-toolbar-reset-icon
718 (idlwave-toolbar-make-button
719 "/* XPM */
720 static char * file[] = {
721 \"28 28 3 1\",
722 \" c None s backgroundToolBarColor\",
723 \"G c #0000BBBB0000\",
724 \". c #000000000000\",
725 \" \",
726 \" \",
727 \" \",
728 \" . \",
729 \" .G. . \",
730 \" .GGG.. .G. \",
731 \" .GGGGG..GG. \",
732 \" ..GGGGGGGG. \",
733 \" ..GGGGGG. \",
734 \" ..GGGGG. \",
735 \" .GGGGGG. \",
736 \" .G...... \",
737 \" \",
738 \" ..... \",
739 \" ......... \",
740 \" ......... \",
741 \" ......... \",
742 \" . ..... . \",
743 \" . . \",
744 \" . . \",
745 \" . . \",
746 \" . . \",
747 \" . . \",
748 \" .. .. \",
749 \" ....... \",
750 \" ..... \",
751 \" \",
752 \" \"};")
753 "The Reset icon.")
754
755 (defvar idlwave-toolbar-electric-debug-icon
756 (idlwave-toolbar-make-button
757 "/* XPM */
758 static char * file[] = {
759 \"28 28 8 1\",
760 \" c None s backgroundToolBarColor\",
761 \". c #CFC854\",
762 \"+ c #EEDB0E\",
763 \"@ c #D2C739\",
764 \"# c #A39C54\",
765 \"$ c #CDC020\",
766 \"% c #020202\",
767 \"& c #D60E36\",
768 \" \",
769 \" \",
770 \" .. \",
771 \" +++++@ \",
772 \" ++++++ \",
773 \" +++++@ \",
774 \" +++++ \",
775 \" #++++@ \",
776 \" $+++@ %% %% \",
777 \" ++++++$ % % \",
778 \" #+++++$ % % \",
779 \" #++$# %%% \",
780 \" #+++ %%%%%%% \",
781 \" .++ %%%%%%%%%%% \",
782 \" ++$$ %%%%%%%%%%% \",
783 \" .+@# &&%%%%%%%&& \",
784 \" .++++# &&&&&%%%&&&&& \",
785 \" +++++$ &&%%&&&&&%%&& \",
786 \" $+++$ &&%%&&&&&%%&& \",
787 \" $++@ &&&&&&%&&&&&& \",
788 \" $+@ &&&&&&%&&&&&& \",
789 \" @+ &&%%&&&&&%%&& \",
790 \" ++. &%%&&%&&%%& \",
791 \" +. &&&&%%%&&&& \",
792 \" .+ &&%%%%%&& \",
793 \" ++ %%%%%%% \",
794 \" . %%% \",
795 \" \"};")
796 "The electric debug icon.")
797
798 (defvar idlwave-toolbar
799 '(
800 [idlwave-toolbar-compile-icon
801 idlwave-shell-save-and-compile
802 t
803 "Save and Compile this file (or recompile last)"]
804 [idlwave-toolbar-next-error-icon
805 idlwave-shell-goto-next-error
806 t
807 "Goto Next Error"]
808 [idlwave-toolbar-stop-at-icon
809 idlwave-shell-break-here
810 (derived-mode-p 'idlwave-mode)
811 "Set Breakpoint at selected position"]
812 [idlwave-toolbar-clear-at-icon
813 idlwave-shell-clear-current-bp
814 t
815 "Clear Breakpoint at selected position"]
816 [idlwave-toolbar-clear-all-icon
817 idlwave-shell-clear-all-bp
818 t
819 "Clear all Breakpoints"]
820 [idlwave-toolbar-stop-beginning-icon
821 idlwave-shell-break-this-module
822 (derived-mode-p 'idlwave-mode)
823 "Stop at beginning of enclosing Routine"]
824 [idlwave-toolbar-stop-in-icon
825 idlwave-shell-break-in
826 t
827 "Stop in Routine with name near point"]
828 [idlwave-toolbar-edit-cmd-icon
829 idlwave-shell-edit-default-command-line
830 t
831 "Edit Default Command Line"]
832 [idlwave-toolbar-run-icon
833 idlwave-shell-execute-default-command-line
834 t
835 "Reset, then Execute Default Command Line"]
836 [idlwave-toolbar-cont-icon
837 idlwave-shell-cont
838 t
839 "Continue Current Program"]
840 [idlwave-toolbar-to-here-icon
841 idlwave-shell-to-here
842 (derived-mode-p 'idlwave-mode)
843 "Continue to Here (cursor position)"]
844 [idlwave-toolbar-step-over-icon
845 idlwave-shell-stepover
846 t
847 "Step Over (aka next)"]
848 [idlwave-toolbar-step-into-icon
849 idlwave-shell-step
850 t
851 "Step Into (aka step)"]
852 [idlwave-toolbar-step-out-icon
853 idlwave-shell-out
854 t
855 "Step Out (of subroutine)"]
856 [idlwave-toolbar-eval-icon
857 idlwave-shell-print
858 t
859 "Print Expression at or before Point"]
860 [idlwave-toolbar-stack-up-icon
861 idlwave-shell-stack-up
862 t
863 "Stack Up (towards \"cooler\" - less recently visited - frames)"]
864 [idlwave-toolbar-stack-down-icon
865 idlwave-shell-stack-down
866 t
867 "Stack Down (towards \"warmer\" - more recently visited - frames)"]
868 [idlwave-toolbar-reset-icon
869 idlwave-shell-reset
870 t
871 "Reset IDL (RETALL & CLOSE,/ALL and more)"]
872 [idlwave-toolbar-electric-debug-icon
873 idlwave-shell-electric-debug-mode
874 (derived-mode-p 'idlwave-mode)
875 "Toggle Electric Debug Mode"]
876 ))
877
878 ;; When the shell exits, arrange to remove the special toolbar everywhere.
879 (add-hook 'idlwave-shell-cleanup-hook
880 'idlwave-toolbar-remove-everywhere)
881 );; End can define toolbar
882
883 (defun idlwave-toolbar-add ()
884 "Add the IDLWAVE toolbar if appropriate."
885 (if (and (featurep 'xemacs) ; This is a noop on Emacs
886 (boundp 'idlwave-toolbar-is-possible)
887 (derived-mode-p 'idlwave-mode 'idlwave-shell-mode))
888 (set-specifier default-toolbar (cons (current-buffer)
889 idlwave-toolbar))))
890
891 (defun idlwave-toolbar-remove ()
892 "Add the IDLWAVE toolbar if appropriate."
893 (if (and (featurep 'xemacs) ; This is a noop on Emacs
894 (boundp 'idlwave-toolbar-is-possible)
895 (derived-mode-p 'idlwave-mode 'idlwave-shell-mode))
896 (remove-specifier default-toolbar (current-buffer))))
897
898 (defvar idlwave-shell-mode-map)
899 (defvar idlwave-mode-map)
900 (defvar idlwave-toolbar-visible nil)
901 (defun idlwave-toolbar-add-everywhere ()
902 "Add the toolbar in all appropriate buffers."
903 (when (boundp 'idlwave-toolbar-is-possible)
904
905 ;; First make sure new buffers will get the toolbar
906 (add-hook 'idlwave-mode-hook 'idlwave-toolbar-add)
907 ;; Then add it to all existing buffers
908 (if (featurep 'xemacs)
909 ;; For XEmacs, map over all buffers to add toolbar
910 (save-excursion
911 (mapcar (lambda (buf)
912 (set-buffer buf)
913 (idlwave-toolbar-add))
914 (buffer-list)))
915 ;; For Emacs, add the key definitions to the mode maps
916 (mapc (lambda (x)
917 (let* ((icon (aref x 0))
918 (func (aref x 1))
919 (show (aref x 2))
920 (help (aref x 3))
921 (key (vector 'tool-bar func))
922 (def (list 'menu-item
923 "a"
924 func
925 :image (symbol-value icon)
926 :visible show
927 :help help)))
928 (define-key idlwave-mode-map key def)
929 (define-key idlwave-shell-mode-map key def)))
930 (reverse idlwave-toolbar)))
931 (setq idlwave-toolbar-visible t)))
932
933 (defun idlwave-toolbar-remove-everywhere ()
934 "Remove the toolbar in all appropriate buffers."
935 ;; First make sure new buffers won't get the toolbar
936 (when idlwave-toolbar-is-possible
937 (remove-hook 'idlwave-mode-hook 'idlwave-toolbar-add)
938 ;; Then remove it in all existing buffers.
939 (if (featurep 'xemacs)
940 ;; For XEmacs, map over all buffers to remove toolbar
941 (save-excursion
942 (mapcar (lambda (buf)
943 (set-buffer buf)
944 (idlwave-toolbar-remove))
945 (buffer-list)))
946 ;; For Emacs, remove the key definitions from the mode maps
947 (mapc (lambda (x)
948 (let* (;;(icon (aref x 0))
949 (func (aref x 1))
950 ;;(show (aref x 2))
951 ;;(help (aref x 3))
952 (key (vector 'tool-bar func)))
953 (define-key idlwave-mode-map key nil)
954 (define-key idlwave-shell-mode-map key nil)))
955 idlwave-toolbar))
956 (setq idlwave-toolbar-visible nil)))
957
958 (defun idlwave-toolbar-toggle (&optional force-on)
959 (interactive)
960 (if idlwave-toolbar-visible
961 (or force-on (idlwave-toolbar-remove-everywhere))
962 (idlwave-toolbar-add-everywhere))
963 ;; Now make sure this
964 (if (featurep 'xemacs)
965 nil ; no action necessary, toolbar gets updated automatically
966 ;; On Emacs, redraw the frame to make sure the Toolbar is updated.
967 (redraw-frame (selected-frame))))
968
969 (provide 'idlw-toolbar)
970 (provide 'idlwave-toolbar)
971
972 ;; arch-tag: ec9a3717-c44c-4716-9bda-cdacbe5ddb62
973 ;;; idlw-toolbar.el ends here