AOVBA开发教程(I)客户化界面及VBEditor的使用

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
All customizations are saved
Normal template, Base template, or the current document
当前地图将越过任何的模板
For example, controls can be added or removed
Save in:
ArcCatalog 只使用Normal模板
Copyright © 2001, 2002 ESRI. All rights reserved.
Introduction to Programming ArcObjects with VBA
2-16
Storing your customizations
2-2
AO开发的一般步骤
1.用AO术语对问题进行描述和定义,合理地将大任务合理划分为一些子 任务;
2.理解AO的层次组织关系,标识和明确各子任务的关键字; 3.决定在什么地方来编写代码,是VBA呢,还是VB或其它工具; 4.根据标识的关键字在AO Developer help和其它开发资源中搜索有没有
Accessing your customizations
ArcMap has three levels of storage 在启动的时候模板将按顺序的加载
影响所有的文档
影响所有使用该模板的文 档
影响当前文档
Normal Template Base Template(*.mxt) This Document(*.mxd)
Name Image Display text or image Begin a group
Copyright © 2001, 2002 ESRI. All rights reserved.
Introduction to Programming ArcObjects with VBA
2-15
有一些没有被放到缺省的界面上
Drag commands onto toolbars or menus
Command Categories
Commands
Copyright © 2001, 2002 ESRI. All rights reserved.
Introduction to Programming ArcObjects with VBA
Storing and distributing customizations Visual Basic Editor
Code storage Modules Procedures
Visual Basic statements
Copyright © 2001, 2002 ESRI. All rights reserved.
2-10
The Customize dialog
客户化对话框的三个页面:
Toolbars: Turn toolbars on or off, create new toolbars Commands: Drag new commands onto the interface Options:管理客户化的口令等等.
Lesson overview
VBA开发环境 使用客户化对话框进行以下操作
Create new toolbars and commands Add, delete, and move commands Set control properties
存储和发布客户化结果 Visual Basic Editor
Create a new toolbar Add existing commands to the interface 重排界面命令顺序 Create a new UIControl Change command properties 重新设置工具条到初始状态
Copyright © 2001, 2002 ESRI. All rights reserved.
2-13
Creating a new command
在UIControls 分类中
选择User-created commands
Four types
Button Tool EditBox ComboBox
Copyright © 2001, 2002 ESRI. All rights reserved.
从新排列或移除现有的命令条目 Add new toolbars and commands Change command properties
Copyright © 2001, 2002 ESRI. All rights reserved.
Introduction to Programming ArcObjects with VBA
Introduction to Programming ArcObjects with VBA
2-3
AO开发的方式比较
Copyright © 2001, 2002 ESRI. All rights reserved.
Introduction to Programming ArcObjects with VBA
相关示例代码。 5. 打开正确的对象模型图(OMD),寻找所需要的类、接口。 6. 在AO Component Help中浏览有关接口的详细说明及相关文档; 7. 在开发环境中使用确定的接口及其方法属性等,完成代码实现。
Copyright © 2001, 2002 ESRI. All rights reserved.
2-7
The VBA development environment
与所有的使用VBA的应用程序类似的环境
Customize dialog box: Interface customization Visual Basic Editor: Writing code
Customize dialog box
Introduction to Programming ArcObjects with VBA
2-14
Setting control properties
Customize dialog box must be open Right-click a control to view and change properties Characteristics that define appearance
Visual Basic Editor
Copyright © 2001, 2002 ESRI. All rights reserved.
Introduction to Programming ArcObjects with VBA
2-8
ArcGIS commands
Toolbars and menus contain commands Commands are buttons, menus, macros, and UIControls 每个命令都连接了代码
当事件触发的时候,相应的代码将被运行
Copyright © 2001, 2002 ESRI. All rights reserved.
Introduction to Programming ArcObjects with VBA
2-19
示范
Using the Customize dialog box to …
• 是基于Microsoft® COM技术所构建的一系列COM组件集。 • 开发人员可以在AO组件对象的基础上开发出更加强大灵活的应
用系统。
Copyright © 2001, 2002 ESRI. All rights reserved.
Introduction to Programming ArcObjects with VBA
Introduction to Programming ArcObjects with VBA
2-20
使用VB编辑器
The VBA development environment Customize dialog box
Create new toolbars and commands Add, delete, and move commands Set control properties
Introduction to Programming ArcObjects with VBA
2-21
The Visual Basic Editor
Project Explorer
Projects
Code Modules
Copyright © 2001, 2002 ESRI. All rights reserved.
A
Copyright © 2001, 2002 ESRI. All rights reserved.
Introduction to Programming ArcObjects with VBA
2-11
Using the Customize dialog box
所有的命令按分类组织 All ArcMap or ArcCatalog commands are here
Introduction to Programming ArcObjects with VBA
2-5
The VBA development environment(I)
Copyright © 2001, 2002 ESRI. All rights reserved.
Introduction to ProgrCode storage Modules Procedures
Visual Basic statements
Copyright © 2001, 2002 ESRI. All rights reserved.
Introduction to Programming ArcObjects with VBA
2-4
AO VBA开发培训总体过程安排
VBA skills
Objects
Maps & Layers
Data Management
Classes
Object Model Subsets & Diagrams Selections
Application Framework
Copyright © 2001, 2002 ESRI. All rights reserved.
ArcObjects的开发
Copyright © 2001, 2002 ESRI. All rights reserved.
Introduction to Programming ArcObjects with VBA
AO是什么?
• AO(ArcObjects的缩写)是ESRI公司ArcGIS™ 家族中应用程 序ArcMap™, ArcCatalog™ 和 ArcScene™的开发平台。
Toolbar
Commands
Copyright © 2001, 2002 ESRI. All rights reserved.
Introduction to Programming ArcObjects with VBA
2-9
Using the Customize dialog box
打开客户化对话框,使界面进入设置模式 在客户化对话框打开的状态,你可以 …
Procedures
Introduction to Programming ArcObjects with VBA
2-22
Understanding ArcMap software’s code storage
Project Explorer: Organizes projects (levels of customization) Project: Folder that stores modules (e.g., Normal.mxt) Module: Document that stores code Procedure: A block of code (e.g., macros) Statement: A line of code
Copyright © 2001, 2002 ESRI. All rights reserved.
Normal.mxt
Introduction to Programming ArcObjects with VBA
2-18
查看控件的源代码
命令拥有各种事件 (e.g., Click, Double-click, MouseUp, KeyDown, KeyUp)
相关文档
最新文档