CwFindDeeperObject

Syntax:

hObject = CwFindDeeperObject hPrevObj, nX, nY

        hObject         (handle) The handle of the requested object, or the
                        null handle if there is none.

        hPrevObject     (handle) The object to look under.

        nX              (numeric) The X (horizontal) coordinate of the
                        point at which to look.

        nY              (numeric) The Y (vertical) coordinate of the
                        point at which to look.

Description:

This function returns the handle of the foremost object that is behind "hPrevObj" and covers the point nX, nY. Using this function is similar to cycling through the items under the mouse pointer by pointing to a location and then repeatedly clicking the mouse button. Alternately, it may be thought of as a version of CwFindNextObject that skips all objects not covering the point at nX, nY.

A program can cycle through all of the objects in the current view that cover the given point (nX, nY) by repeatedly calling CwFindDeeperObject with the handle returned in the previous call as the argument.

If "hLastObj" is the null handle, the topmost object covering the point is returned and if it is the bottom object covering the point (i.e. the last in the sequence), a null-handle is returned.

This function behaves identically to CwFindShallowerObject except that the order in which objects are returned between calls is reversed.

Example:

/* Find all objects under a point and store their handles
   in the stem "obj.". */

call CwGetMousePosition( pos );
count = 1

o = CwFindDeeperObject(0, pos.x, pos.y)
do while CwIsHandleValid(o)
        obj.count = o
        count = count + 1
        o = CwFindDeeperObject(o, pos.x, pos.y)
        end

Remarks:

When the end of the sequence (i.e. the first object) is reached, the null-handle is returned on the next call.

Functions by NAME

Index

Functions by PURPOSE