Adobe Extending Dreamweaver CS4 Manual do Utilizador Página 170

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 387
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 169
164
EXTENDING DREAMWEAVER CS4
Menus and menu commands
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 passed from a menu item or from the dw.runCommand() function. 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 the getDynamicContents() function specifies 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 162, “isCommandChecked()” on
page 163, and setMenuText()” on page 165 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 nothing.
Example
function receiveArguments()
{
var styleName = arguments[0];
if (styleName == "(None)")
dw.getDocumentDOM('document').applyCSSStyle('','');
else
dw.getDocumentDOM('document').applyCSSStyle('',styleName);
}
Vista de página 169
1 2 ... 165 166 167 168 169 170 171 172 173 174 175 ... 386 387

Comentários a estes Manuais

Sem comentários