18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

BUILDING APPLICATIONS WITH C++ AND CONTROL WIDGETS<br />

<strong>ArcGIS</strong> <strong>Engine</strong> also provides commands for use<br />

with the SceneControl and GlobeControl.<br />

Adding commands to the ToolbarControl<br />

<strong>ArcGIS</strong> <strong>Engine</strong> comes with more than 120 commands and tools that work with<br />

the MapControl, PageLayoutControl, and ToolbarControl directly. These commands<br />

and tools provide you with a lot of frequently used GIS functionality for<br />

map navigation, graphics management, and feature selection. You will now add<br />

some of these commands and tools to your application.<br />

1. Create a new function to add commands and tools to the ToolbarControl.<br />

a. The forward declaration of the function follows that for LoadData() in<br />

MapViewer.h:<br />

void LoadData();<br />

void AddToolbarItems();<br />

b. The function implementation for adding the prebuilt commands and tools<br />

goes in MapViewer.cpp after the LoadData function.<br />

void LoadData()<br />

{<br />

…<br />

}<br />

void AddToolbarItems()<br />

{<br />

long itemIndex;<br />

CComVariant varTool;<br />

varTool = L"esriControlCommands.ControlsOpenDocCommand";<br />

Chapter 6 • <strong>Developer</strong> scenarios • 375

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

Saved successfully!

Ooh no, something went wrong!