Changing the Selection Character for a Menu Field

To use character selection, the character selection option FLDCHSELECT must be ON for the form. This is the system default.

The first character is the default selection character. You can change the selection character to any letter in the field string. You can also aid the user in determining what the selection character is for a menu field by highlighting this character.

Designer: You can change the selection character for a menu field in the Designer. See the Designer User's Guide for more information. You can also change the selection character in your code by calling sf_selectch(), as described below.

Code: To change the position and the attribute of the selection character for a menu field, use the set field selection character function, sf_selectch():

void sf_selectch(ch_pos, ch_att, mfldp)
 
UCHAR ch_pos;
/* Position of selection character
*/
UCHAR ch_att;
/* Attribute to make selection character
*/
MFIELDPTR mfldp;
/* Pointer to menu field 
*/

Numbering of characters in the field string starts at 0. The following code example defines three menu fields and highlights the selection character (the capitalized character in the field string):

MFIELDPTR field0p, field1p, field2p;



field0p = mnf_def(0, 1, "Item 0", NULLP, NULLP, act_fp, mfmp);

field1p = mnf_def(1, 1, "iTem 1", NULLP, NULLP, act_fp, mfmp);

field2p = mnf_def(3, 1, "itEm 2", NULLP, NULLP, act_fp, mfmp);

sf_selectch(0, LFLDSELCH, field0p);

sf_selectch(1, LFLDSELCH, field1p);

sf_selectch(2, LFLDSELCH, field2p);


Home Contents Previous Next