Prototype
CustomMenuInfo* __cdecl fnGetCustomMenu ( unsigned long ulThemeKey );
Return value
The return value is a pointer to a CustomMenuInfoor NULL if no menues are added.
Parameters
ulThemeKey
Theme specific data. This value was defined by the plugin in the fnLoadShapes function.
Remarks
This function adds menu items to a single layer. Menues can be set on layer level, allowing each layer to have it's own menu. The plug-in defines the menu items, and gets notified whenever the user makes a menu selection through the fnHandleCustomEvent function.
If this function returns NULL, or an improper CustomMenuInfo structure, no menu will be added.
Example
#define CUSTOM_EVENT_REMOTE_STATUS 1 #define CUSTOM_EVENT_DATA_CHANGES_CHECK 2 CustomMenuItem* __cdecl fnGetCustomMenu(unsigned long ulThemeKey) { MyThemeData *pData = (MyThemeData*) ulThemeKey; if (pData->bHasMenu) { static CustomMenuItem menu[] = { /* First row contains menu name & number of * items (including menu name & separators) */ { L"My Menu Name", 2, TRUE, NULL }, { L"&View Remote Server...", CUSTOM_EVENT_REMOTE_STATUS, TRUE, L"Shows status information of remote server" }, { NULL, 0, FALSE, NULL }, /* This is a menu separator item */ { L"&Check for data changes...", CUSTOM_EVENT_DATA_CHANGES_CHECK, TRUE, L"Check if more data has arrived." }, }; return menu; } return NULL; }
See Also
Loader API, fnLoadShapes, fnHandleCustomEvent, CustomMenuInfo