Setmenutext(), Windowdimensions() – Adobe Extending Dreamweaver CS4 User Manual
Page 171
165
EXTENDING DREAMWEAVER CS4
Menus and menu commands
setMenuText()
Description
Specifies the text that should appear in the menu.
Note: Do not use this function if you are using “
162.
Arguments
{arg1}, {arg2},...{argN}
If the
arguments
attribute is defined for a
menuitem
tag, the value of that attribute passes to the
setMenuText()
function (and to the “
” on page 163, and
” on page 164 functions) as one or more arguments. The
arguments
attribute is useful for
distinguishing between two menu items that call the same menu command.
Returns
Dreamweaver expects the string that should appear in the menu.
Example
function setMenuText()
{
if (arguments.length != 1) return "";
var whatToDo = arguments[0];
if (whatToDo == "undo")
return dw.getUndoText();
else if (whatToDo == "redo")
return dw.getRedoText();
else return "";
}
windowDimensions()
Description
Sets specific dimensions for the Parameters dialog box. If this function is not defined, the window dimensions are
computed automatically.
Note: Do not define this function unless you want a dialog box that is larger than 640 x 480 pixels.
Arguments
platform
The value of the platform argument is either
"macintosh"
or
"windows"
, depending on the user’s platform.
Returns
Dreamweaver expects a string of the form
"widthInPixels,heightInPixels"
.
The returned dimensions are smaller than the size of the entire dialog box because they do not include the area for the
OK and Cancel buttons. If the returned dimensions do not accommodate all options, scroll bars appear.