labels.md 3.7 KB

Labels

Label

Draws a text label. If form->label is 0, then form->ptr should point to a zero terminated UTF-8 string.

Parameter Description
form->type UI_LABEL
form->label Index to the localized strings array (or 0)
form->ptr Only if label is 0, pointer to a string

Status

Draws a text label. Same as UI_LABEL, but instead of form->label uses the form->desc field of the element the mouse is hovering over. If this is 0, then form->ptr should point to a zero terminated UTF-8 string.

Parameter Description
form->type UI_STATUS
form->ptr Only if hover->desc is 0, pointer to a string
hover->desc Index to the localized strings array (or 0)

Decimal

Draws an integer as a decimal number label. The number in the define specifies how many bits used to store the variable.

Parameter Description
form->type UI_DEC8 / UI_DEC16 / UI_DEC32 / UI_DEC64
form->ptr Pointer to the value

Hexadecimal

Draws an integer as a hexadecimal number label. The number in the define specifies how many bits used to store the variable.

Parameter Description
form->type UI_HEX8 / UI_HEX16 / UI_HEX32 / UI_HEX64
form->ptr Pointer to the value

Progressbar

Draws an integer (64 bit) as a progressbar.

Parameter Description
form->type UI_PBAR
form->ptr Pointer to the int64 value
form->max Total value

Floating Point

Draws a floating point number label.

Parameter Description
form->type UI_DEC_FLOAT
form->ptr Pointer to the value

Image

This field draws an image icon. If form->ptr is not NULL, then also clickable and acts as a [button].

Parameter Description
form->type UI_IMAGE
form->icon Pointer to an ui_image_t struct
form->ptr Pointer to the int value (or NULL)
form->value Int value for this label

The ui_image_t image structure looks like:

Field Description
w Width in pixels
h Height in pixels
p Pitch in bytes (bytes in a row, at least w * 4)
buf Pixel buffer with 32-bit RGBA packed pixels