DragAlignedGrayRgn
TheDragAlignedGrayRgnfunction drags the specified gray region along an optimal alignment grid.
pascal long DragAlignedGrayRgn (RgnHandle theRgn, Point startPt, Rect *boundsRect, Rect *slopRect, short axis, ProcPtr actionProc, Rect *alignmentRect, AlignmentProcRecordPtr alignmentProc);
theRgn- Contains a region handle to the specified region for this operation. When the user holds down the mouse button,
DragAlignedGrayRgnpulls a gray outline of the region around following the movement of the mouse until the mouse button is released.startPt- Specifies the point where the mouse button was originally pressed in the local coordinates of the current graphics port.
boundsRect
Contains a pointer to the boundary rectangle of the current graphics port. The offset point follows the mouse location except thatDragAlignedGrayRgnnever moves the offset point outside this rectangle. This limits the travel of the region's outline, not the movements of the mouse.slopRect- Contains a pointer to the
sloprectangle that completely encloses the boundary rectangle so that the user is allowed some flexibility in moving the mouse.axis- Allows you to constrain the region's motion to only one axis. Set this parameter to 0 to specify no constraint. To indicate constraint along
a horizontal axis, set this parameter to 1. To indicate constraint along a vertical axis, set this parameter to 2. See Inside Macintosh: Macintosh ToolBox Essentials Essentials for details on the constants for the axis parameter of the Window Manager'sDragGrayRgnroutine.actionProc- Points to a function that defines some action to be performed repeatedly as long as the user holds down the mouse button. The function should have no parameters. If the
actionProcparameter isnil,DragAlignedGrayRgnsimply retains control until the mouse button is released.alignmentRect
Contains a pointer to a rectangle within the bounds of the region specified in the parametertheRgn. Passnilto align using the bounds of the parametertheRgn.alignmentProc- Points to your own alignment behavior function. Pass
nilto use the standard behavior. Your alignment function must be in the following form:- pascal void MyAlignmentProc (Rect *rp, long refcon);
See "Alignment Functions" on page 3-149 for details.DESCRIPTION
TheDragAlignedGrayRgnfunction is not normally made directly. TheDragAlignedWindowfunction (described on page 3-138) calls this function.SEE ALSO
TheDragAlignedGrayRgnfunction is nearly identical to the Window Manager'sDragGrayRgnroutine. See Inside Macintosh: Macintosh ToolBox Essentials Essentials for
details onDragGrayRgn.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help