|
|
Unlike menu items, which always occupy one line, form fields may occupy one or more lines (rows). Fields that occupy one line may be justified left, right, center, or not at all.
SYNOPSIS
int set_field_just (field, justification) FIELD field; int justification;Fields that occupy more than one line are not justified because the data entered typically extends into subsequent lines. Justification is also ignored on a one line field if the O_STATIC option is off or the field was dynamic and has grown beyond its original size. See ``Dynamically growable fields'' for more detail.int field_just (field) FIELD field;
Field contents justification is not allowed for non-editable fields. However, if the field was already justified before making it, it will remain justified.
Setting the number of field columns (cols) and the minimum width or precision does not always determine where the data fits in the field -- there may be excess character space before or after the data. Function set_field_just lets you justify data in one of the following ways:
For instance, to left justify a name field and right justify an amount field, you can write:
FIELD * name, * amount;If successful, set_field_just returns E_OK. If not, it returns one of the following:set_field_just (name, JUSTIFY_LEFT); /* left justify a field */
set_field_just (amount, JUSTIFY_RIGHT); /* right justify a field */
set_field_just( (FIELD *) 0, JUSTIFY_CENTER); /* set new default */