Specifications
Chapter 770
isCommandChecked()
Description
Determines whether to display a check mark next to the menu item
Arguments
{arg1}, {arg2},...{argN}
If it is a dynamic menu item, the unique ID given in getDynamicContents() is the only
argument. Otherwise, if the
arguments attribute is defined for a menuitem tag, the value of that
attribute passes to the
isCommandChecked() function (and to the “canAcceptCommand()” on
page 68
, “receiveArguments()” on page 70, and “setMenuText()” on page 71 functions)
as one or more arguments. The
arguments attribute is useful for distinguishing between two
menu items that call the same menu command.
Note: The arguments attribute is ignored for dynamic menu items.
Returns
Dreamweaver expects a Boolean value that indicates whether a check mark should appear next to
the menu item.
Example
function isCommandChecked()
{
var bChecked = false;
var cssStyle = arguments[0];
if (dw.getDocumentDOM() == null)
return false;
if (cssStyle == "(None)")
{
return dw.cssStylePalette.getSelectedStyle() == '';
}
else
{
return dw.cssStylePalette.getSelectedStyle() == cssStyle;
}
return bChecked;
}
receiveArguments()
Description
Processes any arguments that are passed from a menu item or from dw.runCommand(). If it is a
dynamic menu item, it processes the dynamic menu item ID.
Arguments
{arg1}, {arg2},...{argN}
If it is a dynamic menu item, the unique ID that is given in getDynamicContents() is the only
argument. Otherwise, if the
arguments attribute is defined for a menuitem tag, the value of that
attribute passes to the
receiveArguments() function (and to the “canAcceptCommand()” on
page 68
, “isCommandChecked()” on page 70, and “setMenuText()” on page 71 functions)
as one or more arguments. The
arguments attribute is useful for distinguishing between two
menu items that call the same menu command.
Note: The arguments attribute is ignored for dynamic menu items.