InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnpHitTestFrame Class Reference

Public Member Functions

 SnpHitTestFrame ()
 
virtual ~SnpHitTestFrame ()
 
IGraphicFrameDataQueryHitGraphicFrame (ILayoutControlViewHelper *layoutControlViewHelper, const PBPMPoint &where)
 
void Select (ISelectionManager *selectionManager, const UIDList &itemList)
 
IGraphicFrameDataQueryAssociatedGraphicFrame (IGeometry *item)
 

Detailed Description

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

Constructor & Destructor Documentation

SnpHitTestFrame::SnpHitTestFrame ()
inline

Constructor.

virtual SnpHitTestFrame::~SnpHitTestFrame ()
inlinevirtual

Destructor.

Member Function Documentation

IGraphicFrameData * SnpHitTestFrame::QueryAssociatedGraphicFrame (IGeometryitem)

Iterates up the hierarchy of the given item till a frame is found.

Parameters
itemhitted item
Returns
frame that contains the given page item.
IGraphicFrameData * SnpHitTestFrame::QueryHitGraphicFrame (ILayoutControlViewHelperlayoutControlViewHelper,
const PBPMPointwhere 
)

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
layoutControlViewHelperwith which the hit test should be done.
wherethe 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.

void SnpHitTestFrame::Select (ISelectionManagerselectionManager,
const UIDListitemList 
)

Select the given page items.

Parameters
selectionManagerin which items are to be selected.
itemListUIDs of items to be selected.