The “cellrectangle” and “rowrectangle” statements return incorrect rtop() and rbottom() values. Both values are approximately 30 points higher without the toolbar and 67 points higher with the toolbar.
There are no such statements.
I’m guessing you actually mean the “cellrectangle” and “rowrectangle” object actions for Matrix objects.
I’m also guessing that you missed the fact that these are window relative dimensions. Sounds like you probably want form relative dimensions. You can use the xytoxy( function to convert them into form relative dimensions.
If you still think these values are wrong, you’ll need to provide a detailed description of exactly what you are doing and why you think the dimensions are incorrect. I’m pretty sure they are not incorrect. There are several features in Panorama that rely on these dimensions and they work properly.
I discovered this issue because the inrectangle() function consistently returns 0 instead of -1.
Wow! The window coordinates and form coordinates consistently returned the same information in Pan 6, particularly the rtop() and rbottom() functions. I was unaware that this behavior had changed in Pan X.
If I use objectinfo("rectangle")
to find the position of the matrix or text list object, I find it returns form-relative co-ordinates. Whereas for objectinfo("cellrectangle")
and objectinfo("rowrectangle")
, as the documentation specifically states, ‘The rectangle that is returned by this action is in window relative co-ordinates.’
The vertical difference between window- and form-relative co-ordinates is the height of the title bar, including toolbar if visible.
As Jim says, you need to convert one or the other in order to compare co-ordinates of the same type.
(The documentation doesn’t state the type of co-ordinates returned by objectinfo("rectangle")
, admittedly.)
I guess you mean the objectinfo("rectangle"
function, the rectangle( function has nothing to do with graphic objects. The objectinfo( function returns co-ordinates in form relative coordinates. As I stated in my last response, the objectaction
“cellrectangle” and “rowrectangle” statement returns co-ordinates in window relative co-ordinates. So of course they are different, and of course the window relative coordinates will change depending on whether or not the toolbar is visible. The help page for the xytoxy( function discusses the three types of coordinates that Panorama uses.
This feature works correctly, but you’re not using it correctly. When using dimensions in different coordinate systems, you must convert them to the same coordinate system before comparing them.