Changing Menu Options and Settings in an Action Function

All action functions are passed the current menu form pointer. Knowing this pointer allows you to change the many options and settings for menu forms. Also, you will have access to the menu fields on that form and thus, can change the options and settings for the menu fields.

If you make any changes to options or settings that affect the appearance of the menu form or fields, you must force Vermont Views to update the menu on the screen. For example, if you make a current field on the current menu form UNAVAILABLE, the menu must be redisplayed so that this menu field is displayed with the unavailable attribute.

If you alter the appearance of the current menu, you can force Vermont Views to update the menu by calling to set the menu form option FMALTERED to ON. If you alter the appearance of other menus on the screen, and you want to see the changes immediately, you should call to update the menu form. Turning the FMALTERED option ON forces Vermont Views to update the menu the next time that it is made active; it will not update a menu that is not active until the user moves back into that menu.

The following code fragment from an action function shows how to make the current field unavailable and move to the next field in the menu.

unavail(mfmp)

MFORMPTR mfmp;

{

    ...

    sf_opt(UNAVAILABLE, ON, curmfldp(mfmp));    

    sfm_nextitem(AC_NEXTITEM, mfmp);

    smn_opt(FMALTERED, ON, mfmp);

    return(SAMELEVEL);

}


Home Contents Previous Next