Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
NotificationMon.ƒ/Source/ScrollBar.c
#include "ScrollBar.h" |
void CalcScrollBounds(WindowPtr wp, Rect *cBounds) |
{ |
*cBounds = wp->portRect; |
cBounds->top -= 1; |
cBounds->right += 1; |
cBounds->left = cBounds->right - 16; |
cBounds->bottom -= 14; |
} |
ControlHandle NewVScrollBar(WindowPtr wp) |
{ |
GrafPtr savePort; |
ControlHandle cHandle; |
Rect cBounds; |
GetPort(&savePort); |
SetPort(wp); |
CalcScrollBounds(wp, &cBounds); |
cHandle = NewControl( wp, &cBounds, "\pVGrooviScroller", |
true, 1, 1, 1, |
scrollBarProc, (long)wp); |
SetPort(savePort); |
return cHandle; |
} |
void SizeVScrollBar(ControlHandle scroll, WindowPtr wp) |
{ |
GrafPtr savePort; |
ControlHandle cHandle; |
Rect cBounds; |
GetPort(&savePort); |
SetPort(wp); |
CalcScrollBounds(wp, &cBounds); |
HideControl(scroll); |
(**scroll).contrlRect = cBounds; |
ShowControl(scroll); |
SetPort(savePort); |
} |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14