beautypg.com

Creating a menu item, The floating panel api functions, Displayhelp() – Adobe Extending Dreamweaver CS4 User Manual

Page 233

background image

227

EXTENDING DREAMWEAVER CS4

Floating panels

Creating a menu item

It is not sufficient to save the Script Editor code in the Configuration/Floaters folder. You must also call either the

dw.setFloaterVisibility('scriptEditor',true)

function or the

dw.toggleFloater('scriptEditor')

function to load the floating panel and make it visible. The most obvious place from which to invoke the Script Editor
is from the Window menu, which is defined in the menus.xml file. You need to create the

menuitem

tag that creates

an entry for the Script Editor extension on the Window menu, as shown in the following figure:

If you select a script marker in Design view for the current document and then select the Script Editor menu item,
Dreamweaver invokes the Script Editor floating panel and displays the JavaScript code that underlies the script marker.
If you select the menu item when a script marker has not been selected, Dreamweaver displays the

blanklayer

panel

that contains the text

(no script selected)

.

1

Open the menus.xml file in the Configuration/Menus folder.

2

locate the tag that begins

"

Tile _Vertically

" and position the insertion point after the closing

/>

of the tag.

3

On a new line, insert the following:

command="dw.toggleFloater('scriptEditor')"¬
checked="dw.getFloaterVisibility('scriptEditor')" />

4

Save the file.

The floating panel API functions

All the custom functions in the floating panel API are optional.

Some of the functions in this section operate only on the Windows operating system. The description of the function
indicates whether this is the case.

displayHelp()

Description
If this function is defined, a Help button appears below the OK and Cancel buttons in your dialog box. This function
is called when the user clicks the Help button.

Arguments
None.

Returns
Dreamweaver expects nothing.

This manual is related to the following products: