PageRenderTime 20ms CodeModel.GetById 15ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/Tests/Manual/ScrollviewTheming/DocumentView.j

http://github.com/cacaodev/cappuccino
Unknown | 46 lines | 37 code | 9 blank | 0 comment | 0 complexity | 66da286136ac5844f95f8c029c45c092 MD5 | raw file
 1@implementation DocumentView : CPView
 2{
 3    BOOL                            _showHeaderView @accessors(property=showHeaderView);
 4
 5    CPView                          _headerView @accessors(property=headerView);
 6    CPView                          _cornerView @accessors(property=cornerView);
 7}
 8
 9- (void)awakeFromCib
10{
11    [self setFrame:CGRectMake(0.0, 0.0, 2000.0, 2000.0)];
12}
13
14- (CPView)headerView
15{
16    if (![self showHeaderView])
17        return nil;
18
19    if (!_headerView)
20    {
21        _headerView = [[CPView alloc] initWithFrame:CGRectMake(0.0, 0.0, CGRectGetWidth([self bounds]), 30.0)];
22        [_headerView setAutoresizingMask:CPViewWidthSizable];
23        [_headerView setAlphaValue:0.3];
24        [_headerView setBackgroundColor:[CPColor greenColor]];
25    }
26
27    return _headerView;
28}
29
30- (CPView)cornerView
31{
32    if (![self showHeaderView])
33        return nil;
34
35    if (!_cornerView)
36    {
37        _cornerView = [[CPView alloc] initWithFrame:CGRectMake(0.0, 0.0, 15.0, 30.0)];
38        [_cornerView setAutoresizingMask:CPViewWidthSizable];
39        [_cornerView setAlphaValue:0.3];
40        [_cornerView setBackgroundColor:[CPColor blueColor]];
41    }
42
43    return _cornerView;
44}
45
46@end