DragControl
DragControl
Track mouse with a dotted-line image of a control void DragControl( theControl, startPt, limitRect, slopRect, axis ); Point startPt ; current mouse point, within theControl Rect *limitRect ; area in which control may be moved Rect *slopRect ; area in which gray outline is visible short axis ; motion constraints; 0=none; 1=horiz; 2=vert
DragControl is needed only by applications that allow a user to move controls manually. It drags a gray outline of the control, tracking the mouse,
and calls MoveControl to change its position and redraw it. Use TrackControl for the more common operation of manipulating a dial (e.g., the thumb of a scroll bar).
theControl is a handle leading to a variable-length ControlRecord structure. It specifies which control to drag.
startPt is a point in local coordinates; normally a point in a control at the
limitRect is the address of an 8-byte Rect structure, expressed in local coordinates. It identifies the area in which the control may be moved.
slopRect is the address of a Rect in local coordinates. It should enclose limitRect completely. If the mouse moves outside of this rectangle,
the gray outline of the control vanishes.
axis specifies any constraints you may wish to place on the dragging
motion. It may be one of the following constants defined in
WindowMgr.h:
noConstraint (0) May move in any direction
hAxisOnly (1) May move left and right only
Notes: DragControl lets a user reposition individual controls within a window. Since controls are normally stationary with respect to a window, this is
used rarely.
The startPt, limitRect, slopRect, and axis parameters are used in the same way as in the Window Manager's DragGrayRgn function. You may tinker with the global variables DragHook and DragPattern if you wish to customize
the action.