4D v13.4

SVG Find element IDs by rect

Home

 
4D v13.4
SVG
SVG Find element IDs by rect

SVG Find element IDs by rect 


 

SVG Find element IDs by rect ( {* ;} pictureObject ; x ; y ; width ; height ; arrIDs ) -> Function result 
Parameter Type   Description
Operator in If specified, pictureObject is an object name (string) If omitted, pictureObject is a variable
pictureObject  Picture in Object name (if * specified) or Field or variable (if * omitted)
Longint in Horizontal coordinate of top left corner of selection rectangle
Longint in Vertical coordinate of top left corner of selection rectangle
width  Longint in Width of selection rectangle
height  Longint in Height of selection rectangle
arrIDs  Text array in IDs of elements whose bounding rectangle intersects with the selection rectangle
Function result  Boolean in True = at least one element is found

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.

 
PROPERTIES 

Product: 4D
Theme: SVG
Number: 1109

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D v12

 
SEE ALSO 

SVG Find element ID by coordinates