The configuration of context menus in the SuperMap iDesktopX application interface can be implemented using <contextMenu>...</contextMenu> tags. Each <contextMenu>...</contextMenu> tag corresponds to one context menu. All context menu configurations in a configuration file should be placed between <contextMenu>...</contextMenu> tags. The following sections detail the attributes and functions of the <contextMenu>...</contextMenu> tag.
<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>
Context menus share the same configuration tags with ribbon configurations, but currently only support group, button, and buttonDropdown configurations. Items enclosed within <group>...</group> tags form a group. When multiple groups are configured in a context menu, separators will be automatically added between them. The attributes of <group>...</group> tags are defined as follows:
- index: Determines the display order of groups when multiple groups exist in a context menu.
- id: Enables merging of groups from different configuration files. Groups with identical IDs from different plugins will be combined into a single group during display.
- visible: Controls group visibility (true: visible, false: hidden).
- label: Specifies the group title.
Related Topics