User supplied callback procedure for handling menu commands.
typedef GSErrCode APIMenuCommandProc ( const API_MenuParams* menuParams );
Parameters
- menuParams
- [in] This structure contains the various parameters identifying the menu command.
Return Values
NoError
- The function has completed with success.
For other common API errors see the API Errors document.
Remarks
This is the function which will be called when your add-on installed it with ACAPI_Install_MenuHandler. For tool type add-ons, this is the replacement for the original DoCommand
function.
Example
// ----------------------------------------------------------------------------- // Menu command callback function // ----------------------------------------------------------------------------- GSErrCode __ACENV_CALL APIMenuCommand (const API_MenuParams *menuParams) { DBPrintf ("Test::APIMenuCommand () %d/%d\n", menuParams->menuItemRef.menuResID, menuParams->menuItemRef.itemIndex); switch (menuParams->menuItemRef.itemIndex) { case 1: Do_ListSectionLines (); break; /* ----- */ case 3: Do_OpenMyWindow (true); break; case 4: Do_CloseMyWindow (0, true); break; case 5: Do_OpenMyWindow (false); break; case 6: Do_CloseMyWindow (0, false); break; case 7: Do_CloseAllWindows (); break; default: break; } DisableEnableCloseCmd (); return NoError; } // APIMenuCommand
Requirements
- Version: API 4.1 or later
- Header: APIdefs_Callback.h