ITKit for Menutunes
[ITKit.git] / ITTSWBackgroundView.m
1 //
2 //  ITGrayRoundedView.m
3 //  ITKit
4 //
5 //  Created by Matt L. Judy on Wed Jan 22 2003.
6 //  Copyright (c) 2003 NibFile.com. All rights reserved.
7 //
8
9 #import "ITGrayRoundedView.h"
10
11
12 @implementation ITGrayRoundedView
13
14 - (void)drawRect:(NSRect)theRect
15 {
16     NSBezierPath *path = [NSBezierPath bezierPath];
17     float vh = NSHeight(theRect);
18     float vw = NSWidth(theRect);
19     [path moveToPoint:NSMakePoint( 0.0, (vh - 24.0) )];   //  first point
20     [path curveToPoint:NSMakePoint( 24.0, vh )
21          controlPoint1:NSMakePoint( 0.0, (vh - 11.0) )
22          controlPoint2:NSMakePoint( 11.0, vh )];                  //  top-left curve
23     [path lineToPoint:NSMakePoint( (vw - 24.0), vh )];    //  top line
24     [path curveToPoint:NSMakePoint( vw, (vh - 24.0) )
25          controlPoint1:NSMakePoint( (vw - 11.0), vh )
26          controlPoint2:NSMakePoint( vw, (vh - 11.0) )];   //  top-right curve
27     [path lineToPoint:NSMakePoint( vw, 24.0 )];           //  right line
28     [path curveToPoint:NSMakePoint( (vw - 24.0), 0.0 )
29          controlPoint1:NSMakePoint( vw, 11.0 )
30          controlPoint2:NSMakePoint( (vw - 11.0), 0.0 )];  //  bottom-right curve
31     [path lineToPoint:NSMakePoint( 24.0, 0.0 )];          //  bottom line
32     [path curveToPoint:NSMakePoint( 0.0, 24.0 )
33          controlPoint1:NSMakePoint( 11.0, 0.0 )
34          controlPoint2:NSMakePoint( 0.0, 11.0 )];         //  bottom-left curve
35     [path closePath];                                                                     //  left line
36
37     [[NSColor colorWithCalibratedWhite:0.0 alpha:0.15] set];
38     [path fill];
39 }
40
41 - (BOOL)isOpaque
42 {
43     return NO;
44 }
45
46 @end