|The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....|
|Home ChartPack RChart Class TRChart Methods FindNearestAnnoElem|
|See also: FindNearestItemReal, SearchAnnoItem|
The function FindNearestAnnoElem searches for the annotation item which is closest to the point [mx,my], belongs to the item type ItemID, and has a class number of ClassNumber. In order to search through all items in the annotation container, ItemID should be set to tkEverything (or tkNotMoveTo) and ClassNumber must be 255. Setting the parameter VisLayersOnly to TRUE restricts the search to visible layers only.
Please note that only annotation elements can searched which can be drawn on the canvas (i.e. MoveTo elements cannot be searched).
The function returns the index of the closest annotation item, a value of -1 indicating that no element has been found. In addition, the variable parameter Dist contains the distance of the found item.