Multiple Selection Choice Lists

The CLMULTIPLE choice list option allows you to implement a multiple selection choice list. A multiple selection choice list is a choice list that allows multiple selections from a single list.

Each choice list item field has two additional characters to the left of the field. The first character is reserved for the display of the marking character (a checkmark by default). The second character is a space to separate the mark from the text. If you are manually sizing and placing your choice list (CLMANUAL), you must add two characters to the column dimensions for the choice list window. If the system is automatically sizing and placing the choice list (CLAUTO), these characters are added for you.

The user moves through the choice list using the cursor movement keys. The default key for marking or unmarking an item is the Spacebar (KEY_SPACE). The default marking character is a checkmark (ASCII 251). You can change this default globally with the set environment choice list checkmark character function, se_clcheckch().

The item that is highlighted when the user presses Enter or Return is marked, and the item is copied into the data field.

To implement a multiple selection choice list, do the following, either in code or in the Designer:

1 Install a choice list, using CLMULTIPLE as one of the options.
2 If you do not want the user to be able to type directly into the field or to modify a choice after it is selected, set the field option PROTECTED to ON.

To determine which choice list items are marked, use the get checked choice list item function, cli_getcheck():

UCHAR *cli_getcheck(clistp)

CLISTPTR clistp;        /* Pointer to choice list            */

cli_getcheck() returns a pointer to the text string of the next checked choice list item and automatically keeps track of its current search location in the choice list. The function returns NULLP when no more checked items can be found.

cli_getcheck() can be called in a loop to get each selected item. It will return a NULLP when no more items are available.

More:

Setting the Checkmark Status of a Choice List Item


Home Contents Previous Next