
180
EXTENDING DREAMWEAVER CS4
Toolbars
Example
<colorpicker id="Color_Example"
image="Toolbars/images/colorpickerIcon.gif"
disabledImage="Toolbars/images/colorpickerIconD.gif"
colorRect="0 12 16 16"
tooltip="Text Color"
domRequired="false"
file="Toolbars/mine/colorExample.htm"
update="onSelChange"/>
Item tag attributes
You can assign attributes and commands to toolbar items to specify how they look and behave. You can also include
other toolbar files and reference toolbar items that are defined in other toolbars. The attributes for toolbar item tags
have the following meanings:
id="unique_id"
Required. The id attribute is an identifier for the toolbar item. The id attribute must be unique within the current file
and all files that are included within the current file. The
itemref tag uses the item id to indicate and include an item
within a toolbar.
Example
<button id="DW_DocRerefresh" . . . >
showIf="script"
Optional. This attribute specifies that the item appears in the toolbar only if the script returns a true value. For
example, you can use the
showIf attribute to show certain buttons only when a page is written in a certain server-side
language such as Adobe ColdFusion, ASP, or JSP. If you do not specify
showIf, the item always appears.
The showIf attribute is checked whenever the item enabler runs; that is, according to the value of the update attribute.
Use the
showIf attribute sparingly.
You can specify the showIf attribute in the item definition and in a reference to the item on an itemref tag. If the
definition and the reference specify the
showIf attribute, the item shows only if both conditions are true. The showIf
attribute is the same as the
showIf() function in a toolbar command file. If you specify both the showIf attribute and
the
showif() function, the function overrides the attribute.
Example
showIf="dw.canLiveDebug()"
image="image_path"
This attribute is required for buttons, check buttons, radio buttons, menu buttons, and combo buttons. The image
attribute is optional for color pickers and is ignored for other item types. The
image attribute specifies the path, relative
to the Configuration folder, of the icon file that displays on the button. The icon can be in any format that
Dreamweaver can render, but typically it is a GIF or JPEG file format.
If an icon is specified for a color picker, the icon replaces the color picker entirely. If the colorRect attribute is also
set, the current color appears on top of the icon in the specified rectangle.
Komentáře k této Příručce