Making Menu Fields Unavailable for Selection

To prevent the user from selecting a menu field in a menu, make the menu field unavailable for selection. Unavailable menu fields are displayed using the unavailable field attribute. When a menu field is unavailable, the highlight bar will not stop on the menu field but will skip over it to the next menu field.

Designer: You can set the UNAVAILABLE option for a menu field inside the Designer. See the Designer User's Guide for more information. You can also change the field option in your code, at any point after you have read the form from the Designer library.

Code: To make a menu field unavailable, you set the UNAVAILABLE field option to ON for the menu field using the set field options function, sf_opt(). The call to make a field unavailable is:

sf_opt(UNAVAILABLE, ON, mfldp);

where mfldp is a pointer to the menu field to make unavailable. When the field is redisplayed, it is redisplayed with the unavailable attribute for that field.

To make an unavailable field available for selection again, call:

sf_opt(UNAVAILABLE, OFF, mfldp);

Note: If you change the availability of a menu field while the menu is displayed, call smn_opt(FMALTERED, ON, mfmp) to inform the menu system that the menu needs to be redisplayed.


Home Contents Previous Next