(describe-variable): Improve blank separator lines.
[emacs.git] / lisp / progmodes / idlw-toolbar.el
blob28d184bfac439755273e8161cef9fef8cbf98a83
1 ;;; idlw-toolbar.el --- a debugging toolbar for IDLWAVE
2 ;; Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
3 ;; Free Software Foundation
5 ;; Author: Carsten Dominik <dominik@astro.uva.nl>
6 ;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
7 ;; Version: 6.1_em22
8 ;; Keywords: processes
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
27 ;;; Commentary:
29 ;; This file implements a debugging toolbar for IDLWAVE. It requires
30 ;; Emacs or XEmacs with toolbar and xpm support.
32 ;; New versions of IDLWAVE, documentation, and more information
33 ;; available from:
34 ;; http://idlwave.org
37 ;;; Code:
39 (eval-when-compile (require 'cl))
41 (defun idlwave-toolbar-make-button (image)
42 (if (featurep 'xemacs)
43 (toolbar-make-button-list image)
44 (list 'image :type 'xpm :data image)))
46 (defvar idlwave-toolbar)
47 (defvar default-toolbar)
48 (defvar idlwave-toolbar-is-possible)
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
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
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.")
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.")
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.")
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.")
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.")
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.")
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.")
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")
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.")
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.")
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.")
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.")
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.")
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.")
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.")
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.")
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.")
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.")
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.")
798 (defvar idlwave-toolbar
800 [idlwave-toolbar-compile-icon
801 idlwave-shell-save-and-compile
803 "Save and Compile this file (or recompile last)"]
804 [idlwave-toolbar-next-error-icon
805 idlwave-shell-goto-next-error
807 "Goto Next Error"]
808 [idlwave-toolbar-stop-at-icon
809 idlwave-shell-break-here
810 (eq major-mode 'idlwave-mode)
811 "Set Breakpoint at selected position"]
812 [idlwave-toolbar-clear-at-icon
813 idlwave-shell-clear-current-bp
815 "Clear Breakpoint at selected position"]
816 [idlwave-toolbar-clear-all-icon
817 idlwave-shell-clear-all-bp
819 "Clear all Breakpoints"]
820 [idlwave-toolbar-stop-beginning-icon
821 idlwave-shell-break-this-module
822 (eq major-mode 'idlwave-mode)
823 "Stop at beginning of enclosing Routine"]
824 [idlwave-toolbar-stop-in-icon
825 idlwave-shell-break-in
827 "Stop in Routine with name near point"]
828 [idlwave-toolbar-edit-cmd-icon
829 idlwave-shell-edit-default-command-line
831 "Edit Default Command Line"]
832 [idlwave-toolbar-run-icon
833 idlwave-shell-execute-default-command-line
835 "Reset, then Execute Default Command Line"]
836 [idlwave-toolbar-cont-icon
837 idlwave-shell-cont
839 "Continue Current Program"]
840 [idlwave-toolbar-to-here-icon
841 idlwave-shell-to-here
842 (eq major-mode 'idlwave-mode)
843 "Continue to Here (cursor position)"]
844 [idlwave-toolbar-step-over-icon
845 idlwave-shell-stepover
847 "Step Over (aka next)"]
848 [idlwave-toolbar-step-into-icon
849 idlwave-shell-step
851 "Step Into (aka step)"]
852 [idlwave-toolbar-step-out-icon
853 idlwave-shell-out
855 "Step Out (of subroutine)"]
856 [idlwave-toolbar-eval-icon
857 idlwave-shell-print
859 "Print Expression at or before Point"]
860 [idlwave-toolbar-stack-up-icon
861 idlwave-shell-stack-up
863 "Stack Up (towards \"cooler\" - less recently visited - frames)"]
864 [idlwave-toolbar-stack-down-icon
865 idlwave-shell-stack-down
867 "Stack Down (towards \"warmer\" - more recently visited - frames)"]
868 [idlwave-toolbar-reset-icon
869 idlwave-shell-reset
871 "Reset IDL (RETALL & CLOSE,/ALL and more)"]
872 [idlwave-toolbar-electric-debug-icon
873 idlwave-shell-electric-debug-mode
874 (eq major-mode 'idlwave-mode)
875 "Toggle Electric Debug Mode"]
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
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 (or (eq major-mode 'idlwave-mode)
888 (eq major-mode 'idlwave-shell-mode)))
889 (set-specifier default-toolbar (cons (current-buffer)
890 idlwave-toolbar))))
892 (defun idlwave-toolbar-remove ()
893 "Add the IDLWAVE toolbar if appropriate."
894 (if (and (featurep 'xemacs) ; This is a noop on Emacs
895 (boundp 'idlwave-toolbar-is-possible)
896 (or (eq major-mode 'idlwave-mode)
897 (eq major-mode 'idlwave-shell-mode)))
898 (remove-specifier default-toolbar (current-buffer))))
900 (defvar idlwave-shell-mode-map)
901 (defvar idlwave-mode-map)
902 (defvar idlwave-toolbar-visible nil)
903 (defun idlwave-toolbar-add-everywhere ()
904 "Add the toolbar in all appropriate buffers."
905 (when (boundp 'idlwave-toolbar-is-possible)
907 ;; First make sure new buffers will get the toolbar
908 (add-hook 'idlwave-mode-hook 'idlwave-toolbar-add)
909 ;; Then add it to all existing buffers
910 (if (featurep 'xemacs)
911 ;; For XEmacs, map over all buffers to add toolbar
912 (save-excursion
913 (mapcar (lambda (buf)
914 (set-buffer buf)
915 (idlwave-toolbar-add))
916 (buffer-list)))
917 ;; For Emacs, add the key definitions to the mode maps
918 (mapcar (lambda (x)
919 (let* ((icon (aref x 0))
920 (func (aref x 1))
921 (show (aref x 2))
922 (help (aref x 3))
923 (key (vector 'tool-bar func))
924 (def (list 'menu-item
926 func
927 :image (symbol-value icon)
928 :visible show
929 :help help)))
930 (define-key idlwave-mode-map key def)
931 (define-key idlwave-shell-mode-map key def)))
932 (reverse idlwave-toolbar)))
933 (setq idlwave-toolbar-visible t)))
935 (defun idlwave-toolbar-remove-everywhere ()
936 "Remove the toolbar in all appropriate buffers."
937 ;; First make sure new buffers won't get the toolbar
938 (when idlwave-toolbar-is-possible
939 (remove-hook 'idlwave-mode-hook 'idlwave-toolbar-add)
940 ;; Then remove it in all existing buffers.
941 (if (featurep 'xemacs)
942 ;; For XEmacs, map over all buffers to remove toolbar
943 (save-excursion
944 (mapcar (lambda (buf)
945 (set-buffer buf)
946 (idlwave-toolbar-remove))
947 (buffer-list)))
948 ;; For Emacs, remove the key definitions from the mode maps
949 (mapcar (lambda (x)
950 (let* (;;(icon (aref x 0))
951 (func (aref x 1))
952 ;;(show (aref x 2))
953 ;;(help (aref x 3))
954 (key (vector 'tool-bar func)))
955 (define-key idlwave-mode-map key nil)
956 (define-key idlwave-shell-mode-map key nil)))
957 idlwave-toolbar))
958 (setq idlwave-toolbar-visible nil)))
960 (defun idlwave-toolbar-toggle (&optional force-on)
961 (interactive)
962 (if idlwave-toolbar-visible
963 (or force-on (idlwave-toolbar-remove-everywhere))
964 (idlwave-toolbar-add-everywhere))
965 ;; Now make sure this
966 (if (featurep 'xemacs)
967 nil ; no action necessary, toolbar gets updated automatically
968 ;; On Emacs, redraw the frame to make sure the Toolbar is updated.
969 (redraw-frame (selected-frame))))
971 (provide 'idlw-toolbar)
972 (provide 'idlwave-toolbar)
974 ;; arch-tag: ec9a3717-c44c-4716-9bda-cdacbe5ddb62
975 ;;; idlw-toolbar.el ends here