MenuItem Method
Note: Technically MenuItem (and RibbonButton) are Objects rather than Methods.
The programmer can create a MenuItem Object and then add it to a list of ContextMenu items. Similarly, there is no actual RibbonButton Method but a SisRibbonButton Object.
Description
Adds a custom command to a local menu.
See also Building GisLink Applications - Adding custom commands.
Syntax
SisMenuItem(strText, New SisClickHandler(AddressOf function))
Parameters
strText, Name of menu item. This is the same as the object’s Text property but specified when the object is created.
function, function to call when the menu item is clicked.
Properties
- Checked
- Show a tick against the menu item.
True
Tick False
No tick.
- Class
- The class of the menu item. If set to "Item" or "" then the command will be available for all Item classes.
- DefaultCommand
- Is this to be the default command.
True
The command to be default. False
The command not to be default.
True
The command to be enabled. False
The command to be greyed out.
SubMenu1: 0
SubMenu2: 1
SubMenu3: 2
For example, the following code will return “Test” for SubMenuItem1:
Dim parent As SisMenuItem = SubMenuItem1.Parent
MsgBox(parent.Text)
Remarks
Available: D
Groups:
Example
Dim mMainMenu As SisMenuItem = New SisMenuItem("Batch Translator", New SisClickHandler(AddressOf Translate))
mMainMenu.Text = "Batch Translator"
mMainMenu.Help = "Translates multiple files between supported formats"