/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
- @implementation DocumentView : CPView
- {
- BOOL _showHeaderView @accessors(property=showHeaderView);
- CPView _headerView @accessors(property=headerView);
- CPView _cornerView @accessors(property=cornerView);
- }
- - (void)awakeFromCib
- {
- [self setFrame:CGRectMake(0.0, 0.0, 2000.0, 2000.0)];
- }
- - (CPView)headerView
- {
- if (![self showHeaderView])
- return nil;
- if (!_headerView)
- {
- _headerView = [[CPView alloc] initWithFrame:CGRectMake(0.0, 0.0, CGRectGetWidth([self bounds]), 30.0)];
- [_headerView setAutoresizingMask:CPViewWidthSizable];
- [_headerView setAlphaValue:0.3];
- [_headerView setBackgroundColor:[CPColor greenColor]];
- }
- return _headerView;
- }
- - (CPView)cornerView
- {
- if (![self showHeaderView])
- return nil;
- if (!_cornerView)
- {
- _cornerView = [[CPView alloc] initWithFrame:CGRectMake(0.0, 0.0, 15.0, 30.0)];
- [_cornerView setAutoresizingMask:CPViewWidthSizable];
- [_cornerView setAlphaValue:0.3];
- [_cornerView setBackgroundColor:[CPColor blueColor]];
- }
- return _cornerView;
- }
- @end