1.16 class box

Class box represents a simple rectangle. It is the simples graphical object of PCE.

Boxes may have rounded corners (see box->radius); their line may have some graphical->texture (dash-pattern) and their inside may be file (see box->fill).

1.16.1 Instance variables

box <- fill_offset: point*
If a box object is filled with a box<-fill, this pattern is repeated over the entire area of the box. By default, box<-fill_offset is @nil and the origin of the pattern is the origin of the window. By setting box<-fill_offset to a point, the pattern's origin starts at the specified location relative to the X,Y of the box.

A typical usage for this method is to make neat-looking bar of a barchart using a gradient fill-pattern and setting box<-fill_offset to point(0,0).

box <- fill: colour|{foreground,background}*
If an image object is used as box<-fill, this pattern is repeated over the interior of the box. If a colour object is specified, the box is filled using a solid colour and finally if the initial value @nil is used the box is transparent. The reserved names foreground and background use the current foreground and background colours from the context.

See also box<-fill_offset.

Defaults: @nil (transparent)

See also
bitmap-status
box <- radius: int
The radius of the circle-fragments used to round the corners. When larger than half the shortest side, this value is used instead of box<->radius. A value of 0 implies square corners.

Defaults: 0 (not rounded)

box <- shadow: int
Amount (pixels) of shadow painted below and right of the box. The default is 0 (zero, no shadow).

1.16.2 Send methods

box ->initialise: width=[int], height=[int]
Create a box from W and H. The dimensions may be zero or negative.
box ->shadow: int
Amount of shadow added to this box in pixels. In the current implementation, shadow is always black and painted below and right-of the object.