beautypg.com

Chapter 11: toolbars, How toolbars work, How toolbars behave – Adobe Extending Dreamweaver CS4 User Manual

Page 173

background image

167

Chapter 11: Toolbars

You can create a toolbar for Adobe Dreamweaver simply by creating a file that defines the toolbar and placing that file
in the Configuration/Toolbars folder.

The following table lists the files you use to create a toolbar:

How toolbars work

Toolbars are defined by XML and image files that are stored in the Toolbars folder of the main Dreamweaver
Configuration folder. The default Dreamweaver toolbars are stored in the toolbars.xml file in the
Configuration/Toolbars folder. When Dreamweaver starts, it loads all the toolbar files in the Toolbars folder. You can
add new toolbars simply by copying a file into the Toolbars folder rather than modifying the original toolbars.xml file.

Toolbar XML files define one or more toolbars and their toolbar items. A toolbar is a list of items such as buttons, text
boxes, pop-up menus, and so on. A toolbar item represents a single control that a user can access in a toolbar.

Some types of toolbar controls, such as push buttons and pop-up menus, have icon images associated with them. Icon
images are stored in an images folder in the Toolbars folder. Images can be in any format that Dreamweaver can render
but are typically GIF or JPEG file formats. Images for Adobe-authored toolbars are stored in the Toolbars/images/MM
folder.

As with menus, you can specify the functionality of individual toolbar items either through the item attributes or
through a command file. Adobe-authored toolbar command files are stored in the Toolbars/MM folder.

The toolbar API is compatible with the menu commands API, so toolbar controls can reuse menu commands files.

Unlike menus, you can define toolbar items independently from the toolbars that use them. This flexibility lets you use
toolbar items in multiple toolbars by using the

itemref

tag.

The first time Dreamweaver loads a toolbar, its visibility and position are set by the toolbar definition. After that, its
visibility and position are saved in and restored from the registry (Windows) or the Dreamweaver Preferences file
(Macintosh).

How toolbars behave

In Windows, Dreamweaver toolbars generally act the same as standard Windows toolbars. Dreamweaver toolbars
have the following characteristics:

You can drag and drop toolbars to dock them, undock them, and reposition them relative to other toolbars.

Path

File

Description

Configuration/Toolbars/

toolbars.xml

Edit this file to change the contents of the
toolbar.

Configuration/Toolbars/

newtoolbar.xml

Create this file to create a toolbar.

Configuration/Toolbars/

imagefile.gif

Icon image for toolbar control.

Configuration/Commands/

MyCommand.htm

Command file associated with toolbar item.

This manual is related to the following products: