[Previous] [Contents] [Index] [Next]

ApModifyItemState()

Modify the state of menu items

Synopsis:

#include <Ap.h>

int ApModifyItemState( ApMenuLink_t *menu,
                       int state,
                       int item_no, 
                           item_no, ..., NULL );

Description:

ApModifyItemState() modifies the state of menu items in a PhAB menu module. The arguments are:

menu
A pointer to a PhAB menu link structure.
state
The state you want to set for the menu items:
item_no, item_no, ..., NULL
A list of menu items, followed by NULL to terminate the list. The menu items are values that are generated by PhAB for each menu item in a menu module.

You can call ApModifyItemState() at any time to set the menu item states and the effect will be seen when the menu is displayed. This lets you set menu item states as soon as conditions within your application change.

Returns:

1
Successful completion

Examples:

In this example, mymenu is a pointer to the address of the menu name, which is equivalent to the instance name for the menu module.

/* Dim the ABN_opt1, ABN_opt2, and ABN_opt3 menu items. */
ApModifyItemState( &mymenu, AB_ITEM_DIM, ABN_opt1, ABN_opt2,
                 ABN_opt3, NULL );

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

ApGetItemText(), ApModifyItemText()

"Enabling, disabling, or toggling menu items" in the Working with Code chapter of the Photon Programmer's Guide


[Previous] [Contents] [Index] [Next]