The configuration of the context menu in the SuperMap iDesktopX application interface can be accomplished using the <contextMenu>...</contextMenu> tag. One <contextMenu>...</contextMenu> tag corresponds to one context menu. The context menu configuration within a config file should be placed between <contextMenu>...</contextMenu> tags. The meaning and function of each attribute of the <contextMenu>...</contextMenu> tag are described in detail below.

<contextMenu id="SuperMap.Desktop._FormMap.FormMapContextMenu" index="12" label="map window_map">
<group id="MapOutput" index="2" label="save and output" visible="true">
<button checkState="false" image="../resources/MapView/Toolbar/MapOperator/GenerateMapCache.png" index="5"
label="generate map tiles (single process).." onAction="CtrlActionSingleCache" screenTip="" screenTipImage=""
shortcutKey="" visible="true"/>
<button checkState="false" image="../resources/MapView/Menu/MapOperator/MapCacheBuildMulti.png" index="6"
label="generate map tiles (multi-process).." onAction="CtrlActionMultiCache" screenTip="" screenTipImage=""
shortcutKey="" visible="true"/>
<button checkState="false" image="../resources/MapView/Menu/MapOperator/MapCacheCheck_16.png" index="7"
label="tile check..." onAction="CtrlActionMapCacheCheck" screenTip="" screenTipImage=""
shortcutKey="" visible="true"/>
</group>
</contextMenu>
The configuration items in the context menu share the same set of configuration tags as those in the Ribbon. However, only group, button, and buttonDropdown configurations are currently supported here. The items contained within the <group>...</group> tags form a group. If multiple groups are configured in a context menu, a separator will automatically be added between them. The meaning and function of each attribute of the <group>...</group> tag are as follows:
- index: Used to sort groups. If multiple groups exist in a context menu, the order of each group is determined by the value of this attribute.
- id: Groups support merging items from different config files. The merging is based on the id. This means we can configure a group for a context menu in config file A of a plugin, specifying an id, and simultaneously configure another group for the same context menu in config file B of another plugin, but specify the same id. When the system displays them, the items from these two groups will be merged and displayed under a single group in the context menu.
- visible: Specifies whether the content of this group is visible. A value of true indicates visible, and false indicates not visible.
- label: The control title.
Related Topics