beautypg.com

Dom.gettoolbaritemvalue(), Dom.gettoolbarlabel() – Adobe Dreamweaver API Reference CS5 User Manual

Page 178

background image

173

DREAMWEAVER API REFERENCE

Workspace

Last updated 8/27/2013

var tb_ids = new Array();

tb_ids = dom.getToolbarIdArray();

dom.getToolbarItemValue()

Availability
Dreamweaver MX 2004.

Description
Gets the value of the specified toolbar item.

Arguments
toolbarID, itemID

The toolbarID argument is a string that specifies the ID of the toolbar that contains the item for which you want a
value.

The itemID argument is a string that specifies the ID of the item for which you want the value.

Returns
A string that represents the value of the toolbar item.

Example
The following example of

receiveArguments()

is in a toolbar command that controls the behavior of a Size text field;

it gets the value of the Size field as an argument and then reads the value of the Units field in order to produce a valid
value for the CSS property

font-size

function:

receiveArguments(newSize){

var dom = dw.getDocumentDOM();
if (newSize != ""){

dom.applyFontMarkupAsStyle('font-size', newSize +
dom.getToolbarItemValue("DW_Toolbar_Text","DW_Text_Units"));
}

else{

dom.removeFontMarkupAsStyle('font-size');
}

}

dom.getToolbarLabel()

Availability
Dreamweaver MX.

Description
This function obtains the label of the specified toolbar. You can use

dom.getToolbarLabel()

for menus that show

or hide toolbars.