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 C++ AND CONTROL WIDGETS<br />

Placing the <strong>ArcGIS</strong> <strong>Engine</strong> Controls<br />

Now that you have a Motif form ready, you can create the <strong>ArcGIS</strong> controls as<br />

Motif widgets and place them on the form.<br />

1. Start by including the <strong>ArcGIS</strong> controls header file in MapViewer.h:<br />

#include <br />

// Controls<br />

#include <br />

2. In MapViewer.cpp, continue implementing your application. Set up global<br />

variables for the control interfaces, placing them before main.<br />

// Control Interfaces<br />

IToolbarControlPtr g_ipToolbarControl;<br />

IMapControl3Ptr g_ipMapControl;<br />

ITOCControlPtr g_ipTOCControl;<br />

IPageLayoutControlPtr g_ipPageLayoutControl;<br />

int main(int argc, char* argv[])<br />

3. You are now ready to create the ESRI control widgets for the<br />

PageLayoutControl, MapControl, TOCControl, and ToolbarControl. You will<br />

do this in the FormSetup function after the mainForm is created and before the<br />

widgets are managed. The widget class for all of the ESRI controls is<br />

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

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

Saved successfully!

Ooh no, something went wrong!