Specifications
To o l b a r s 79
How toolbar commands work
When Dreamweaver draws a toolbar, the following events occur:
1 For each toolbar control item, Dreamweaver determines whether the file attribute exists.
2 If the file attribute exists, Dreamweaver calls canAcceptCommand() to determine whether it
should enable the control in the current context of the document.
For the Document Title text box in the Dreamweaver toolbar, for example,
canAcceptCommand() checks to see if there is a current DOM and if the current document is
an HTML file. If both these conditions are true, the function returns
true and Dreamweaver
enables the text box on the toolbar.
3 If the file attribute exists, Dreamweaver ignores the following attributes, if they are specified:
checked, command, DOMRequired, enabled, script, showif, update, and value.
4 If the file attribute does not exist, Dreamweaver processes the attributes that are set for the
toolbar control item:
checked, command, DomRequired, and so on.
For more information on specific item tag attributes, see “Item Tag Attributes” on page 88.
5 Dreamweaver calls the getCurrentValue() function on every update cycle, as specified by the
update attribute, to determine what value to display for the control.
6 The user selects an item on the toolbar.
7 Dreamweaver calls the receiveArguments() function to process any arguments that are
specified by the
arguments attribute of the toolbar item.
For more information on the purpose of specific functions in the Toolbar Command API, see
“The Toolbar Command API” on page 93.
The toolbar definition file
A toolbar is simply a list of toolbar items, optionally separated by separators. Each toolbar item
can be either a reference to an item using the
itemref tag, a separator using the separator tag,
or a complete toolbar item definition, as described in “To o lb a r it em t a gs” on page 83.
Each toolbar definition file starts with the following declarations:
<?xml version="1.0" encoding="optional_encoding"?>
<!DOCTYPE toolbarset SYSTEM "-//Macromedia//DWExtension toolbar 5.0">
If the encoding is omitted, Dreamweaver defaults to the default encoding of the operating system.