beautypg.com

Command="script, Arguments="argument_list – Adobe Extending Dreamweaver CS4 User Manual

Page 190

background image

184

EXTENDING DREAMWEAVER CS4

Toolbars

onEveryIdle

executes regularly when the application is idle. This can be time-consuming because the

enabler/checked/showif/value

handlers are running often. It should be used only for buttons that need to have

their enable state changed at special times, and handlers should be quick.

Note: In all these cases, Dreamweaver actually executes the handlers after the specified event occurs, when the
application is in a quiescent state. It is not guaranteed that your handlers run after every edit or selection change; your
handlers run soon after a batch of edits or selection changes occur. The handlers are guaranteed to run when the user
clicks on a toolbar item.

Example

update="onViewChange"

command="script"

This attribute is required for all items except menu buttons. Dreamweaver ignores the

command

attribute for menu

buttons. Specifies the JavaScript function to execute when the user performs one of the following actions:

Clicks a button

Selects an item from a pop-up menu or combo box

Tabs out of, presses Return in, or clicks away from a text box or combo box

Selects a color from a color picker

The

command

attribute is equivalent to the

receiveArguments()

function in a toolbar command file.

Example

command="dw.toggleLiveDebug()"

arguments="argument_list"

Optional. This 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 that has Undo and Redo buttons, each button calls the menu commands file, Edit_Clipboard.htm, and
passes an argument that specifies the action, as shown in the following example:

This manual is related to the following products: