Supported with:
- ArcView
- ArcEditor
- ArcInfo
Library dependencies: System, SystemUI, Geometry, Display, Server, Output, Geodatabase, GISClient, ArcWeb, DataSourcesFile, DataSourcesGDB, DataSourcesOleDB, DataSourcesRaster, DataSourcesNetCDF, GeoDatabaseDistributed, GeoDatabaseExtensions, Carto, NetworkAnalysis, Location, GeoAnalyst, Animation, Maplex, Geoprocessing, NetworkAnalyst, Schematic, SpatialAnalyst, 3DAnalyst, GlobeCore, Publisher, TrackingAnalystAdditional library information: Contents,
Object Model Diagram
The Framework library provides core components and software interfaces to support user interface components and the ArcGIS applications. A number of the objects in the Framework library are used internally by the ArcGIS applications to support their customization environment. There are a number of helper objects in Framework that developers can use when creating user interfaces for inclusion in one of the ArcGIS applications; ComPropertySheet and MouseCursor are two examples, along with a set of dialogs that support common UI operations within an ArcGIS application; ColorSelector, SymbolPickerDialog and NumberDialog, are three commonly used dialogs.
The Framework library defines the software interfaces that developers use when creating user interfaces for extending the ArcGIS system using property pages and dockable windows.
The Framework library is not extended by the developer, but by implementing interfaces defined in the library developers can extend the ArcGIS architecture with UI components.
The objects that implement this functionality are grouped into a number of library subsystems. These library subsystems are:Application
The Application object is the core object that represents an ArcGIS application (ArcMap, ArcCatalog, or other). Through this object, you can access properties and methods for the application and navigate to other elements, such as the document, window handle, and status bar.
The Application object represented here in the Framework library is an abstract class for the application. The interfaces shown here are those that are common to all of the ArcGIS applications. Each running ArcGIS application is represented by an instance of an Application object—ArcCatalog by Application from the ESRI.ArcGIS.ArcCatalog library, and ArcMap by Application in the ESRI.ArcGIS.ArcMap library, for example.
The Application object's primary interface is IApplication. This interface provides access to the Document object, the StatusBar object, the Templates object, the currently selected tool, and the Visual Basic Editor. There are several methods that allow you to open, save, and print documents, lock and unlock the application from user customizations, display dialogs, and exit the application.
The Application object implements the IVbaApplication interface, which allows you to programmatically insert, remove, and run VBA code without actually opening the Visual Basic Editor.
The IWindowPosition interface has methods to move and resize a window. Any window object can implement this interface. All the ArcGIS application windows implement this interface.
The Templates object is a collection of the templates that are currently loaded in the application. A template is a document that is used as a starting point for creating new documents. It carries customizations of several types—user interface, VBA project, and application-specific data. ArcMap has two or three templates loaded with an application. If the document is based on the Normal template, two items are in the templates collection. If the document is based on a project template, three items are in the templates collection. An ArcScene or ArcGlobe document is based on the Normal template; there are always two items in the templates collection. ArcCatalog always has one item in the templates collection; this item represents Normal.gxt. The ITemplates interface allows you to get a count of the loaded templates and get the pathnames of those templates.
This
Document object only represents the generic document properties common to all ArcGIS applications. Each application has its own document object. The document object in ArcMap is called
MxDocument; for further discussion, see the
ESRI.ArcGIS.ArcMapUI library. The document object in ArcCatalog is called
GxDocument; for further discussion, see the
ESRI.ArcGIS.ArcCatalog library. Even though ArcCatalog doesn't use documents, it has a document object associated with it. The document object in ArcScene is called
SxDocument in the ESRI.ArcGIS.ArcScene library, and the one in ArcGlobe is called
GMxDocument in the ESRI.ArcGIS.ArcGlobe library. The document provides access to the user interface elements and the VBA project. Use the
Document property of the
IApplication interface to get a reference to the document. The
IDocument interface provides access to the document's title, type, accelerator table, command bars collection, parent application, and Visual Basic for Applications project.
An Accelerator is a mapping between a particular keyboard combination and a command or tool. When you press the combination of keys on the keyboard, the command is executed or the tool is activated. For example, Ctrl-C is a well-known accelerator for copying something in Windows. Some commands in the application already have accelerators assigned to them but you can also assign additional accelerators to these commands. The IAccelerator interface defines the properties of an accelerator. Use the IAcceleratorTable.Add method to create an accelerator.
The AcceleratorTable is an object that contains a list of accelerator keys and the command identifiers associated with them. The IAcceleratorTable interface is used to add or find accelerators in an AcceleratorTable. You can get a reference to the AcceleratorTable of a document using IDocument.Accelerators.
DockableWindow
A dockable window is a window that can exist in a floating state or be attached to the main application window. The Table of Contents in ArcMap and the Tree View in ArcCatalog are examples of dockable windows. The Application object implements the IDockableWindowManager interface that is used to get access to a particular dockable window. The GetDockableWindow method finds a dockable window using the UID of the dockable window. You can use the IDockableWindow interface to query the properties of a dockable window such as the Caption, Name, and ID. This interface also has methods to return whether the window is currently visible, to display the window, and to dock the window in a particular location on the application. Use the IWindowPosition interface to size and position your dockable window.
To create your own dockable window, implement the IDockableWindowDef interface. This interface allows you to set properties, such as caption and name. You use the ChildHWND property to define what the window will consist of by passing in an hWnd of a control, such as a form, listbox, and so on.
The class you create is a definition for a dockable window; it is not actually a dockable window object. Once your class is registered in one of the dockable window component categories, the application uses the definition of the dockable window in your class to create the actual dockable window.
CommandBars
A CommandBar object represents a toolbar, a menubar, menu, or a context menu. With the ICommandBar interface you can modify a command bar such as adding a command, menu, or macro item to it.
CommandBars is a collection of the command bars associated with a document. The ICommandBars interface allows you to set properties for the command bars and to create, find, or hide command bars. Use IDocument.CommandBars to get a reference to the command bars collection.
Custom Toolbars and Menus
There are two basic types of custom command bars that you can create—document command bars and COM command bars. Document command bars can be created using built-in functionality in the applications. COM command bars can be created by implementing menus or toolbars in any COM-compliant language and compiling them into a DLL.
You can create custom document command bars using the Customize dialog box in the ArcGIS applications. To create a custom toolbar, use the New button on the Toolbars panel. To create a custom menu, go to the New Menu category on the Commands panel and drag the New Menu command to any toolbar or menu. These types of toolbars and menus are stored in a specific document or template and can only be used in that document or template.
The command bars collection uses command bar definitions (either ToolBarDef or MenuDef) to create command bars. For example, a class that implements IToolbarDef is only a definition for a toolbar; it is not actually a toolbar object. Once this class is registered in one of the command bar component categories, the command bars collection uses the definition of the toolbar in your class to create the actual command bar.
To create a custom toolbar, implement IToolbarDef found in the ESRI.ArcGIS.SystemUI library. The IToolbarDef interface is used to define the properties of a custom toolbar. You can set the caption and name of the toolbar and specify what command items are on the toolbar.
To create a custom menu, implement IMenuDef found in the ESRI.ArcGIS.SystemUI library. The IMenuDef interface is identical to the IToolbarDef interface except that it is used to indicate to the application that this is a menu. If you are creating a context menu, implement both IMenuDef and IShortcutMenu. IShortcutMenu is an indicator interface that is used only to indicate to the application that this menu should be treated as a context menu. If you are creating a root menu (a menu that will appear in the Menus command category in the Customize dialog box), implement both IMenuDef and IRootLevelMenu. IRootLevelMenu is an indicator interface that is used only to indicate to the application that this menu should be treated as a root menu.
Commands
A CommandItem is any item on a command bar. For example, button, tools, and menu items that appear on command bars are all commanditems. The ICommandItem interface allows you to get or set the properties of the commanditem such as caption, button image, statusbar message, tooltip, display style, help context ID, and more. You can obtain a reference to the command on which this item is based. The ICommandItem interface also provides methods to execute, delete, refresh, and reset the commanditem. Use either ICommandBars.Find or ICommandBar.Find to obtain a reference to a particular commanditem.
Custom Commands
As a developer you may want to add functionality to the ArcGIS applications by creating custom commands. Similar to custom commandbars, there are two basic types of commands that you can create—COM commands and document commands.
COM Commands
The term COM command is used here to refer the type of commands you create by implementing interfaces and compiling into dlls. You can create the following types of commands:
- Buttons and menu items are the simplest types of commands. Buttons generally appear as icons on toolbars and menu items appear in menus. A simple action is performed when the button or menu item is clicked.
- Tools are similar to buttons but they also require interaction with the application's display. The Zoom In command is a good example of a tool—you click or drag a rectangle over a map before the display is redrawn to show the map contents in more detail.
- Tool controls are commands that act like comboboxes or editboxes. Comboboxes let you choose an option from a drop-down list. For example, in ArcMap, you can choose which layer(s) you are selecting features from when working with a map. Editboxes are editable textboxes where you can type in text.
- A MultiItem object is a dynamic command that appears a zero or more adjacent menu items on a menu, depending on the state of the application.
A subtyped command object is a group of related commands that can share properties.
To create a custom COM command you would implement some of the ArcObjects interfaces that support commands such as ICommand, ITool, IToolControl, ICommandSubType, and IMultiItem. Refer to the
ESRI.ArcGIS.SystemUI library for more information on these interfaces.
Document Commands
Macro items and UIControls are document commands that can be created using the Customize dialog and the Visual Basic Editor in the ArcGIS applications. These VBA-based document commands are stored in a specific document or template and can only be used in that document or template.