1 ;; 09-toolbar.el --- Toolbar set up
3 ;; Copyright (C) 2007 - 2021 Steve Youngs
5 ;; Author: Steve Youngs <steve@sxemacs.org>
6 ;; Maintainer: Steve Youngs <steve@sxemacs.org>
7 ;; Created: <2007-12-02>
8 ;; Time-stamp: <Monday 12 Apr 2021 13:43:01 (steve)>
9 ;; Download: <https://downloads.sxemacs.org/SYinits>
10 ;; HTMLised: <https://www.sxemacs.org/SYinits/09-toolbar.html>
11 ;; Git Repo: git clone https://git.sxemacs.org/syinit
12 ;; Keywords: init, compile
14 ;; This file is part of SYinit
16 ;; Redistribution and use in source and binary forms, with or without
17 ;; modification, are permitted provided that the following conditions
20 ;; 1. Redistributions of source code must retain the above copyright
21 ;; notice, this list of conditions and the following disclaimer.
23 ;; 2. Redistributions in binary form must reproduce the above copyright
24 ;; notice, this list of conditions and the following disclaimer in the
25 ;; documentation and/or other materials provided with the distribution.
27 ;; 3. Neither the name of the author nor the names of any contributors
28 ;; may be used to endorse or promote products derived from this
29 ;; software without specific prior written permission.
31 ;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
32 ;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
33 ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
34 ;; DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
35 ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
36 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
38 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
39 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
40 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
41 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45 ;; Sets up the toolbar the way I like it.
49 ;; The HTML version of this file was created with Hrvoje Niksic's
50 ;; htmlize.el which is part of the XEmacs "text-modes" package.
58 ;; Re-organise the default toolbar.
59 (when (featurep 'toolbar)
61 toolbar-info-use-separate-frame t
62 toolbar-mail-reader 'gnus
63 toolbar-news-use-separate-frame t)
64 (customize-set-variable 'toolbar-captioned-p nil))
66 (setq edit-toolbar-added-buttons-alist 'nil)
70 (setf (symbol-value (car cons)) (toolbar-make-button-list (cdr cons))))
71 edit-toolbar-added-buttons-alist)
73 (defun toolbar-redo ()
75 (call-interactively #'redo))
77 (defvar toolbar-redo-icon
78 (toolbar-make-button-list
79 (locate-data-file "redo.png")))
83 (call-interactively #'sy-riece))
85 (defvar toolbar-irc-icon
86 (toolbar-make-button-list
87 (locate-data-file "irc@32x32.png")))
89 (defun toolbar-emoney ()
91 (call-interactively #'emoney))
93 (defvar toolbar-emoney-icon
94 (toolbar-make-button-list
95 (locate-data-file "emoney.png")))
97 (and (device-on-window-system-p)
100 '([toolbar-file-icon toolbar-open t "Open a file"]
101 [toolbar-folder-icon toolbar-dired t "Edit a directory"]
102 [toolbar-disk-icon toolbar-save t "Save buffer"]
103 [toolbar-printer-icon toolbar-print t "Print buffer"]
104 [toolbar-cut-icon toolbar-cut t "Kill region"]
105 [toolbar-copy-icon toolbar-copy t "Copy region"]
106 [toolbar-paste-icon toolbar-paste t "Paste from clipboard"]
107 [toolbar-undo-icon toolbar-undo t "Undo"]
108 [toolbar-redo-icon toolbar-redo t "Redo"]
109 [toolbar-spell-icon toolbar-ispell t "Check spelling"]
110 [toolbar-replace-icon toolbar-replace t "Search & Replace"]
111 [toolbar-compile-icon toolbar-compile t "Start a compilation"]
112 [toolbar-debug-icon toolbar-debug t "Start a debugger"]
113 [toolbar-emoney-icon toolbar-emoney t "Manage your millions with eMoney"]
114 [toolbar-irc-icon toolbar-irc t "Be productive with Riece"]
115 [toolbar-news-icon gnus-other-frame t "Gnus"]
117 [toolbar-info-icon toolbar-info t "Don't Panic!!"])))
118 ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
119 (message "Toolbar set successfully")