Removing the use of private CoreGraphics APIs to draw shadows, and replacing with...
[ITKit.git] / ITTableView.m
1 #import "ITTableView.h"
2 #import "ITTableCornerView.h"
3
4 @implementation ITTableView
5
6 - (id)initWithFrame:(NSRect)frame {
7         if ((self = [super initWithFrame:frame])) {
8                 [self setCornerView:[[ITTableCornerView alloc] initWithFrame:[[self cornerView] frame]]];
9         }
10         return self;
11 }
12
13 - (id)initWithCoder:(NSCoder *)coder {
14         if ((self = [super initWithCoder:coder])) {
15                 [self setCornerView:[[ITTableCornerView alloc] initWithFrame:[[self cornerView] frame]]];
16         }
17         return self;
18 }
19
20 - (void)encodeWithCoder:(NSCoder *)coder {
21         [super encodeWithCoder:coder];
22 }
23
24 - (void)setCornerImage:(NSImage *)image {
25         if ([_cornerView isKindOfClass:[ITTableCornerView class]]) {
26                 [(ITTableCornerView *)_cornerView setImage:image];
27         }
28 }
29
30 - (NSImage *)cornerImage {
31         if ([_cornerView isKindOfClass:[ITTableCornerView class]]) {
32                 return [(ITTableCornerView *)_cornerView image];
33         }
34         return nil;
35 }
36
37 - (void)setCornerMenu:(NSMenu *)menu {
38         if ([_cornerView isKindOfClass:[ITTableCornerView class]]) {
39                 [(ITTableCornerView *)_cornerView setMenu:menu];
40         }
41 }
42
43 - (NSMenu *)cornerMenu {
44         if ([_cornerView isKindOfClass:[ITTableCornerView class]]) {
45                 return [(ITTableCornerView *)_cornerView menu];
46         }
47         return nil;
48 }
49
50 @end