PGetObjectLoc

Returns the location of the specified handle of the selected object, taking any transformations applied to the object into account.


Query constructor

PGetObjectLoc(short cHandle);
Handle you want to locate:

Side handles:

kEdgeLeft (these are defined in PKeywords.h)
kEdgeRight
kEdgeTop
kEdgeBottom
Center of object:
kEdgeCenter
Corner handles:
kEdgeLeftTop
leftBottom
kEdgeRightTop
kEdgeRightBottom


Query results

long xValue;
Location of handle relative to the zero point of the horizontal ruler
long yValue;
Location of handle relative to the zero point of the vertical ruler
Select only one object. The query returns the location of a single object. If multiple objects are selected, PageMaker returns an error.

cHandle for transformed objects. If the selected object was skewed, rotated, or reflected, cHandle should correspond to the handle before the object was transformed. For example, leftTop always refers to the original left-top handle of an object, not the handle that is currently the left-most top handle.

Working with lines. To get the location of a line, the only valid values for cHandle are:

kEdgeCenter for the midpoint of the line
kEdgeLeftTop for the starting point of the line
kEdgeRightBottom for the end point of the line

Example. This example creates a box and queries for the location of the left-top and right-bottom handles. It then rotates the box and queries for the new locations of the same handles. (Remember: y coordinates in PageMaker are positive when moving down from the zero point and negative moving up from the zero point.)

PNew();
PBox(1, 1, -1, -1);
PGetObjectLoc(kEdgeLeftTop);
// expected reply:-1,-1
PGetObjectLoc(kEdgeRightBottom);
// expected reply: 1,1
PRotate(kEdgeCenter, 450);
// rotate 45 degrees
PGetObjectLoc(kEdgeLeftTop);
// expected reply: -1.414,0
PGetObjectLoc(kEdgeRightBottom);
//expected reply: 1.415,0


See also

The PGetObjectList, PGetTransform, and PGetLineStyle queries



Copyright © 1996, Adobe Systems Incorporated. All rights reserved.

Comments or suggestions? Contact Adobe Developer Support