KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Getting object coordinates when within list form footer
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: November 14, 2022

Take for example where a button is placed in the footer of a list form:



From the design view, the buttom is 50px from the top, but the height should vary based on the number of records listed. However, only using OBJECT GET COORDINATES on the button, the height still results to 50 despite the window being resized and the button being much further below.



To address this issue, simply use CONVERT COORDINATES on the left and top position results from OBJECT GET COORDINATES like so:

C_LONGINT($left_i; $top_i; $right_i; $bottom_i)
OBJECT GET COORDINATES(Self->; $left_i; $top_i; $right_i; $bottom_i)
CONVERT COORDINATES($left_i; $top_i; XY Current form; XY Current window)
ALERT(String($top_i))


Running the code above will convert the coordinates based on the current form size and return the correct height: