OnAnnSelect example for C++ Builder
// This example for the OnAnnSelect event displays a message box showing the number
// of selected annotation objects. It then goes through the array of selected objects
// to see if any of them are polygons.
void __fastcall TForm1::LEADAnn1AnnSelect (L_PHANDLE phObjects, int iCount)
{
int nType;
int x;
bool bSelected;
bSelected= False;
ShowMessage (IntToStr (iCount) + " objects were selected");
for ( x= 1; x <= iCount; x ++ )
{
nType= LEADAnn1->AnnGetType (LEADAnn1->AnnGetItemHandle ( phObjects, x - 1));
if ( nType == ANNOBJECT_POLYGON )
bSelected= True;
}
if ( !bSelected)
ShowMessage ("No Polygon Objects were selected");
}