KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Using PV GET CURRENT CELL and detecting cell control coordinates
PRODUCT: 4D View | VERSION: 6.8 | PLATFORM: Mac & Win
Published On: November 8, 2002

PV GET CURRENT CELL cannot be used to detect a user click on a cell control. Instead use $2 and $3 of the callback method set for the cell using PV SET CELL CONTROL.

The 4D View documentation explains that the command PV GET CURRENT CELL returns the coordinates of the current cell of the area in the column and row parameters:
PV GET CURRENT CELL(area;column;row)

The current cell in 4D View is the cell in which the cursor is located. In a cell for which a cell control has been set (e.g. a push button) clicking on that cell does not move the cursor to that cell. Therefore PV
GET CURRENT CELL will not return the coordinates of that cell, rather, it returns the coordinates of the cell in which the cursor is located, the current cell.

Returning the coordinates of a cell that has a cell control (e.g. a push button) is automatically handled by 4D View: When the user clicks on the cell control, the column and row coordinates of that cell control are automatically returned in $2 and $3 of the callback method set for that cell using PV SET CELL CONTROL.