A Simple Menu Command Example - Adobe 38040334 - Dreamweaver CS3 User Manual

Extending dreamweaver
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

• If the
canAcceptCommand()
function to determine whether to display a check mark next to the menu item. If the
isCommandChecked()
function is not defined, no check mark appears.
isCommandChecked()
Dreamweaver calls the
3
setMenuText()
If the
function is not defined, Dreamweaver uses the text that is specified in the
setMenuText()
The user selects an item from the menu.
4
5
Dreamweaver calls the
receiveArguments()
command process any arguments that pass from the menu item.
Note: If it is a dynamic menu item, the ID of the menu item passes as the only argument.
Dreamweaver calls the
6
commandButtons()
side of the Options dialog box and what code should execute when the user clicks the buttons.
7
Dreamweaver scans the menu commands file for a
If a form exists, Dreamweaver calls the
box that contains the
BODY
If the
windowDimensions()
8
If the menu commands file's
(whether or not a dialog box appears). If no dialog box appears, the remaining steps do not occur.
The user selects options in the dialog box. Dreamweaver executes event handlers that are associated with the fields
9
as the user encounters them.
The user clicks one of the buttons that are defined by the
10
11
Dreamweaver executes the code that is associated with the clicked button.
The dialog box remains visible until one of the scripts in the menu commands file calls the
12
function.

A simple menu command example

This simple menu command example shows how Undo and Redo menu commands might work. The Undo menu
command reverses the effect of a user's editing operation, and the Redo item reverses an Undo operation and restores
the effect of the user's last editing operation.
You can implement this example by performing the following steps:
• "Creating the menu commands" on page 148
• "Writing the JavaScript code" on page 149
• "Placing the command file in the Menu folder" on page 151
Creating the menu commands
Add the following HTML menu tags to the end of the menus.xml file to create a menu called MyMenu that contains
the Undo and Redo menu items.
<menu name="MyMenu" id="MyMenu_Edit">
function returns a
true
function to determine the text that should appear in the menu.
function, if defined, in the selected menu commands file to let the
function, if defined, to determine which buttons appear on the right
windowDimensions()
elements of the file.
function is not defined, Dreamweaver automatically sizes the dialog box.
tag contains an
body
onLoad
value or is not defined, Dreamweaver calls the
tag.
form
function to determine the size of the Options dialog
handler, Dreamweaver executes the associated code
commandButtons()
DREAMWEAVER CS3
Extending Dreamweaver
tag.
menuitem
function.
window.close()
148

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents