label.image Reference¶
Comprehensive function reference for label.image, synthesised from the AmigaOS NDK 3.2 Release 4 (Autodocs/label).
This page documents 2 functions of label.image. Each function entry follows the canonical autodoc format. struct Name, union Name, enum Name are clickable links to the type definition in the types reference.
Function index¶
label_ic()¶
**label_ic -- Image class for creating identification labels
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.
METHODS
OM_NEW -- Create the label image. Passed to superclass, then OM_SET.
OM_GET -- Get object attributes. Passed to superclass first.
OM_SET -- Set object attributes. Passed to superclass first.
OM_UPDATE -- Set object notification attributes. Passed to
superclass first.
IM_DRAW -- Renders the images. Overrides the superclass.
All other methods are passed to the superclass, including OM_DISPOSE.
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()
LABEL_GetClass()¶
LABEL_GetClass -- Gets the pointer to the label image class.
Synopsis
label_class = LABEL_GetClass();
D0
Class * LABEL_GetClass(VOID);
Function
Obtains the pointer to the label image class for use with
NewObject(). This function always returns a valid pointer so
you do not need to check it. The reason is that if the library
opens fine, then the pointer returned is already setup. (Of course
this implies that if opening the library fails, you shouldn't be
calling this.)
Note that this function does not create the class, that is done
when the class library is opened.
Inputs
Nothing.
RESULT
label_class - Pointer to the label image class.