A Simple Toolbar Command File - MACROMEDIA DREAMWEAVER 8-EXTENDING DREAMWEAVER Manual

Extending dreamweaver
Table of Contents

Advertisement

A simple toolbar command file

This simple example implements a Title text box item as seen on the Dreamweaver Document
toolbar. The text box item lets the user enter a name for the current Dreamweaver document.
You can implement this toolbar example by performing the following steps:
Creating the text box
Writing the JavaScript code
Creating the text box
To add a toolbar to Dreamweaver, you place an XML file that contains the toolbar definition
in the Toolbars folder inside the Dreamweaver Configuration folder.
The following figure shows the Title text box:
The following toolbar
<EDITCONTROL ID="DW_SetTitle"
label="Title: "
tooltip="Document Title"
width="150"
file="Toolbars/MM/EditTitle.htm"/>
The
attribute causes Dreamweaver to display Document Title in a tooltip box when
tooltip
the user places the mouse pointer over the text box. The
the field in pixels. The
JavaScript functions that operate on the text box. To see the full definition of the
Dreamweaver Document toolbar, see the main toolbar (
toolbars.xml file.
Writing the JavaScript code
When the user interacts with the text box, it causes Dreamweaver to invoke the EditTitle.htm
command file in the Toolbars/MM folder. This file contains three JavaScript functions that
operate on the Title text box. These functions are
receiveArguments()
218
Toolbars
item defines a text box that is labeled Title
editcontrol
attribute specifies that the EditTitle.htm file contains the
file
, and
getCurrentValue()
attribute specifies the size of
width
id="DW_Toolbar_Main"
canAcceptCommand()
.
:
) in the
,

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?

This manual is also suitable for:

Dreamweaver 8

Table of Contents