[Contents]
[Prev] [Next] [Limbo Basics] [Limbo Programming] [Language Definition]

Concepts and Terminology

The Prefab module, as a graphics "toolkit," provides higher-level graphics capabilities compared to the Draw module. There are still concepts and terms that should be introduced first.

Compound

The type Compound defines boxes drawn on the screen. Each appears in a new window, Compound.image, and holds a (possibly nil) title and contents. It occupies the space on the screen defined by Compound.r. Allocating a Compound creates a window but does not draw it.

After the Compound is built, Compound.draw must be called to make it visible. Compounds have a border around them, drawn in Style.edgecolor and contain, from top-to-bottom:

Applications should allocate a Compound only through the appropriate member functions. Moreover, except where indicated, applications should not modify the data members directly. Although the type definitions make data members visible, the members should be treated as read-only data.

Elements

The Prefab module defines elements as the graphic components. There are six types of Prefab elements, as described in Table 3-6.
Table 3-6 Prefab Elements
EText A single line of text. Text for this element is drawn with Style.textfont and Style.textcolor.
ETitle A single line of text, usually giving the title of a Compound object. Text for this element is drawn with Style.titlefont and Style.titlecolor.
EIcon An Image object.
ESeparator An Image object, like an EIcon, but intended to fill space in a list, rather than to serve as an element of the list. An ESeparator is ignored when selecting or highlighting list elements.
EHorizontal A horizontal list of elements.
EVertical A vertical list of elements.

The objects on the screen are of type Compound, each of which occupies a unique window on the display and contains objects of type Element. An Element may be a single object or a list of Elements that can be used to build structured components.

Applications should allocate an Element only through the appropriate member functions. Moreover, except where indicated, applications should not modify the data members directly. Although the type definitions make data members visible, the members should be treated as read-only data.

Environ

The Environ type specifies the screen and style types for the element.

The screen, of type ref Draw->Screen, specifies where the elements are displayed.

The style, of type Style, specifies how the elements are drawn.

Style

The Style type collects the font and color information for an application or a set of items within an application. Except when using Layout, the members of Style are the only way to control the appearance of Prefab elements.

The color members, elemcolor, edgecolor, titlecolor, textcolor and highlightcolor typically refer to a literal color (a single replicated pixel of color). They are of type ref Draw->Image, so they can be any image.

Styles are allocated by regular Limbo definitions. There are no allocation functions. All the members of a Style must be defined. Although it will not cause errors to modify the members of a Style after it has been created and passed to a Prefab function, the results may be unpredictable.

Layout

The Layout type defines a more general form of text and image display. It provides fine control over the font and color in which to display text and the inclusion of images as textual elements. It allows setting of the tag for each component of the resulting element or list of elements.



[Contents]
[Prev] [Next] [Limbo Basics] [Limbo Programming] [Language Definition]

Copyright © 1998, Lucent Technologies, Inc. All rights reserved.