Icon-description attribute of the icon's class definition. The Icon Editor translates an icon's description into graphical form, and allows you to edit the icon definition graphically, as described earlier in this chapter.Alternatively, you can edit an icon's definition textually, either creating it from scratch, or modifying it as desired. Textual icon editing can be useful, because the Icon Editor does not allow you to modify graphical elements once you have created them; textual editing allows any type of modification.
Thus you can use the Icon and Text Editors together to define an icon. The Icon Editor establishes the icon's overall properties and shows its current appearance; the Text Editor allows modifications that fine-tune the icon to have precisely the desired look.
The following figure shows examples of many of the elements that an icon description can contain. Each element appears in both Icon Editor and textual form. Each layer belongs to a region whose name is the type of graphics drawn on the layer.
Icon Description Language Grammar
This section describes the grammar of the icon description language. You don't need to study this grammar unless you intend to edit icons textually. When studying the grammar, you can skip over any sections that do not relate specifically to your needs. See the preceding figure for help in interpreting this grammar. icon-background-layer section is described under Specifying an Icon Background Layer. The optional variables section is described in Animated Icons and subsequent sections.
width: integer; height: integer;
[{region-name = color-name} [, ...] ; ]
[variables: {variable-name = variable-value} [, ...] ;][icon-background-layer:image-name at (x-pos, y-pos) | region-name | color-name} ]
{color image
{region-name: {graphic-definition;} [...] } [...]
Thegraphic-definition:=point-definition
|line-definition
|segmented-line-definition
|arc-definition
|outlined-rectangle-definition
|filled-rectangle-definition|outlined-circle-definition
|filled-circle-definition|outlined-polygon-definition
|filled-polygon-definition|text-definition
|image-definition
width and height can each be set to a maximum of 1000.The various graphic-definitions are based on a small number of primitives which they use in ways that are sometimes nonobvious. The rest of this section gives details. All numeric coordinates (x, y) are integers (not integer expressions) in workspace units measured from the upper left corner of the icon, whose coordinates are (0,0).
point-definition := point (x, y);
line-definition := lines (x, y) (x, y);
segmented-line-definition := lines (x, y) (x, y) [ (x, y) ]...;
arc-definition := lines (x, y) arc (x, y) (x, y);
outlined-rectangle-definition := outline (x, y) (x, y) (x, y) (x, y);
filled-rectangle-definition := filled rectangle (x, y) (x, y);
outlined-circle-definition := circle (x, y) (x, y) (x, y);
When you specify an
outlined circle definition textually, you can give any three points on the circumference of the circle. When the Icon Editor generates the three points of an
outlined circle definition from graphical input (via the Circle or Filled Circle button), the points specify a semicircular arc that opens downwards. If the center of the circle is at (XC, YC) and the radius is R, the three points are (XC-R, YC) (XC, YC-R) (XC+R, YC). Inversely, if the three points are (X1, Y1), (X2, Y2), and (X3, Y3), the center of the circle is (X2, Y1) and the radius of the circle is (X3-X1)/2.
filled-circle-definition := filled circle (x, y) (x, y) (x, y);
.
outlined-polygon-definition := outline (x, y) (x, y) (x, y) [ (x, y) ]...;
filled-polygon-definition := filled polygon (x, y) (x, y) (x, y) [ (x, y) ]...;
:= text string at (x-position, y-position) in font-size
small, large, or extra-large.
image-definition := image-name (x, y);
The two editors function independently even when you use them on the same icon. Neither editor knows what happens in the other, or is aware of changes saved by the other. After you save changes made in either editor, you must close and reopen the other editor to show the changes there also.
Be careful not to make concurrent changes in both editors, or the changes saved by one editor will be overwritten when you save the changes made in the other.