许可优化
许可优化
产品
产品
解决方案
解决方案
服务支持
服务支持
关于
关于
软件库
当前位置:服务支持 >  软件文章 >  ArcGIS Pro二次开发:常用右键菜单ID和位置详解(第20篇)

ArcGIS Pro二次开发:常用右键菜单ID和位置详解(第20篇)

阅读数 4
点赞 0
article_banner


ArcGIS Pro SDK中的弹出式右键菜单非常多,在地图视图、布局视图、地理处理、文件目录等地方,随便右键点击某个文件、要素,一般都会弹出一个右键菜单。这些菜单实际上都有一个专有ID进行 控制 ,总数量估计得有数百个?。

目前,我也只接触了几个常用的,在这里列出来,方便以后查阅。后面用多了,就在这个帖子里慢慢补充。


一、常用右键菜单

1、esri_mapping_layerContextMenu

右键点击【要素图层】会弹出的菜单。

2、esri_mapping_groupLayerContextMenu

右键点击【图层组】会弹出的菜单。

3、esri_mapping_standaloneTableContextMenu

右键点击【独立表】会弹出的菜单。

4、esri_mapping_rasterLayerContextMenu

右键点击【栅格图层】会弹出的菜单。

5、esri_mapping_mapContextMenu

右键点击【地图内容目录】会弹出的菜单。

6、esri_mapping_selection2DContextMenu

【在地图视图框内选择要素】并右键点击会弹出的菜单。

二、在Config.daml中更新右键菜单

上面列举的6个常用右键菜单,都是以【esri_mapping】为前缀的,也就是都在【esri_mapping】模块下。

在Config.daml文件中的</insertModule>下方,输入<updateModule>模块,代码如下:

…………………………       <controls>        <button id="MenuList_TestButton" caption="示例按钮" className="TestButton3" loadOnClick="true" smallImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonBlue16.png" largeImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonBlue32.png">          <tooltip heading="Tooltip Heading">Tooltip text<disabledText /></tooltip>        </button>      </controls>    </insertModule>    <!--更新系统自带的工具菜单、工具栏等-->    <updateModule refID="esri_mapping">      <menus>        <!--图层的右键菜单-->        <updateMenu refID="esri_mapping_layerContextMenu">          <insertButton refID="MenuList_TestButton" />        </updateMenu>        <!--图层组的右键菜单-->        <updateMenu refID="esri_mapping_groupLayerContextMenu">          <insertButton refID="MenuList_TestButton" />        </updateMenu>        <!--独立表的右键菜单-->        <updateMenu refID="esri_mapping_standaloneTableContextMenu">          <insertButton refID="MenuList_TestButton" />        </updateMenu>        <!--栅格图层的右键菜单-->        <updateMenu refID="esri_mapping_rasterLayerContextMenu">          <insertButton refID="MenuList_TestButton" />        </updateMenu>        <!--地图列表的右键菜单-->        <updateMenu refID="esri_mapping_mapContextMenu">          <insertButton refID="MenuList_TestButton" />        </updateMenu>        <!--地图视图内的右键菜单-->        <updateMenu refID="esri_mapping_selection2DContextMenu">          <insertButton refID="MenuList_TestButton" />        </updateMenu>      </menus>    </updateModule>

这里需要注意的是,菜单ID比较长,又不能自动补充,手输容易出错,尽量用 复制的  

目前这6个菜单都在【<updateModule refID="esri_mapping">】下。但有更多的菜单并不在这里面。具体参考官方的这个文档:

arcgis-pro-sdk/DAML at 1e9cd2f1b45e8f2565a0d3383e32130c6385de7b · Esri/arcgis-pro-sdk · GitHub

量比较大,也实在记录不过来,以后用到的再慢慢补吧。


三、工程文件分享

最后,放上工程文件的 链接  

MenuListhttps://pan.baidu.com/s/1z4xlh6P7WSuhzKA8zVW3XQ?pwd=f2g2

PS:可以直接点击...bin\Debug\net6.0- windows  \下的.esriAddinX文件直接安装。





免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删
相关文章
技术文档
QR Code
微信扫一扫,欢迎咨询~
customer

online

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 board-phone 155-2731-8020
close1
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

姓名不为空

姓名不为空
手机不正确

手机不正确

手机不正确
公司不为空

公司不为空

公司不为空