iDevOS CALC "PIXX" Command

Get the width of an entity.

Description

CALC( x, name, "PIXX" );    // x = width("name")
CALC( x, name, a, "PIXX" ); // x = width("name") + a

This command returns the value x which is the display width of the entity name and adds a, if provided.

Text, image, draw, touch key and page entities have sizes. Other entities, such as variables, do not and will return 0 for their size.

The height of an entity can be obtained using "PIXY".

Parameters

x
Calculation result.
Parameter type: entity name of a numeric variable (eg U8, S32, FLT3 etc).
name
Entity Name.
Parameter type: Immediate entity name.
a
Input value.
Parameter type: immediate number, or entity name of a numeric variable (eg U8, S32, FLT3 etc).
"PIXX"
CALC command operator.
Parameter type: immediate string.

Examples

Example 1

VAR(width,  0, S32);  // Result variable
VAR(height, 0, S32);  // Result variable

DRAW(box, 20, 30, stBox); // Create a rectangle

CALC(width,  box, "PIXX"); // width = 20
CALC(height, box, "PIXY"); // height = 30

CALC(width,  box, 10, "PIXX"); // width = 30
CALC(height, box, 10, "PIXY"); // height = 40