How commands work

 < Day Day Up > 

When a user clicks a menu that contains a command, the following events occur:

1.

Dreamweaver calls the canAcceptCommand() function to determine whether the menu item should be disabled. If the canAcceptCommand() function returns a false value, the command is dimmed in the menu, and the procedure stops. If the canAcceptCommand() function returns a TRue value, the procedure can continue.

2.

The user selects a command from the menu.

3.

Dreamweaver calls the receiveArguments() function, if defined, in the selected Command file to let the command process any arguments that pass from the menu item or from the dreamweaver.runCommand() function. For more information on the dreamweaver.runCommand() function, see the Dreamweaver API Reference.

4.

Dreamweaver calls the commandButtons() function, if defined, to determine which buttons appear on the right side of the Options dialog box and what code should execute when the user clicks the buttons.

5.

Dreamweaver scans the command file for a FORM tag. If a form exists, Dreamweaver calls the windowDimensions() function, which sizes the Options dialog box that contains the BODY elements of the file. If the windowDimensions() function is not defined, Dreamweaver automatically sizes the dialog box.

6.

If the command file's BODY tag contains an onLoad handler, Dreamweaver executes it (whether or not a dialog box appears). If no dialog box appears, the remaining steps do not occur.

7.

The user selects options for the command. Dreamweaver executes event handlers that are associated with the fields as the user encounters them.

8.

The user clicks one of the buttons that is defined by the commandButtons() function.

9.

Dreamweaver executes the associated code. The dialog box remains visible until one of the scripts in the command calls the window.close() function.

     < Day Day Up > 


    Developing Extensions for Macromedia Dreamweaver 8
    Developing Extensions for Macromedia Dreamweaver 8
    ISBN: 0321395409
    EAN: 2147483647
    Year: 2005
    Pages: 282

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net