Note: the coordinate system is pasteboard system, centered on pasteboard center (default size 1224X792 in points). If you want hit (12pica,12pica), enter x = 12*12 = 144, y = 144-396=-252.
ILayoutHitTestSuite provides methods that can hit test the selection. But if you want to hit test a point for items that are not already selected this snippet shows an approach you can use.
There are many different kinds of hit tests, hit test to see if the path of a page item was clicked, hit test the handles of a page item etc. Consequently the API provides boss classes that apply different hit test rules. To find hit test boss classes provided by the API examine the documentation for their signature interface IBaseHandler.
- See Also
- ILayoutControlViewHelper
- kSolidHitTestHandlerBoss
- IBaseHandler
- ILayoutHitTestSuite
Uses kSolidHitTestHandlerBoss to hit test the given point and returns the graphic frame associated with the hit. If the point is anywhere within the bounding box of a page item a hit will be found. If the point is within the bounding box of more than one item the item frontmost in the page item z-order will be returned as the hit.
- Parameters
| layoutControlViewHelper | with which the hit test should be done. |
| where | the point to be hit tested in pasteboard co-ordinates |
- Returns
- IGraphicFraneData of the frame that was hit or nil if no hit detected.
Note: the coordinate system is pasteboard system, centered on pasteboard center (default size 1224X792 in points). If you want hit (12pica,12pica), enter x = 12*12 = 144, y = 144-396=-252.