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.

BUILDING APPLICATIONS WITH THE ARCGIS CONTROLS<br />

The modeless CustomizeDialog box for<br />

ToolbarControl<br />

Toolbars, and ESRI Controls Menus component categories. If<br />

required you can change the CustomizeDialog to use alternative<br />

component categories. The end user can add these commands,<br />

toolsets, and menus to the ToolbarControl either by dragging and<br />

dropping them onto the ToolbarControl or double-clicking them.<br />

The CustomizeDialog is modeless to allow the user to interact<br />

with the ToolbarControl. When the CustomizeDialog is launched<br />

with the StartDialog method, the method call returns immediately<br />

while the CustomizeDialog remains open on the screen. To keep a<br />

reference to the CustomizeDialog while it is open, it is sensible<br />

practice to store a class-level variable to the CustomizeDialog and<br />

to listen to its ICustomizeDialogEvents. Refer to the ‘Building<br />

applications’ scenarios in Chapter 6, ‘<strong>Developer</strong> scenarios’, to see<br />

how to display the CustomizeDialog when the ToolbarControl is in<br />

customize mode.<br />

OperationStack<br />

The ToolbarControl has an OperationStack that is used to manage undo and redo<br />

functionality. Operations are added to the operation stack by each ToolbarItem’s<br />

underlying command so the operation can be rolled forward and rolled back as<br />

desired. For example, when a graphic element is moved, the operation can be<br />

undone by moving the graphic back to its original location. Whether or not a<br />

command makes use of an OperationStack depends on its implementation.<br />

Typically, you create a single ControlsOperationStack for an application (by<br />

default, the OperationStack property is Nothing) and sets it into each<br />

ToolbarControl. Undo and Redo commands can be added to the ToolbarControl that<br />

proceed through the OperationStack.<br />

APPLICATION DEVELOPMENT WITHOUT THE TOOLBARCONTROL<br />

While building applications with the ToolbarControl can quickly provide pieces of<br />

a framework similar to the <strong>ArcGIS</strong> Desktop application framework, there are<br />

times when the ToolbarControl is not required for an application:<br />

• The visual appearance of the ToolbarControl may not match that of the application.<br />

• The overhead of implementing Command objects for the ToolbarControl is not<br />

required.<br />

• There is an existing application framework present in the application.<br />

• The ToolbarControl and the commands it hosts do not easily work across multiple<br />

buddy controls.<br />

In such circumstances, you must work directly with the MapControl,<br />

PageLayoutControl, SceneControl, GlobeControl, or ReaderControl. Any additional user<br />

interface components needed by the application, such as command buttons,<br />

status bars, and list boxes, may be supplied by development environment.<br />

54 • <strong>ArcGIS</strong> <strong>Engine</strong> <strong>Developer</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!