/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. CPView _headerView @accessors(property=headerView);
  5. CPView _cornerView @accessors(property=cornerView);
  6. }
  7. - (void)awakeFromCib
  8. {
  9. [self setFrame:CGRectMake(0.0, 0.0, 2000.0, 2000.0)];
  10. }
  11. - (CPView)headerView
  12. {
  13. if (![self showHeaderView])
  14. return nil;
  15. if (!_headerView)
  16. {
  17. _headerView = [[CPView alloc] initWithFrame:CGRectMake(0.0, 0.0, CGRectGetWidth([self bounds]), 30.0)];
  18. [_headerView setAutoresizingMask:CPViewWidthSizable];
  19. [_headerView setAlphaValue:0.3];
  20. [_headerView setBackgroundColor:[CPColor greenColor]];
  21. }
  22. return _headerView;
  23. }
  24. - (CPView)cornerView
  25. {
  26. if (![self showHeaderView])
  27. return nil;
  28. if (!_cornerView)
  29. {
  30. _cornerView = [[CPView alloc] initWithFrame:CGRectMake(0.0, 0.0, 15.0, 30.0)];
  31. [_cornerView setAutoresizingMask:CPViewWidthSizable];
  32. [_cornerView setAlphaValue:0.3];
  33. [_cornerView setBackgroundColor:[CPColor blueColor]];
  34. }
  35. return _cornerView;
  36. }
  37. @end