SizeControl
SizeControl
Change the size of a control's enclosing rectangle short wide ; desired new width and . . .
short high ; . . . height
SizeControl changes the size of a control by hiding it, updating its contrlRect, and redrawing it. The lop left corner of the control's rectangle
remains stationary.
theControl is a handle leading to a variable-length ControlRecord structure. It specifies which control to re-size.
wide and . . .
high specify the desired new size of the control, in pixels.
Notes: SizeControl modifies the contents of theControl 's contrlRect by adding wide and high to its left and top values respectively, obtaining new values
for right and bottom. The control is redrawn at its new position (if it is
currently visible).
This function is most often used to adjust the size of scroll bars after
sizing a window. For instance:
long newSize;
short wide, high;
// thePt will usually be theEvent->where, and theBoundRect the // minimum and maximum sizes of the window.
MoveControl(vsh, w->portRect.right-15,w->portRect.top-1); wide = 16; // width of a normal vertical scroll bar
// new height is window height less grow icon
high = (w->portRect.bottom - w->portRect.top) - 14;