Cadcorp SIS API Methods
MenuItem Method
Note: Strictly speaking 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 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.
- 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. |
Enabled
To enable the local menu command, i.e. if the menu item is to be shown enabled or greyed out.
True
|
The command to be enabled. |
False
|
The command to be greyed out. |
Filter
Optionally specifies a named Filter which all selected Items must pass for the command to be available.
Help
The prompt text to be displayed when the command is highlighted.
Image
Image to show in local menu.
Index
Read-only property. Gets the position index number of a menu item. In the example below, the index numbers returned for each submenu would be:
SubMenu1: 0
SubMenu2: 1
SubMenu3: 2
IsParent
Read-only property. Check if a menu item is a parent control or not. Returns -1 for true, 0 for false.
Locus
Optionally specifies a named Spatial Filter which all selected Items must pass for the command to be available.
MaxSelection
The maximum number of Items which may be selected to enable this command.
MenuItemCollection
The context menu item name.
MenuItems
The menu command string. The GisLink customisation must have a button on the main form with this string as the Caption.
MinSelection
The minimum number of Items which must be selected to make this command valid. If MinSelection is set to -1 then Hittable and Editable Items are valid. If MinSelection is set to 0 then no Items have to be selected. If MinSelection is set to 1 then only Editable Items are valid.
MinStatus
The minimum status of the Item, i.e. SIS_HITTABLE.
Parent
Gets the parent menu item of the current menu item.
For example, the following code will return “Test” for SubMenuItem1:
Dim parent As SisMenuItem = SubMenuItem1.Parent
MsgBox(parent.Text)
Tag
Get or set the tag.
Text
Text shown in the local menu.
Remarks
Available: MD ME MM
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"
mMainMenu.Class = ""
Send comments on this topic.
Click to return to www.cadcorp.com
© Copyright 2000-2017 Computer Aided Development Corporation Limited (Cadcorp).