The Toolbar Command Api Functions - Adobe 38040334 - Dreamweaver CS3 User Manual

Extending dreamweaver
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

_
<button id="DW
Undo"
image="Toolbars/images/MM/undo.gif"
disabledImage="Toolbars/images/MM/undo
tooltip="Undo"
_
file="Menus/MM/Edit
arguments="'undo'"
update="onEveryIdle"/>
_
<button id="DW
Redo"
image="Toolbars/images/MM/redo.gif"
disabledImage="Toolbars/images/MM/redo
tooltip="Redo"
_
file="Menus/MM/Edit
arguments="'redo'"
update="onEveryIdle"/>

The toolbar command API functions

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 action 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 commands file API, so you can reuse menu
commands files directly as toolbar command files, perhaps with some additional functions that are specific to
toolbars.
canAcceptCommand()
Availability
Dreamweaver MX.
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 a
Arguments
For pop-up menus, combo boxes, text boxes, and color pickers, the first argument is the current value within the
control. The
getDynamicContent()
If the selected item in the pop-up menu has an ID attached, Dreamweaver passes that ID to
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.
If you specify the
arguments
If you did not specify the
arguments
Returns
Dreamweaver expects a Boolean value;
_
dis.gif"
Clipboard.htm"
_
dis.gif"
Clipboard.htm"
value in at least one case.
false
function can optionally attach individual IDs to items within a pop-up menu.
attribute for this toolbar item in the toolbars.xml file, those arguments are passed next.
attribute, Dreamweaver passes the ID of the item.
if the item is enabled;
true
canAcceptCommand()
otherwise.
false
DREAMWEAVER CS3
180
Extending Dreamweaver

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents