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

{<br />

}<br />

void PageLayoutControlEvents::OnPageLayoutReplaced(VARIANT newPageLayout)<br />

{<br />

}<br />

void PageLayoutControlEvents::OnPageSizeChanged()<br />

{<br />

}<br />

void PageLayoutControlEvents::OnMouseDown(long button, long shift, long x,<br />

long y, double mapX, double mapY)<br />

{<br />

}<br />

void PageLayoutControlEvents::OnMouseMove(long button, long shift, long x,<br />

long y, double mapX, double mapY)<br />

{<br />

}<br />

void PageLayoutControlEvents::OnMouseUp(long button, long shift, long x,<br />

long y, double mapX, double mapY)<br />

{<br />

}<br />

void PageLayoutControlEvents::OnOleDrop(esriControlsDropAction dropAction,<br />

VARIANT dataObjectHelper,<br />

long* effect, long button,<br />

long shift, long x, long y)<br />

{<br />

}<br />

void PageLayoutControlEvents::OnSelectionChanged()<br />

{<br />

}<br />

Although all of the functions are left empty, they<br />

must all be defined here to prevent the class<br />

from being an abstract class.<br />

void PageLayoutControlEvents::OnViewRefreshed(VARIANT ActiveView,<br />

long viewDrawPhase,<br />

VARIANT layerOrElement,<br />

VARIANT envelope)<br />

{<br />

}<br />

5. Now you can do the actual update of the MapControl’s ActiveView. Enter<br />

the following code into the OnPageLayoutReplaced event of the<br />

PageLayoutControl, which is called whenever a document is loaded into the<br />

PageLayoutControl. It will be found in PageLayoutControlEvents.cpp, which<br />

you created in the last step.<br />

void PageLayoutControlEvents::OnPageLayoutReplaced(VARIANT newPageLayout)<br />

{<br />

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