
CHAPTER 4: User-Interface Tools Graphic customization objects 159
measureString()
controlObj.graphics.measureString (text, font[, boundingWidth])
text
The text string to measure.
font
Optional. The ScriptUIFont object for the font to use. Default is the font value in
this object.
boundingWidth
Optional. A number that specifies the maximum width in pixels of the area in
which the text might be placed. Use when wrapping a long string of text across
multiple lines.
Calculates the size needed to draw a text string in a given font.
Returns a Dimension
object containing the height and width of the string in pixels.
moveto()
controlObj.graphics.moveto (x, y)
x, y
The new coordinates, in the coordinate system of the control that contains this
graphics object.
Adds a given point to the currentPath
, and makes it the currentPoint.
Returns a Point
object for the given destination point, which is the new current position.
newBrush()
controlObj.graphics.newBrush( type, color );
type
The brush type, one of these constants:
ScriptUIGraphics.BrushType.SOLID_COLOR
ScriptUIGraphics.BrushType.THEME_COLOR
color
The brush color.
X If type is SOLID_COLOR, the color expressed as an array of three or four values,
in the form
[R, B, G, A] specifying the red, green, and blue values of the
color and, optionally, the opacity (alpha channel). All values are numbers in
the range [0.0...1.0]. An opacity of 0 is fully transparent, and an opacity of 1 is
fully opaque.
X If the type is THEME_COLOR, the name string of the theme. Theme colors are
defined by the host application.
Creates a new painting brush.
Returns a ScriptUIBrush object
.
newPath()
controlObj.graphics.newPath( );
Creates a new, empty drawing path in currentPath, replacing any existing path.
Returns a ScriptUIPath object
.
Comentários a estes Manuais