MenuInsertCommandsΒΆ
MenuInsertCommands inserts a new menu item to a pop-up menu.
- bool = MenuInsertCommands(ssPopup, svCommands, nPos)
Return Value
bool.
Parameters
- ssPopup
ssPopup is the name of a pop-up menu. A list of all pop-up menu names can be retrieved with the MenuGetNames function. Commands can be added to the following pop-up menus:
OBJ_CB
OBJ_EB
OBJ_LAYER
OBJ_LAYER-Autoscale
OBJ_LAYER-Background
OBJ_LAYER-X-Axis
OBJ_LAYER-Y-Axis
OBJ_LAYER-Z-Axis
OBJ_LB
OBJ_OLE
OBJ_PAGE
OBJ_PAGE-Export
OBJ_RB
OBJ_SYNEDITOR
OBJ_TB
OBJ_XY
OBJ_XY-Cursor
OBJ_XY-Multi
OBJ_XY-New
OBJ_XY-Text
OBJ_XY-Transformation
OBJ_XYZ
OBJ_XYZ-CrossSection
- svCommands
svCommands is a function name or a vector of function names. Instead of a function name the name of a pop-up menu followed by an @-sign followed by the display text can be specified to add an pop-up menu to a context menu. MenuCreatePopup function is used to create the pop-up menu. See example.
- nPos
nPos specifies the insert position in the menu. To add an item at top set nPos = 1. To add the items at the end of the menu use a high number, for example 32000.
Example
Add Menu item to the text object context menu:
MenuInsertCommands("OBJ_TB", [""; "MyLegendFunc"], 32000);
MnSetCommand("MyLegendFunc", "Legende...");
Add pop-up menu to the context menu of a text object:
MenuCreatePopup("OBJ_TB-Legend", [..
"_Test1";
"_Test2"]);
MenuInsertCommands("OBJ_TB", [""; "OBJ_TB-Legend@Legende"], 32000);
MnSetCommand("_Test1", "Legende1...");
MnSetCommand("_Test2", "Legende2...");
See also
id-1504037