Home  /  Autodocs

label.image

Image class for creating identification labels

FUNCTIONS

LABEL_GetClass

SUPERCLASS

imageclass

REQUIRES

None.

DESCRIPTION

Label is an image class suitable for creating identification labels, such as those that might appear next to or inside a gadget, or as some kind of title in a window. A label consists of text and graphics mixed in a variety of ways.

ATTRIBUTES

IA_Font (struct TextAttr *)
Font to use for any label text. Only affects text passed AFTER this tag is given.

Applicability is (OM_NEW)

IA_FGPen (LONG)
Foreground pen for any label text. Only affects text passed AFTER this tag is given.

Defaults to pen 1.

Applicability is (OM_NEW)

IA_BGPen (LONG)
Background pen for any label text. Only affects text passed AFTER this tag is given.

Defaults to pen 0.

Applicability is (OM_NEW)

IA_Mode (UBYTE)
Draw mode for rendering text. Only affects text passed AFTER this tag is given.

Defaults to JAM1.

Applicability is (OM_NEW)

LABEL_DrawInfo (struct DrawInfo *)
Contains important pen information. This is used to get default font information.

Defaults to NULL.

Applicability is (OM_NEW, OM_GET)

LABEL_Text (STRPTR)
A text string to render. A '\n' in the string will cause the text position to move to a new line. The first underscore ('_') in the string will be used to underline the following character in the string. Any number of text strings and images can be provided in a label, mixed at will.

Applicability is (OM_NEW)

LABEL_SoftStyle (UBYTE)
Soft style for any label text. Only affects text passed AFTER this tag is given.

Defaults to FS_NORMAL.

Applicability is (OM_NEW)

LABEL_Image (struct Image *)
An image to render. Any number of text strings and images can be provided in a label, mixed at will.

Applicability is (OM_NEW)

LABEL_DisposeImage (BOOL)
Indicates that you want the NEXT image passed via LABEL_Image to be disposed automatically when the label instance is disposed. This implies that the next image passed MUST be a BOOPSI image (since static images cannot be disposed). This will only affect the next image passed, therefore you must specify this tag for every image you wish to have disposed of automatically.

Defaults to FALSE.

Applicability is (OM_NEW)

LABEL_VerticalSpacing (UWORD)
Vertical spacing between text lines. Only affects text and images passed after this tag is given.

Defaults to 0.

Applicability is (OM_NEW)

LABEL_Mapping (UWORD *)
Pen mapping array, affects the NEXT image passed via LABEL_Image ONLY. You should pass a mapping for non-BOOPSI images only, it is expected that BOOPSI images would be correctly pen-mapped.

The mapping array must have at least as many elements as the image has bit planes (i.e. 1 << Image.Depth). For element i in the array you put in the new pen that you want pen i in your image to be mapped to. For a typical 4-colour image, you might use the following mapping:

UWORD mapping[4];
struct DrawInfo *drinfo;

/* Beforehand we'll have obtained the screen's DrawInfo.
*/
mapping[0] = drinfo->dri_Pens[BACKGROUNDPEN];
mapping[1] = drinfo->dri_Pens[SHADOWPEN];
mapping[2] = drinfo->dri_Pens[SHINEPEN];
mapping[3] = drinfo->dri_Pens[FILLPEN];

Applicability is (OM_NEW)

LABEL_Justification (UWORD)
Justification for entire label. This can be either LJ_LEFT (the default), LJ_CENTRE or LJ_RIGHT.

Applicability is (OM_NEW, OM_GET)

LABEL_Key (UWORD)
For getting the key that was underscored in text passed with LABEL_Text.

Applicability is (OM_GET)

SEE ALSO

intuition.library/GetScreenDrawInfo()