
CHAPTER 4: User-Interface Tools Graphic customization objects 163
ScriptUIPen object
A helper object that encapsulates the qualities of a pen used to stroke path segments in a control. Create
with the newPen()
method of the ScriptUIGraphics object.
X Used as a value of foregroundColor and disabledForegroundColor.
X Passed as an argument to drawString() and strokePath().
ScriptUIPen object properties
The object contains the following properties:
Custom element class
Elements of the Custom class differ from typical UI elements in that they have no default appearance; the
script which creates a custom element is responsible for drawing it by defining the element's onDraw
event handler function. This allows scripts to create any appearance for custom elements that can be
rendered via the drawing functions defined for a UI element's graphics object.
Custom elements have the same common properties that other types of control elements have (see
“
Common properties” on page 108). The different types of custom elements have additional properties.
The
Custom element class has the following types of elements:
color
Array of
Number
The paint color to use when the type is SOLID_COLOR. An array in the form
[R, B, G, A] specifying the red, green, blue values of the color and the
opacity (alpha channel) value as numbers in the range [0.0...1.0].
An opacity of 0 is fully transparent, and an opacity of 1 is fully opaque.
lineWidth
Number The pixel width of the drawing line.
theme
String The name of a color theme to use for drawing when the type is
THEME_COLOR. Theme colors are defined by the host application.
type
Number The pen type, one of these constants:
ScriptUIGraphics.PenType.SOLID_COLOR
ScriptUIGraphics.PenType.THEME_COLOR
Comentarios a estos manuales