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

Each Motif <strong>ArcGIS</strong> control widget has a<br />

corresponding GTK <strong>ArcGIS</strong> control widget.<br />

A buddy control is a control that is designed to<br />

work in conjunction with another control. For<br />

example, the Table of Contents, or TOC, Control<br />

is a buddy of the MapControl.<br />

Although the GUI design will be different for<br />

GTK developers, the majority of the rest of the<br />

application code will be the same. Throughout<br />

the scenario, sidebars will highlight areas where<br />

GTK programmers will take different steps.<br />

The <strong>ArcGIS</strong> <strong>Engine</strong> C++ API provides reusable Motif widget components<br />

corresponding to each <strong>ArcGIS</strong> <strong>Engine</strong> control. This developer scenario will show<br />

how these components can be embedded in a Motif form to build a map viewer<br />

application.<br />

Motif itself is a specification for how graphical user interfaces should look and<br />

feel. The Open Software Foundation (OSF) Motif Toolkit, used with the<br />

<strong>ArcGIS</strong> <strong>Engine</strong> C++ API in this scenario, uses X as the window system and X<br />

Toolkit Intrinsics as the API platform. The Motif widgets discussed here are one<br />

part of the Motif toolkit. Each widget is a reusable and configurable component<br />

of the user interface. The Motif toolkit provides widgets for common tasks, such<br />

as the toggle button used in this scenario. Each built-in Motif widget knows how<br />

to draw itself as well as some generic behavior; for example, the toggle button<br />

knows to call a function when it is clicked. However, it is up to the programmer<br />

to implement the callback function, giving the widget its specific behavior. In<br />

addition to providing widgets the Motif toolkit does other work for the developer,<br />

including handling many user interactions, managing window layout, and<br />

redrawing.<br />

The Motif widget <strong>ArcGIS</strong> controls are custom widgets made available through<br />

the C++ API of the <strong>ArcGIS</strong> <strong>Engine</strong> <strong>Developer</strong> Kit. Placed in a top-level application<br />

widget, the controls have events, properties, and methods that the developer<br />

can access, and like the built-in Motif toolkit widgets, each ESRI control widget<br />

knows how to draw itself. The objects and functionality within each control can<br />

be combined with other ESRI ArcObjects as well as with custom controls to<br />

easily create customized end user applications.<br />

This scenario was written in C++ using the Motif toolkit from the Open Software<br />

Foundation. It was chosen to create an application that would run on a<br />

Solaris or Linux platform. The same application could also be written in Java.<br />

Whichever API you use, your future success with the <strong>ArcGIS</strong> controls depends<br />

on your skill in both the language and ArcObjects.<br />

DESIGN<br />

This scenario has been designed to highlight how the <strong>ArcGIS</strong> controls interact<br />

with each other and to expose a part of each <strong>ArcGIS</strong> control’s object model to<br />

the developer.<br />

The scenario starts with building a GUI using Motif to place and manage the<br />

controls. The controls are then connected to each other through the SetBuddy<br />

methods. At this stage, the application is ready to function as a simple map<br />

viewer. The GUI functionality is then extended through a custom tool and event<br />

handling. To achieve this, the scenario further explores the API of the visual<br />

Motif widgets, as well as the other nonvisual <strong>ArcGIS</strong> <strong>Engine</strong> components.<br />

REQUIREMENTS<br />

To successfully follow this scenario you need the following (the requirements for<br />

deployment are covered later in the ‘Deployment’ section):<br />

• An installation of the ESRI <strong>ArcGIS</strong> <strong>Engine</strong> <strong>Developer</strong> Kit with an authorization<br />

file enabling it for development use.<br />

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