AnnEnumerateHandle example for C++ 5 and later
//'This example enumerates all handles of an object,
//'changing the predefined handles to blue squares
//'and the user handles to red circles.
void CTutorDlg::ExampleAnnEnumerateHandles(long hObject)
{
m_pRasterAnn->EnableFireEnumerateHandleEvent = TRUE;
m_pRasterAnn->AnnEnumerateHandle(hObject);
}
void CRasterAnnSink::OnEnumerateHandle(long hObject, ILEADRasterAnnHandleInfo AnnHandleInfo)
{
AnnHandleInfo.EnableVisible = TRUE;
if (AnnHandleInfo.Type == ANN_HANDLE_TYPE_DEFAULT_HANDLE)
{
AnnHandleInfo.Shape = ANN_HANDLE_SHAPE_SQUARE;
AnnHandleInfo.FillColor = RGB(0, 0, 255);
AnnHandleInfo.PenColor = RGB(0, 255, 0);
AnnHandleInfo.ID = 100;
AnnHandleInfo.ClientX = 20;
AnnHandleInfo.ClientY = 20;
AnnHandleInfo.ContainerX = 100;
AnnHandleInfo.ContainerY = 100;
}
else
{
AnnHandleInfo.Shape = ANN_HANDLE_SHAPE_CIRCLE;
AnnHandleInfo.FillColor = RGB(0, 255, 0);
AnnHandleInfo.PenColor = RGB(0, 0, 255);
AnnHandleInfo.ID = 50;
AnnHandleInfo.ClientX = 10;
AnnHandleInfo.ClientY = 10;
AnnHandleInfo.ContainerX = 50;
AnnHandleInfo.ContainerY = 50;
}
CString str ;
str.format(TEXT("The handle with index = %d was updated"), AnnHandleInfo.Index);
messageBox(str);
str.format(TEXT("The Total number of handles = %d") , AnnHandleInfo.TotalHandles);
messageBox(str);
RasterAnn.StopFireEnumerateHandleEvent = FALSE;
}