SVG Find element IDs by rect
SVG Find element IDs by rect ( {* ;} pictureObject ; x ; y ; width ; height ; arrIDs ) -> Function result
Parameter | Type | Description | |
---|---|---|---|
* | Operator | → | If specified, pictureObject is an object name (string) If omitted, pictureObject is a variable |
pictureObject | Picture | → | Object name (if * specified) or Field or variable (if * omitted) |
x | Integer | → | Horizontal coordinate of top left corner of selection rectangle |
y | Integer | → | Vertical coordinate of top left corner of selection rectangle |
width | Integer | → | Width of selection rectangle |
height | Integer | → | Height of selection rectangle |
arrIDs | Text array | ← | IDs of elements whose bounding rectangle intersects with the selection rectangle |
Function result | Boolean | ← | True = at least one element is found |
This command is not thread-safe, it cannot be used in preemptive code.
Description
The SVG Find element IDs by rect command fills the Text or Alpha arrIDs array with the IDs ("id" or "xml:id" attribute) of the XML elements whose bounding rectangle intersects with the selection rectangle at the location specified by the x and y parameters.
The command returns True if at least one element is found (in other words if the arrIDs array is not empty), and False otherwise.
This command can be used in particular to manage interactive graphic interfaces.
If you pass the optional * parameter, you indicate that the pictureObject parameter is an object name (string). If you do not pass this parameter, you indicate that the pictureObject parameter is a field or a variable. In this case, you pass a field or variable reference (object field or variable only) instead of a string.
If you are working with a picture field or variable, the command uses the original picture, corresponding to the data source. However, if you are working with a form object, the command uses the current picture, that may have been modified via the SVG SET ATTRIBUTE command and that is kept with the properties of the form object.
The coordinates passed in the x and y parameters must be expressed in pixels in relation to the top left corner of the picture (0,0). You can use the values returned by the MouseX and MouseY System Variables. These variables are updated in the On Clicked and On Double Clicked form events as well as the in the On Mouse Enter and On Mouse Move form events.
Note: In the system of picture coordinates, [x;y] always specifies the same point, regardless of the picture display format, apart from the "Replicated" format.
All elements whose bounding rectangle intersects with the selection rectangle are taken into account, even those that are under other elements.