【正文】
? Symbology Private Sub btnSaveMXD_Click(…) Handles Dim sFilePath As String = c:\temp\ Dim mapDoc As IMapDocument = New MapDocument If not (sFilePath) Then (sFilePath) 39。 2022 ESRI. All rights reserved. 324 框架控件 ? ToolbarControl 和 TOCControl 被設計成和其它控件協(xié)同工作 ?通過一個 buddy控件自動捆綁在一起 ?根據(jù)彼此的狀態(tài)通信和同步 ?例子 : active tool, layer visibility Buddy Control Toolbar TOC Tool Developing Applications with ArcGIS Engine Copyright 169。Set layer visibility to be controlled programmatically = 39。 2022 ESRI. All rights reserved. 328 ToolbarControl ?自定義 mands, tools 和 menus的容器 ?允許命令和以下控件對象進行交互 ? Map, PageLayout, Scene, 和 Globe ?必須調(diào)用 SetBuddyControl ?庫 ? Developing Applications with ArcGIS Engine Copyright 169。 2022 ESRI. All rights reserved. 331 加載內(nèi)置的命令 , 菜單和工具條 ?三種方式 ?創(chuàng)建一個新的實例 ?使用 ProgID 字符串 ?創(chuàng)建并定義一個 UID (傳入 ProgID 或 CLSID參數(shù) ) ?可以在技術(shù)文檔 “Controls Commands” 找到內(nèi)置的命令 , 菜單 , 和工具條 39。 2022 ESRI. All rights reserved. 332 加載項的不同方法 Public Sub AddMapCommands() 39。s COM (ActiveX Control), .NET (Windows Control) COM (ActiveX Control), .NET (Windows Control), Java (Visual Java Bean), C++ (Motif Wigit) 支持的平臺 Windows Windows, UNIX 包括一組 Reader 命令 No Yes CoCreatable objects ArcReaderSearchDef, ArcReaderConfiguration ARSearchDef, ARConfiguration 是否可以用 ArcObjects來擴展 No Yes, for PMFs published with permission to load into a customized application, and published with unrestricted access to its contents 與 ToolbarControl 和 TOCControl協(xié)同開發(fā)應用 No Yes, for PMFs published with permission to load into a customized application, and published with unrestricted access to its contents Developing Applications with ArcGIS Engine Copyright 169。Load pmf file Dim fileName As String = C:\arcgis\ArcTutor\ArcReader and Publisher\Gulf of St. If (fileName) Then (fileName, ) End If 39。 2022 ESRI. All rights reserved. 338 練習 3 總結(jié) ?創(chuàng)建一個控件應用程序 ?使用 MapDocument 和 ObjectCopy ?使用控件成員 ?使用工具條和 TOC控件 ?加載 MXD 文檔 ?保存新文檔 Developing Applications with ArcGIS Engine Copyright 169。Determine whether the magnifier window is open If () = False Then 39。 2022 ESRI. All rights reserved. 336 ReaderControl 命令 ? Commands ? Tools ? ToolControls ? Toolbars Developing Applications with ArcGIS Engine Copyright 169。 2022 ESRI. All rights reserved. 333 ArcReaderControl vs. ReaderControl ? ArcReaderControl ?屬于 ArcGIS Desktop ?需要有 ArcGIS Publisher extension才能使用 ?能構(gòu)建和分發(fā)獨立應用程序 ?需要安裝 ArcReader ? ReaderControl ?屬于 ArcGIS Engine ?需要 ArcGIS Engine Runtime Developing Applications with ArcGIS Engine Copyright 169。Adding a mand by ProgID Dim sProgID As String = (sProgID) 39。Check if the right mouse button is clicked If ( = 2) Then = True () End If End Sub Developing Applications with ArcGIS Engine Copyright 169。 2022 ESRI. All rights reserved. 327 TOCControl 事件 ?Labeling ?Mouse move ?Key press ?HitTest(TocClick例子代碼 ) ? X 和 Y 鼠標位置 ? ItemType ? BasicMap ? Layer ? Unk: ILegendGroup ? Data: Legend class index Private Sub AxTOCControl_OnBeginLabelEdit(…) Handles 39。 2022 ESRI. All rights reserved. 326 ITOCControl 成員 ? TOCControl 屬性 ? Buddy, SetBuddyControl, SetActiveView ? LabelEdit, LayerVisibilityEdit: 默認是自動的 ? MousePointer Private m_TOCControl As ITOCControl Private Sub Form_Load(…) Handles