4D v16.3

LISTBOX GET CELL COORDINATES

Home

 
4D v16.3
LISTBOX GET CELL COORDINATES

LISTBOX GET CELL COORDINATES 


 

LISTBOX GET CELL COORDINATES ( {* ;} object ; column ; row ; left ; top ; right ; bottom ) 
Parameter Type   Description
Operator in If specified = object is the name of the object (string)
If omitted = object is a variable
object  Form object in Object name (if * is specified) or variable (if * is omitted)
column  Longint in Column number
row  Longint in Row number
left  Longint in Left coordinate of the object
top  Longint in Top coordinate of the object
right  Longint in Right coordinate of the object
bottom  Longint in Bottom coordinate of the object

The LISTBOX GET CELL COORDINATES command returns in variables or fields the left, top, right and bottom coordinates (in points) of the cell designated by the column and row parameters, in the list box defined by * and object.

If you pass the optional * parameter, it indicates that the object parameter is an object name (a string). If you don’t pass the optional * parameter, this indicates that the object is a field or a variable. In this case, you pass a field or variable reference (only a field or variable of the object type) instead of a string

For consistency with the OBJECT GET COORDINATES command, the origin is the upper-left corner of the form which contains the cell. Also, the coordinates returned are theoretical; they take into account the scrolling state of the list box before any clipping occurs. As a result, the cell may be not visible (or only partially so) at its coordinates, and these coordinates may be outside the form limits (or even negative). To find out if the cell is displayed (and which part of it is visible) you need to compare the coordinates returned with the list box coordinates, while considering the following rules:

  • All cells are clipped to the coordinates of their parent list box (as returned by the OBJECT GET COORDINATES command for the list box).
  • Header and footer sub-objects are displayed on top column content: when the coordinates of a cell intersect the coordinates of the header or footer rows, then the cell is not displayed at this intersection.
  • Elements of locked columns are displayed on top of elements of scrollable columns: when the coordinates of an element in a scrollable column intersect the coordinates of an element in a locked column, then it is not displayed at this intersection.

For more information, please refer to the OBJECT GET COORDINATES command description.

Example  

You want to draw a red rectangle around the selected cell of a list box:

 OBJECT SET VISIBLE(*;"RedRect";False//initialize a red rectangle
  //the rectangle is already defined somewhere in the form
 LISTBOX GET CELL POSITION(*;"LB1";$col;$raw)
 LISTBOX GET CELL COORDINATES(*;"LB1";$col;$raw;$x1;$y1;$x2;$y2)
 OBJECT SET VISIBLE(*;"RedRect";True)
 OBJECT SET COORDINATES(*;"RedRect";$x1;$y1;$x2;$y2)



See also 

LISTBOX GET CELL POSITION
OBJECT GET COORDINATES

 
PROPERTIES 

Product: 4D
Theme: List Box
Number: 1330

 
HISTORY 

Created: 4D v14 R5

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)