AnnEnumerateHandles example for C++ Builder
//This example enumerates all handles of an object,
//changing the predefined handles to blue squares
//and the user handles to red circles.
void TForm1::ExampleAnnEnumerateHandles(HANNOBJECT hObject )
{
LEADAnn1->AnnEnableEnumerateHandlesEvent=
true;
LEADAnn1->AnnEnumerateHandles(hObject);
}
//---------------------------------------------------------------------------
int __fastcall TForm1::LEADAnn1AnnEnumerateHandles(HANNOBJECT hObject,
TAnnHandleInfo *AnnHandleInfo)
{
AnnHandleInfo->Visible
= true;
if (AnnHandleInfo->AnnType
== ANNHANDLETYPE_DEFAULT_HANDLE)
{
AnnHandleInfo->Shape
= ANNHANDLE_SHAPE_SQUARE;
AnnHandleInfo->FillColor
= (TColor)RGB(0, 255, 0);
AnnHandleInfo->PenColor
= (TColor)RGB(0, 0, 255);
AnnHandleInfo->ID
= 100;
}
else
{
AnnHandleInfo->Shape
= ANNHANDLE_SHAPE_CIRCLE;
AnnHandleInfo->FillColor
= (TColor)RGB(0, 255, 0);
AnnHandleInfo->PenColor
= (TColor)RGB(0, 0, 255);
AnnHandleInfo->ID
= 50;
}
ShowMessage("The handle with index = " + IntToStr(AnnHandleInfo->Index) + "was
updated" );
ShowMessage("number of handles = " + IntToStr(AnnHandleInfo->TotalHandles));
LEADAnn1->AnnEnableEnumerateHandlesEvent
= False;
return SUCCESS_CHANGE;
}