Specifications
To o l b a r s 93
arguments="argument_list"
Optional. The
arguments attribute specifies the comma-separated list of arguments to pass to
the
receiveArguments() function in a toolbar command file. If you do not specify the
arguments attribute, Dreamweaver passes the ID of the toolbar item. In addition, pop-up menus,
combo boxes,
text boxes, and color pickers pass their current value as the first argument, before
any arguments that the
arguments attribute specifies, and before the item ID if no arguments
are specified.
Example
On a toolbar with Undo and Redo buttons on it, each button calls the menu command file,
Edit_Clipboard.htm, and passes an argument that specifies the action.
<button id="DW_Undo"
image="Toolbars/images/MM/undo.gif"
disabledImage="Toolbars/images/MM/undo_dis.gif"
tooltip="Undo"
file="Menus/MM/Edit_Clipboard.htm"
arguments="’undo’"
update="onEveryIdle"/>
<button id="DW_Redo"
image="Toolbars/images/MM/redo.gif"
disabledImage="Toolbars/images/MM/redo_dis.gif"
tooltip="Redo"
file="Menus/MM/Edit_Clipboard.htm"
arguments="’redo’"
update="onEveryIdle"/>
The Toolbar Command API
In many cases where you specify a script for an attribute, you can also implement the attribute
through a JavaScript function in a command file. This is necessary when the functions need to
take arguments, as in the command handler for a text box. It is required for pop-up menus and
combo boxes.
The command file API for toolbar items is an extension of the menu command file API, so you
can reuse menu command files directly as toolbar command files, perhaps with some additional
functions that are specific to toolbars.
canAcceptCommand()
Description
Determines whether the toolbar item is enabled. The enabled state is the default condition for an
item, so you should not define this function unless it returns
false in at least one case.
Arguments
For pop-up menus, combo boxes, text boxes, and color pickers, the first argument is the current
value within the control. The
getDynamicContent() function can optionally attach individual
IDs to items within a pop-up menu. If the selected item in the pop-up menu has an ID attached,
Dreamweaver passes that ID to
canAcceptCommand() instead of the value. For combo boxes, if
the current contents of the text box do not match an entry in the pop-up menu, Dreamweaver
passes the contents of the text box. Dreamweaver compares against the pop-up menu without
case-sensitivity to determine whether the contents of the text box match an entry in the list.