Sub-Shapes

Return to Introduction  Previous page  Next page

Sub-Shapes

Shapes can contain and be composed of other shapes.

Subshape Layout:

To set the layout type, the layouttype attribute must be set in the initialization attributes section of the script; in other words, before any of the methods are called. Valid values for this attribute are:

LeftRight

Shapes with leftright layout position subshapes side by side, with the first added on the left, and subsequent subshape to the right.

TopDown

TopDown places subshapes in a vertical arrangement, with the first shape added to the top and subsequent shape added below.

Border

Border layout requires an additional argument to the addsubshape method to specify which region of the containing shape the subshape is to occupy: N, E,  S, W or CENTER.  Each region can only be occupied by one subshape.

A subshape that is assigned to the E or W region must have its preferredwidth attribute specified in its declaration.  Similarly, subshapes added to N or S must have their preferredheight attribute set.  In this case, the values for these attributes are treated as static lengths and do not scale glyph.