beautypg.com

Windowdimensions() – Adobe Extending Dreamweaver CS4 User Manual

Page 251

background image

245

EXTENDING DREAMWEAVER CS4

Behaviors

Example
The following instance of the

inspectBehavior()

function, taken from the Display Status Message.htm file, fills in

the Message field in the Parameters dialog box with the message that the user selected when the behavior was originally
applied:

function inspectBehavior(msgStr){

var startStr = msgStr.indexOf("'") + 1;
var endStr = msgStr.lastIndexOf("'");
if (startStr > 0 && endStr > startStr) {

document.theForm.message.value = ¬
unescQuotes(msgStr.substring(startStr,endStr));

}

}

Note: For more information about the

unescQuotes()

function, see the dwscripts.js file in the

Configuration/Shared/Common/Scripts/CMN folder.

windowDimensions()

Description
This function 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 Parameters 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 platform of the user.

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.

Example
The following instance of

windowDimensions()

sets the dimensions of the Parameters dialog box to 648 x 520 pixels:

function windowDimensions(){

return "648,520";

}

This manual is related to the following products: