| Table of Contents menu_InsertItem
 
This function has been deprecated. Please use menu_InsertItem2 instead.
 DescriptionAdd an item to the menu in L3DT. Function prototypebool CExtAPI::menu_InsertItem(const char* lpFnName, const char* lpOptionName); Arguments
 Return valueFalse if an error occurred, and true otherwise. CommentsUse with zeofunc_LoadFuncThe lpFnName argument must be the name of a function loaded from your plugin via the zeofunc_LoadFunc method. See the example provided below. Where the menu items goAll menu items are created in the 'Extensions→[your plugin name]' menu in L3DT. Sub-menusThe '.' (dot) character is used to delimit nested menus. Thus, if you provide an lpOptionName of “mysubmenu.myoption”, your option will appear at 'Extensions→[your plugin name]→mysubmenu→myoption'. Unfortunately, this means you cannot use dots for abbreviations or ellipsis (e.g. 'about…') ExampleThis is from the InitPlugin funtion of atSphericalDistort: // create the info function
theAPI.zeofunc_LoadFunc("ExtAbout", VarID_void, NULL); 
	
// create the worker function (SphericalDistort)
ZLIST hArgs = theAPI.var_CreateTemp(VarID_varlist);
theAPI.list_CreateItem(hArgs, VarID_map, "hMap");
theAPI.list_CreateItem(hArgs, VarID_double, "radius");
theAPI.zeofunc_LoadFunc("ExtSphericalDistort", VarID_bool, hArgs);
theAPI.var_Delete(hArgs); // delete temp arg list
// create the user-interface function (SphericalDistortUI)
theAPI.zeofunc_LoadFunc("ExtSphericalDistortUI", VarID_bool, NULL);
// add menu options (HERE IS THE MENU EXAMPLE)
theAPI.menu_InsertItem("ExtSphericalDistortUI", "Distort heightfield");
theAPI.menu_InsertItem("ExtAbout", "About");Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported |