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 />

g_ipToolbarControl->AddItem(varTool, 0, -1, VARIANT_FALSE, 0,<br />

esriCommandStyleIconOnly, &itemIndex);<br />

// Add PageLayout Navigation Commands<br />

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

g_ipToolbarControl->AddItem(varTool, 0, -1, VARIANT_TRUE, 0,<br />

esriCommandStyleIconOnly, &itemIndex);<br />

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

g_ipToolbarControl->AddItem(varTool, 0, -1, VARIANT_FALSE, 0,<br />

esriCommandStyleIconOnly, &itemIndex);<br />

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

g_ipToolbarControl->AddItem(varTool, 0, -1, VARIANT_FALSE, 0,<br />

esriCommandStyleIconOnly, &itemIndex);<br />

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

g_ipToolbarControl->AddItem(varTool, 0, -1, VARIANT_FALSE, 0,<br />

esriCommandStyleIconOnly, &itemIndex);<br />

varTool =<br />

L"esriControlCommands.ControlsPageZoomPageToLastExtentBackCommand";<br />

g_ipToolbarControl->AddItem(varTool, 0, -1, VARIANT_FALSE, 0,<br />

esriCommandStyleIconOnly, &itemIndex);<br />

varTool =<br />

L"esriControlCommands.ControlsPageZoomPageToLastExtentForwardCommand";<br />

g_ipToolbarControl->AddItem(varTool, 0, -1, VARIANT_FALSE, 0,<br />

esriCommandStyleIconOnly, &itemIndex);<br />

// Add Map Navigation Commands<br />

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

g_ipToolbarControl->AddItem(varTool, 0, -1, VARIANT_TRUE, 0,<br />

esriCommandStyleIconOnly, &itemIndex);<br />

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

g_ipToolbarControl->AddItem(varTool, 0, -1, VARIANT_FALSE, 0,<br />

esriCommandStyleIconOnly, &itemIndex);<br />

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

g_ipToolbarControl->AddItem(varTool, 0, -1, VARIANT_FALSE, 0,<br />

esriCommandStyleIconOnly, &itemIndex);<br />

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

g_ipToolbarControl->AddItem(varTool, 0, -1, VARIANT_FALSE, 0,<br />

esriCommandStyleIconOnly, &itemIndex);<br />

}<br />

c. Call the new function from main after the controls are buddied.<br />

g_ipTOCControl->SetBuddyControl(g_ipPageLayoutControl);<br />

Information on the <strong>ArcGIS</strong> <strong>Engine</strong> control<br />

commands, including GUIDS, descriptions, and<br />

which controls each command can interact with,<br />

can be found in the <strong>ArcGIS</strong> <strong>Engine</strong> <strong>Developer</strong> Kit<br />

Help system under Technical Documents, Names<br />

and Ids, Control Commands.<br />

AddToolbarItems();<br />

2. Remake and run the application. The ToolbarControl now contains <strong>ArcGIS</strong><br />

<strong>Engine</strong> commands and tools that you can use to navigate the map document<br />

loaded into the PageLayoutControl. Use the page layout commands to navigate<br />

around the page layout and the map commands to navigate around the<br />

data present in the data frames. Use the open document command (all the way<br />

to the left) to browse to and load other map documents. Notice that not all<br />

376 • <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!