CwFindShallowerObject

Syntax:

hObject = CwFindShallowerObject 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 above.

        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 rearmost object that is in front of "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, although the order of traversal is reversed. Alternately, it may be thought of as a version of CwFindPreviousObject 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 CwFindShallowerObject 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 CwFindDeeperObject 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 = CwFindShallowerObject(0, pos.x, pos.y)
do while CwIsHandleValid(o)
        obj.count = o
        count = count + 1
        o = CwFindShallowerObject(o, pos.x, pos.y)
        end


Functions by NAME

Index

Functions by PURPOSE