Chapter 18. Customizing epcEdit

Table of Contents
18.1. Customizing icons
18.2. Extensions and Scripts
18.3. Debugging Scripts and Extensions

18.1. Customizing icons

There are two kinds of icons that can be customized: The icons for templates that are shown in the template selection dialog (see Figure 3-1) and the icons that appear as bullets before elements (see Figure 8-5).

For both classes of icons, it is possible to extend the number of available icons by creating new icons or to replace the existing icons by new images. Icon images must be stored as individual files inside designated directories in the epcEdit directory hierarchy and follow these conventions:

It is recommended that the image size of the icons should correspond to the size of the already defined icons.

18.1.1. Template icons

Icons for templates should be stored in the directory lib/epcEdit-1.2/images/templates in the epcEdit directory hierarchy. If epcEdit is installed in the default locations, the complete directory name will be /usr/local/tksgml/lib/epcEdit-1.2/images/templates on a Unix/Linux platform and C:\Program Files\epcEdit\lib\epcEdit-1.2\images\templates on a Windows system.

The size of a template icon should be 45 pixels high and 34 pixels wide. The filename of the icon determines the internal name that epcEdit will use to refer to this image. In order to replace one of the predefined icons, the file name for the replacement icon must correspond to the internal name of one of the predefined images:

blank

Filename: blank.gif or blank.png

SGML

Filename: sgml.gif or sgml.png

XML

Filename: xmlvalid.gif or xmlvalid.png

Draft

Filename: draft.gif or draft.png

DTDless XML

Filename: xmlwf.gif or wmlwf.png

If the file name of an image does not correspond to one of the predefined images, a new icon will be created. This icon will be added to the icons in the Change Icon sub menu of the template context menu.

To assign an icon to a template, bring up the template selection dialog (e.g. by selecting Document->Switch Template... from the main menu) and right-click on the template in question. You can then select the template icon by using the Change Icon entry in the context menu.

18.1.2. Bullet icons

Icons for list bullets should be stored in the directory lib/epcEdit-1.2/images/lists in the epcEdit directory hierarchy. If epcEdit is installed in the default locations, the complete directory name will be /usr/local/tksgml/lib/epcEdit-1.2/images/lists on a Unix/Linux platform and C:\Program Files\epcEdit\lib\epcEdit-1.2\images\lists on a Windows system.

The size of a bullet icon should be 10 by 10 pixels. The filename of the icon determines the internal name that epcEdit will use to refer to this image. In order to replace one of the predefined icons, the file name for the replacement icon must correspond to the internal name of one of the predefined images:

Circle Bullet

Filename: round.gif or round.png

Square Bullet (filled)

Filename: squaref.gif or squaref.png

Square Bullet (unfilled)

Filename: squarenf.gif or squarenf.png

Diamond Bullet

Filename: diamond.gif or diamond.png

External Link

Filename: extlink.gif or extlink.png

Blue Arrow

Filename: bluearr.gif or bluearr.png

Green Arrow

Filename: greenarr.gif or greenarr.png

If the file name of an image does not correspond to one of the predefined images, a new icon will be created. This icon will be added to the image icons in the list box in the Images tab of the style sheet dialog (see Figure 8-5). The file name (without the file extension) will be used as the description for the icon and will appear to the right of the icon in this list box.