Layout environment functions handle operations that are related to the settings for working on a document. They affect the source, position, and opacity of the tracing image; get and set the ruler origin and units; turn the grid on and off and change its settings; and start or stop playing plug‑ins.

dom.getRulerOrigin()

Availability

Dreamweaver 3.

Description

Gets the origin of the ruler.

Arguments

None.

Returns

An array of two integers. The first array item is the x coordinate of the origin, and the second array item is the y coordinate of the origin. Both values are in pixels.

dom.getRulerUnits()

Availability

Dreamweaver 3.

Description

Gets the current ruler units.

Arguments

None.

Returns

A string that contains one of the following values:

  • "in"

  • "cm"

  • "px"

dom.getTracingImageOpacity()

Availability

Dreamweaver 3.

Description

Gets the opacity setting for the document’s tracing image.

Arguments

None.

Returns

A value between 0 and 100, or nothing if no opacity is set.

Enabler

dom.loadTracingImage()

Availability

Dreamweaver 3.

Description

Opens the Select Image Source dialog box. If the user selects an image and clicks OK, the Page Properties dialog box opens with the Tracing Image field filled in.

Arguments

None.

Returns

Nothing.

dom.playAllPlugins()

Availability

Dreamweaver 3.

Description

Plays all plug-in content in the document.

Arguments

None.

Returns

Nothing.

dom.playPlugin()

Availability

Dreamweaver 3.

Description

Plays the selected plug-in item.

Arguments

None.

Returns

Nothing.

Enabler

dom.setRulerOrigin()

Availability

Dreamweaver 3.

Description

Sets the origin of the ruler.

Arguments

xCoordinate, yCoordinate

  • The xCoordinate argument is a value, expressed in pixels, on the horizontal axis.

  • The yCoordinate argument is a value, expressed in pixels, on the vertical axis.

Returns

Nothing.

dom.setRulerUnits()

Availability

Dreamweaver 3.

Description

Sets the current ruler units.

Arguments

units

  • The units argument must be "px", "in", or "cm".

Returns

Nothing.

dom.setTracingImagePosition()

Availability

Dreamweaver 3.

Description

Moves the upper-left corner of the tracing image to the specified coordinates. If the arguments are omitted, the Adjust Tracing Image Position dialog box appears.

Arguments

x, y

  • The x argument is the number of pixels that specify the horizontal coordinate.

  • The y argument is the number of pixels that specify the vertical coordinate.

Returns

Nothing.

Enabler

dom.setTracingImageOpacity()

Availability

Dreamweaver 3.

Description

Sets the opacity of the tracing image.

Arguments

opacityPercentage

  • The opacityPercentage argument must be a number between 0 and 100.

Returns

Nothing.

Enabler

Example

The following code sets the opacity of the tracing image to 30%:

 dw.getDocumentDOM().setTracingOpacity('30');

dom.snapTracingImageToSelection()

Availability

Dreamweaver 3.

Description

Aligns the upper-left corner of the tracing image with the upper-left corner of the current selection.

Arguments

None.

Returns

Nothing.

Enabler

dom.stopAllPlugins()

Availability

Dreamweaver 3.

Description

Stops all plug-in content that is currently playing in the document.

Arguments

None.

Returns

Nothing.

dom.stopPlugin()

Availability

Dreamweaver 3.

Description

Stops the selected plug-in item.

Arguments

None.

Returns

A Boolean value that indicates whether the selection is currently being played with a plug-in.

Enabler

dreamweaver.arrangeFloatingPalettes()

Availability

Dreamweaver 3.

Description

Moves the visible floating panels to their default positions.

Arguments

None.

Returns

Nothing.

dreamweaver.showGridSettingsDialog()

Availability

Dreamweaver 3.

Description

Opens the Grid Settings dialog box.

Arguments

None.

Returns

Nothing.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy