beautypg.com

Dreamweaver.codehints.addfunction() – Adobe Dreamweaver API Reference CS5 User Manual

Page 447

background image

442

DREAMWEAVER API REFERENCE

Code

Last updated 8/27/2013

Returns
Nothing.

Example
If the user creates a recordset called "myRs", the following code would create a menu for myRS:

dw.codeHints.addMenu(

"CodeHints_object_methods", // menu is enabled if object methods are enabled
"myRS.", // pop up menu if user types "myRS."
new Array("firstName", "lastName"), // items in pop-up menu for myRS
new Array("firstName", "lastName"), // text to actually insert in document
null, // no icons for this menu
"ASP_VB, ASP_JS"); // specific to the ASP doc types

dreamweaver.codeHints.addFunction()

Availability
Dreamweaver MX.

Description
Dynamically defines a new

function

tag. If there exists a

function

tag with the same pattern and document type, this

function replaces the existing

function

tag.

Arguments

menuGroupId

,

pattern

,

{doctypes}

,

{casesensitive}

,

{object}

,

{description}

,

{icon}

,

source

,

{docURI}

,

{bClassPattern}

,

{bAddToObjectMethodList}

,

{restriction}

The

menuGroupId

argument is the ID string attribute of the

menugroup

tag.

The

pattern

argument is a string that specifies the pattern attribute for the new

function

tag.

The

doctypes

argument, which is optional, specifies that this function is active for only certain document types.

You can specify the

doctypes

argument as a comma-separated list of document type IDs. For a list of Dreamweaver

document types, see the Dreamweaver Configuration/Documenttypes/MMDocumentTypes.xml file.

The

casesensitive

argument, which is optional, specifies whether the pattern is case-sensitive. The possible

values for the

casesensitive

argument are the Boolean values

true

or

false

. The value defaults to

false

if you

omit this argument. If the

casesensitive

argument is a

true

value, the Code Hints menu appears. This menu

appears only if the text that the user types matches the pattern that the pattern attribute specifies. If

casesensitive

is a

false

value, the menu appears even if the pattern is lowercase and the text is uppercase.

The

object

argument specifies the name of the string. This argument is optional. It is used when the object is of

type "static."

The

description

argument contains a detailed description for the function. This argument is optional.

The

icon

argument specifies the custom icon path to use in function drop down. This argument is optional.

The

source

argument contains a value that the second column of code hint displays. The default of this argument

is

empty

.

The

docURI

argument enables the user to constrain the code hints to a specific document by providing the

document URI (native OS File Path). This argument is optional and if the document URI is not specified, it does
not impose any constraint.