18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

WORKING WITH THE ARCGIS CONTROLS<br />

If you are using JavaBeans, the buddy control can<br />

only be set through code as this property is not<br />

exposed in the integrated development environment<br />

(IDE) property pages.<br />

TOOLBARCONTROL<br />

The ToolbarControl works in conjunction with a buddy control. The buddy control<br />

can be a MapControl, PageLayoutControl, ReaderControl, SceneControl, or GlobeControl.<br />

The buddy control can be set at design time through the ToolbarControl property<br />

pages (in development environments that support property page capability) or<br />

programmatically using the SetBuddyControl method when the container hosting<br />

the ToolbarControl is displayed. The ToolbarControl hosts a panel of commands,<br />

tools, tool controls, and menus that work with the display of the buddy control.<br />

An application that uses the ToolbarControl<br />

and the GlobeControl<br />

To link a custom control that you have created<br />

to the ToolbarControl the custom control<br />

must implement the IToolbarBuddy interface.<br />

Each ToolbarControl buddy control implements the IToolbarBuddy interface. This<br />

interface is used to set the CurrentTool property of the buddy control. For example,<br />

imagine a ToolbarControl that is hosting a Page Zoom In tool and has a<br />

PageLayoutControl as its buddy. When the end user clicks on the Page Zoom In tool<br />

on the ToolbarControl, it will become the CurrentTool of the PageLayoutControl. The<br />

implementation of the Page Zoom In tool will query the ToolbarControl to access<br />

its buddy control—the PageLayoutControl—and retrieve the PageLayout. It will<br />

then provide the implementation for displaying the rectangle dragged by the end<br />

user and changing the extent of the PageLayout.<br />

CONTROL COMMANDS<br />

<strong>ArcGIS</strong> <strong>Engine</strong> provides a set of commands, tools, and menus to work with the<br />

<strong>ArcGIS</strong> controls. For example, there is a map navigation, feature selection, and<br />

graphic element commands suite that works with the MapControl and<br />

PageLayoutControl. Likewise, there is a suite of commands for the SceneControl,<br />

GlobeControl, and ReaderControl. For applications using an individual control, these<br />

commands can work directly with the control by programmatically creating a new<br />

instance of the command and passing the control to the command’s OnCreate<br />

event. For applications using the ToolbarControl in conjunction with a buddy<br />

control, these commands can be added to the ToolbarControl either through the<br />

Chapter 3 • Developing with <strong>ArcGIS</strong> controls • 47

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!