|
![]()
|
SearchRect( ) function
Purpose
Searches for map objects within a rectangular area.
Syntax
map_window_id is a Map window's integer ID number.
x1, y1 are coordinates that specify one corner of a rectangle.
x2, y2 are coordinates that specify the opposite corner of a rectangle.
Return Value
Integer, representing the number of objects found.
Description
The SearchRect( ) function searches for map objects within a rectangular area. The search applies to all selectable layers in the Map window, even the Cosmetic layer (if it is currently selectable). The return value indicates the number of objects found.
Note: This function does not select any objects, nor does it affect the current selection. Instead, this function builds a list of objects in memory. After calling SearchRect( ) you call SearchInfo( ) function to process the search results.
The search behavior matches the behavior of MapInfo Professional's Marquee Select button: If an object's centroid falls within the rectangle, the object is included in the search results.
To allow the user to select a rectangular area with the mouse, use the Create ButtonPad statement to create a custom ToolButton. Use DM_CUSTOM_RECT as the button's draw mode. Within the button's handler procedure, call CommandInfo( ) function to determine the x/y coordinates.
Example
For a code example, see the SearchInfo( ) function.
See Also
|
© 2007 MapInfo Corporation. All rights reserved. Email: docs@mapinfo.com |
![]()
|