MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Manual page 162

Extending dreamweaver
Hide thumbs Also See for DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER:
Table of Contents

Advertisement

canAcceptCommand()
Dreamweaver calls the
to determine whether it should be enabled or disabled. In the MyMenu.htm file, the
canAcceptCommand()
Dreamweaver is processing a Redo menu item or an Undo menu item. If the argument is
the
canAcceptCommand()
returned value, which is either
canAcceptCommand()
Dreamweaver. If the
the menu item for which it called the function. The following example shows the code for the
canAcceptCommand()
function canAcceptCommand()
{
var selarray;
if (arguments.length != 1) return false;
var bResult = false;
var whatToDo = arguments[0];
if (whatToDo == "undo")
{
bResult = dw.canUndo();
}
else if (whatToDo == "redo")
{
bResult = dw.canRedo();
}
return bResult;
}
receiveArguments()
Dreamweaver calls the
for the
menuitem
calls either the
dw.undo()
of the argument,
previous step that the user performed in the document window, dialog box, or panel that has
focus. The
dw.redo()
The
receiveArguments()
function receiveArguments()
{
if (arguments.length != 1) return;
var whatToDo = arguments[0];
if (whatToDo == "undo")
{
dw.undo();
}
else if (whatToDo == "redo")
{
dw.redo();
}
}
162
Chapter 8: Menus and Menu Commands
canAcceptCommand()
function checks the value of
function calls the enabler function
or
true
function calls the enabler function
canAcceptCommand()
function:
receiveArguments()
tag. For the Undo and Redo menu items, the
function or the
, is
arguments[0]
"undo"
function redoes the last operation that was undone.
function looks like the following example code:
function for each menu item in the MyMenu menu
arguments[0]
. Likewise, if the argument is
false
dw.canRedo()
function returns the value
function to process any arguments that you defined
function, depending on whether the value
dw.redo()
or
. The
"redo"
dw.undo()
to determine whether
and returns the
dw.canUndo()
, the
"redo"
, and returns its value to
, Dreamweaver dims
false
receiveArguments()
function undoes the
,
"undo"
function

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Dreamweaver mx 2004

Table of Contents