Changing the Length of the Choice List Items

The default is for the length of the choice list item and the highlight bar to be the width of the window. You can change the length of the items in a choice list so that the highlight bar highlights only a certain part of the item line. Text extending beyond the highlight bar remains in the inactive attribute.

Changing the length of the choice list items also changes the number of characters in the string returned by cl_curtxt() and other functions that return the string for a particular choice list item.

To do this, call the set choice list item length function, scl_itemlen(). You must call this function before the choice list is processed.

void scl_itemlen(len, clistp);
 
int len;
/* Length to make highlight bar
*/
CLISTPTR clistp;
/* Pointer to choice list
*/

For example, suppose the following text is used to create a choice list clistp:

*FONT MENU (NORMAL)

TR10 -- Times Roman 10 point

TR12 -- Times Roman 12 point

CS10 -- Century Schoolbook 10 point

CS12 -- Century Schoolbook 12 point

SV10 -- Souvenir 10 point

SV24 -- Souvenir 24 point

To only have the first 4 characters of the choice list item highlighted, call:

scl_itemlen(4, clistp);

If the user makes a selection and you call cl_curtxt() to determine what text was selected, only the first four characters in the item selected are placed in the string buffer specified in the call.

Warning: Do not call this function for a data entry choice list on a data form.


Home Contents Previous Next