[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The toolbar utilities are a set of Emacs commands and Lisp functions for convenient creation and management of toolbars. Common usages such as creating and adding toolbar buttons to invoke commands and keyboard macros are implemented as user commands. Convenience APIs are provided to create buttons, add them to toolbars, kill them from toolbars, and finding a particular button, or a button with certain content, in a toolbar.
The toolbar utilities are implemented in three files:
The toolbar utility APIs and user commands.
The near-WYSIWYG toolbar editor by Peter D. Pezaris.
The XEmacs compatibility API for programs that should also run under GNU Emacs.
The author would like to thank Jeff Miller and Peter D. Pezaris for the original API and the toolbar editor, respectively, and David Kastrup and Jamie Zawinski for the pedal-gluteal impetus that resulted in the recent revision of these libraries described in this manual.
39.1 Adding Buttons on the Fly | Quick and convenient. | |
39.2 The Toolbar Editor | Power tools for customization. | |
39.3 APIs for Adding and Killing | For Lisp programmers. | |
39.4 APIs for Search | Button, button, who's got the button? | |
39.5 Toolbar API Portability to GNU Emacs | The `xemacs-toolbar.el' library. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Customize group of tools for interactive editing and non-interactive management of toolbars.
left
, right
, or
extreme-right
. left
is synonymous with 0, and
extreme-right
is synonymous with (length toolbar)
.
right
specifies placing a new item at the right end of the
flush-left group of buttons.
Default value: right
. Customize type: sexp.
See also `toolbar-add-button', 39.3 APIs for Adding and Killing.
Add an button at position to the default toolbar of the selected
window. Returns t
.
The return value may change. Tell stephen@xemacs.org what value you think would be (most) useful.
left
, right
, or extreme-right
.
Default: right
.
global
. It's safe and probably does what
you want.
nil
, it is interpreted as the name of an image file, and
searched for using locate-data-file
. Otherwise it is used
verbatim as a label.
Used interactively, prompts for the macro name mac and an
icon. is-file is non-nil
if a prefix argument was
used.
Add a button to the global toolbar to execute the last keyboard macro.
Unlike toolbar-add-kbd-macro
, this does not copy the macro. The
macro executed will change with redefinitions.
Due to a simple implementation, this button will not appear in buffers with local toolbars if invoked after the toolbar is installed. If you like this button, it's probably best to invoke this function in your init file.
initial-toolbar-spec
.
There is also a cache of killed buttons in button-palette
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To use `edit-toolbar.el', simply type M-x edit-toolbar RET.
For help on the various commands you can type ? in a `edit-toolbar' buffer. To save a modified toolbar type C-x C-s in an `edit-toolbar' buffer. If you want to use a saved toolbar in your future XEmacs sessions, add the following line of code to your init file:
(load "~/.xemacs/.toolbar") |
Here is a table of commands and bindings available in `edit-toolbar-mode'. These commands are also available from the `Edit Toolbar' menu.
`edit-toolbar-quit': Bury the `edit-toolbar' buffer.
`edit-toolbar-previous': Select the previous item (line).
`edit-toolbar-next': Select the next item (line).
`describe-mode': Help.
`edit-toolbar-set-function': Set the command for the current button.
`edit-toolbar-set-help': Set the help string for the current button.
`edit-toolbar-add-button': Add a new empty button.
`edit-toolbar-add-separator-2D-narrow': Add a new narrow 2D fixed-width spacer.
`edit-toolbar-add-separator-2D-wide': Add a new wide 2D fixed-width spacer.
`edit-toolbar-add-separator-3D-narrow': Add a new narrow 3D fixed-width spacer.
`edit-toolbar-add-separator-3D-wide': Add a new wide 3D fixed-width spacer.
`edit-toolbar-add-separator-right-left': Place the filler separator, which expands to create a flush-left group of buttons and spacers and a flush-right group.
`edit-toolbar-copy': Copy the selected button.
`edit-toolbar-down': Reorder the buttons by moving the selected button down (to the right on a horizontal toolbar).
`edit-toolbar-up': Reorder the buttons by moving the selected button up (to the left on a horizontal toolbar).
`edit-toolbar-kill': Kill the selected button.
`edit-toolbar-save': Save the current buffer to `~/.xemacs/.toolbar' in a format that allows it to be reloaded.
`edit-toolbar-restore': Restore the original toolbar (ie, before this editing session started).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Note this is actually a toolbar descriptor.
toolbar-new-button
or toolbar-new-spacer
).
toolbar-new-toolbar
).
left
, right
, and extreme-right
are also accepted.
left
is synonymous with 0. right
places item at the
right end of the left group of buttons. extreme-right
places
item at the extreme right of the toolbar, creating a right group
if one does not exist.
#### This function does not yet support inserting the group delimiter nil as an explicit item.
position may be greater than (length toolbar-spec), in which
case it is truncated to (length toolbar-spec). Note that
(length toolbar-spec)
is not synonymous with right
or extreme-right
(extreme-right
will create a right group
if it doesn't already exist).
make-glyph
), a glyph, or a
string to use as the button's icon. If a string or single glyph, it will
be used for the button-up glyph. If a list, it may contain 1 to 6 glyphs,
which XEmacs will use for button up, button down, button disabled, button
up with caption, button down with caption, and button disabled with caption,
in that order. Missing or nil glyphs will be defaulted. (#### Strings as
list elements are not supported but could be.)
nil
, specifies that the button should initially
be disabled.
See default-toolbar
or the Lispref (@xref{Toolbars, , , lispref}) for more information.
2d
or 3d
, indicating whether the area is
displayed without shadows (giving it a flat appearance), or with shadows
(giving it a raised, 3-D appearance). There is no default.
#### We may set a default style. Tell stephen@xemacs.org which you use.
default-toolbar
), a toolbar specifier object, a symbol whose
value is a toolbar specifier object, or nil
. If nil
,
returns a null list. If a toolbar specifier object or variable
containing one, the specification for DOMAIN is used. If non-nil, DOMAIN
must be a window, a frame, or a device, otherwise it defaults to the selected
window (see specifier-instance
). The list thus generated is checked and
returned.
If toolbar-spec is a list, it is copied; it is safe to pass other packages' toolbar initializers to this function. However, you probably do not want to change any of the objects in the returned specification. They are returned as is, not copied.
See default-toolbar
or the Lispref (@xref{Toolbars, , , lispref}) for more information.
button-palette
.
locale defaults to global
. If there are multiple specs for
locale, take the first one.
This function currently does not accept symbolic positions a la
toolbar-add-item
. Use toolbar-find-item
to locate whole
buttons and spacers, and toolbar-find-button
to locate buttons by
characteristics. See also toolbar-find-button-by-icon
,
toolbar-find-button-by-command
, and
toolbar-find-button-by-help-string
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
nil
, search it; otherwise search the default toolbar.
nil
, get toolbar's descriptor in that locale,
otherwise use the global
locale.
If item is nil, find the separator between the group of buttons to be left justified, and the group to be right justified. If there are several matching items, the first is returned. If none is found, return nil.
If there are several matching buttons, the first is returned.
If there are several matching buttons, the first is returned.
Return the position of a button with help-string str. toolbar and locale determine the descriptor to be searched.
If there are several matching buttons, the first is returned. This function will not find spacers.
Optional argument thunk is a function of one argument which is used to normalize object for comparison.
If there are several matching buttons, the first is returned. This function will not find spacers.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The `xemacs-toolbar.el' library provides XEmacs toolbar compatibility functions for GNU Emacs.
Third-party maintainers may use the same APIs in GNU Emacs as in XEmacs. Simply provide this library with your own code, and load it conditionally:
(if (featurep 'xemacs) (require 'toolbar-utils) (require 'toolbar-utils "xemacs-toolbar")) |
XEmacs features that are not present in GNU Emacs will be ignored, and various arguments with different semantics will be defaulted appropriately.
User commands such as toolbar-add-kbd-macro
and advanced features
such as the toolbar editor and the button cache are not presently
provided.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by XEmacs shared group account on December, 19 2009
using texi2html 1.65.