28 #define SHOULD_SHOW_CORNER_VIEW() (_scrollerStyle === CPScrollerStyleLegacy && _verticalScroller && ![_verticalScroller isHidden]) 41 var _isBrowserUsingOverlayScrollers =
function()
56 var outer = document.createElement(
'div'),
57 inner = document.createElement(
'p');
60 outer.style.position =
"absolute";
61 outer.style.top =
"0px";
62 outer.style.left =
"0px";
63 outer.style.visibility =
"hidden";
64 outer.style.width =
"200px";
65 outer.style.height =
"150px";
66 outer.style.overflow =
"scroll";
68 inner.style.width =
"100%";
69 inner.style.height =
"200px";
70 outer.appendChild(inner);
72 document.body.appendChild(outer);
74 var usingOverlayScrollers = outer.clientWidth === outer.offsetWidth;
76 document.body.removeChild(outer);
78 return usingOverlayScrollers;
107 id <CPScrollViewDelegate> _delegate;
110 BOOL _hasVerticalScroller;
111 BOOL _hasHorizontalScroller;
112 BOOL _autohidesScrollers;
117 CPInteger _recursionCount;
118 CPInteger _implementedDelegateMethods;
120 float _verticalLineScroll;
121 float _verticalPageScroll;
122 float _horizontalLineScroll;
123 float _horizontalPageScroll;
125 CPBorderType _borderType;
130 int _scrollerKnobStyle;
135 #pragma mark Class methods 144 if (globalValue === nil || globalValue === -1)
163 + (CGSize)contentSizeForFrameSize:(CGSize)frameSize hasHorizontalScroller:(BOOL)hFlag hasVerticalScroller:(BOOL)vFlag borderType:(CPBorderType)borderType
165 var
bounds = [
self _insetBounds:CGRectMake(0.0, 0.0, frameSize.width, frameSize.height) borderType:borderType],
169 bounds.size.height -= scrollerWidth;
172 bounds.size.width -= scrollerWidth;
177 + (CGSize)frameSizeForContentSize:(CGSize)contentSize hasHorizontalScroller:(BOOL)hFlag hasVerticalScroller:(BOOL)vFlag borderType:(CPBorderType)borderType
179 var
bounds = [
self _insetBounds:CGRectMake(0.0, 0.0, contentSize.width, contentSize.height) borderType:borderType],
200 return CGRectInset(
bounds, 1.0, 1.0);
227 + (void)setGlobalScrollerStyle:(
int)aStyle
235 #pragma mark Initialization 237 - (id)initWithFrame:(CGRect)aFrame
243 _verticalLineScroll = 10.0;
244 _verticalPageScroll = 10.0;
246 _horizontalLineScroll = 10.0;
247 _horizontalPageScroll = 10.0;
251 _contentView = [[
CPClipView alloc] initWithFrame:[
self _insetBounds]];
257 _bottomCornerView = [[
CPView alloc] init];
267 _implementedDelegateMethods = 0;
275 #pragma mark Getters / Setters 300 - (void)setDelegate:(
id <CPScrollViewDelegate>)aDelegate
302 if (aDelegate === _delegate)
305 _delegate = aDelegate;
306 _implementedDelegateMethods = 0;
308 if (_delegate === nil)
311 if ([_delegate respondsToSelector:
@selector(scrollViewWillScroll:)])
314 if ([_delegate respondsToSelector:
@selector(scrollViewDidScroll:)])
320 return _scrollerStyle;
329 - (void)setScrollerStyle:(
int)aStyle
331 if (_scrollerStyle === aStyle)
334 _scrollerStyle = aStyle;
336 [
self _updateScrollerStyle];
351 return _scrollerKnobStyle;
364 - (void)setScrollerKnobStyle:(
int)newScrollerKnobStyle
366 if (_scrollerKnobStyle === newScrollerKnobStyle)
369 _scrollerKnobStyle = newScrollerKnobStyle;
371 [
self _updateScrollerStyle];
389 if (_contentView === aContentView || !aContentView)
397 [_contentView removeFromSuperview];
399 _contentView = aContentView;
401 [_contentView setDocumentView:documentView];
414 return [_contentView frame].size;
422 return [_contentView documentView];
432 [_contentView setDocumentView:aView];
435 [
self _updateCornerAndHeaderView];
457 - (void)setBorderType:(CPBorderType)borderType
474 return _horizontalScroller;
484 if (_horizontalScroller === aScroller)
487 [_horizontalScroller removeFromSuperview];
488 [_horizontalScroller setTarget:nil];
489 [_horizontalScroller setAction:nil];
491 _horizontalScroller = aScroller;
493 [_horizontalScroller setTarget:self];
494 [_horizontalScroller setAction:@selector(_horizontalScrollerDidScroll:)];
498 [
self _updateScrollerStyle];
506 return _hasHorizontalScroller;
515 - (void)setHasHorizontalScroller:(BOOL)shouldHaveHorizontalScroller
517 if (_hasHorizontalScroller === shouldHaveHorizontalScroller)
520 _hasHorizontalScroller = shouldHaveHorizontalScroller;
522 if (_hasHorizontalScroller && !_horizontalScroller)
524 var
bounds = [
self _insetBounds];
538 return _verticalScroller;
548 if (_verticalScroller === aScroller)
551 [_verticalScroller removeFromSuperview];
552 [_verticalScroller setTarget:nil];
553 [_verticalScroller setAction:nil];
555 _verticalScroller = aScroller;
557 [_verticalScroller setTarget:self];
558 [_verticalScroller setAction:@selector(_verticalScrollerDidScroll:)];
562 [
self _updateScrollerStyle];
570 return _hasVerticalScroller;
580 - (void)setHasVerticalScroller:(BOOL)shouldHaveVerticalScroller
582 if (_hasVerticalScroller === shouldHaveVerticalScroller)
585 _hasVerticalScroller = shouldHaveVerticalScroller;
587 if (_hasVerticalScroller && !_verticalScroller)
589 var
bounds = [
self _insetBounds];
603 return _autohidesScrollers;
612 - (void)setAutohidesScrollers:(BOOL)autohidesScrollers
624 return _bottomCornerView;
627 - (void)setBottomCornerView:(
CPView)aBottomCornerView
629 if (_bottomCornerView === aBottomCornerView)
632 [_bottomCornerView removeFromSuperview];
634 [aBottomCornerView
setFrame:[
self _bottomCornerViewFrame]];
637 _bottomCornerView = aBottomCornerView;
639 [
self _updateCornerAndHeaderView];
655 - (void)setLineScroll:(
float)aLineScroll
666 return _horizontalLineScroll;
674 - (void)setHorizontalLineScroll:(
float)aLineScroll
676 _horizontalLineScroll = aLineScroll;
684 return _verticalLineScroll;
692 - (void)setVerticalLineScroll:(
float)aLineScroll
694 _verticalLineScroll = aLineScroll;
710 - (void)setPageScroll:(
float)aPageScroll
721 return _horizontalPageScroll;
729 - (void)setHorizontalPageScroll:(
float)aPageScroll
731 _horizontalPageScroll = aPageScroll;
739 return _verticalPageScroll;
747 - (void)setVerticalPageScroll:(
float)aPageScroll
749 _verticalPageScroll = aPageScroll;
754 #pragma mark Privates 757 - (void)_updateScrollerStyle
759 if (_hasHorizontalScroller)
761 [_horizontalScroller setStyle:_scrollerStyle];
762 [_horizontalScroller unsetThemeState:CPThemeStateSelected];
764 switch (_scrollerKnobStyle)
767 [_horizontalScroller unsetThemeState:CPThemeStateScrollerKnobDark];
768 [_horizontalScroller setThemeState:CPThemeStateScrollerKnobLight];
772 [_horizontalScroller unsetThemeState:CPThemeStateScrollerKnobLight];
773 [_horizontalScroller setThemeState:CPThemeStateScrollerKnobDark];
777 [_horizontalScroller unsetThemeState:CPThemeStateScrollerKnobLight];
778 [_horizontalScroller unsetThemeState:CPThemeStateScrollerKnobDark];
782 if (_hasVerticalScroller)
784 [_verticalScroller setStyle:_scrollerStyle];
785 [_verticalScroller unsetThemeState:CPThemeStateSelected];
787 switch (_scrollerKnobStyle)
790 [_verticalScroller unsetThemeState:CPThemeStateScrollerKnobDark];
791 [_verticalScroller setThemeState:CPThemeStateScrollerKnobLight];
795 [_verticalScroller unsetThemeState:CPThemeStateScrollerKnobLight];
796 [_verticalScroller setThemeState:CPThemeStateScrollerKnobDark];
800 [_verticalScroller unsetThemeState:CPThemeStateScrollerKnobLight];
801 [_verticalScroller unsetThemeState:CPThemeStateScrollerKnobDark];
807 if (_timerScrollersHide)
808 [_timerScrollersHide invalidate];
820 - (CGRect)_insetBounds
822 return [[
self class] _insetBounds:[
self bounds] borderType:_borderType];
826 - (void)_updateCornerAndHeaderView
829 currentHeaderView = [
self _headerView],
830 documentHeaderView = [documentView respondsToSelector:@selector(headerView)] ? [documentView headerView] : nil;
832 if (currentHeaderView !== documentHeaderView)
834 [currentHeaderView removeFromSuperview];
835 [_headerClipView setDocumentView:documentHeaderView];
838 var documentCornerView = [documentView respondsToSelector:@selector(cornerView)] ? [documentView cornerView] : nil;
840 if (_cornerView !== documentCornerView)
842 [_cornerView removeFromSuperview];
844 _cornerView = documentCornerView;
848 [_cornerView setHidden:!SHOULD_SHOW_CORNER_VIEW()];
854 [documentHeaderView setNeedsLayout];
855 [documentHeaderView setNeedsDisplay:YES];
861 return [_headerClipView documentView];
865 - (CGRect)_cornerViewFrame
868 return CGRectMakeZero();
870 var
bounds = [
self _insetBounds],
871 frame = [_cornerView frame];
873 frame.origin.x = CGRectGetMaxX(bounds) - CGRectGetWidth(
frame);
874 frame.origin.y = CGRectGetMinY(bounds);
880 - (CGRect)_headerClipViewFrame
882 var headerView = [
self _headerView];
885 return CGRectMakeZero();
887 var
frame = [
self _insetBounds];
889 frame.size.height = CGRectGetHeight([headerView frame]);
892 frame.size.width -= CGRectGetWidth([
self _cornerViewFrame]);
898 - (CGRect)_bottomCornerViewFrame
901 return CGRectMakeZero();
904 bottomCornerFrame = CGRectMakeZero();
906 bottomCornerFrame.origin.x = CGRectGetMinX(verticalFrame);
907 bottomCornerFrame.origin.y = CGRectGetMaxY(verticalFrame);
911 return bottomCornerFrame;
915 - (void)_verticalScrollerDidScroll:(
CPScroller)aScroller
918 documentFrame = [[_contentView documentView] frame],
919 contentBounds = [_contentView bounds];
922 switch ([_verticalScroller hitPart])
925 contentBounds.origin.y -= _verticalLineScroll;
929 contentBounds.origin.y += _verticalLineScroll;
933 contentBounds.origin.y -= CGRectGetHeight(contentBounds) - _verticalPageScroll;
937 contentBounds.origin.y += CGRectGetHeight(contentBounds) - _verticalPageScroll;
944 contentBounds.origin.y = ROUND(value * (CGRectGetHeight(documentFrame) - CGRectGetHeight(contentBounds)));
947 [
self _sendDelegateMessages];
949 [_contentView scrollToPoint:contentBounds.origin];
953 - (void)_horizontalScrollerDidScroll:(
CPScroller)aScroller
957 contentBounds = [_contentView bounds];
959 switch ([_horizontalScroller hitPart])
962 contentBounds.origin.x -= _horizontalLineScroll;
966 contentBounds.origin.x += _horizontalLineScroll;
970 contentBounds.origin.x -= CGRectGetWidth(contentBounds) - _horizontalPageScroll;
974 contentBounds.origin.x += CGRectGetWidth(contentBounds) - _horizontalPageScroll;
981 contentBounds.origin.x = ROUND(value * (CGRectGetWidth(documentFrame) - CGRectGetWidth(contentBounds)));
984 [
self _sendDelegateMessages];
986 [_contentView scrollToPoint:contentBounds.origin];
987 [_headerClipView scrollToPoint:CGPointMake(contentBounds.origin.x, 0.0)];
991 - (void)_sendDelegateMessages
993 if (_implementedDelegateMethods == 0)
998 [
self _scrollViewWillScroll];
1006 - (void)_hideScrollers:(
CPTimer)theTimer
1008 if ([_verticalScroller allowFadingOut])
1009 [_verticalScroller fadeOut];
1010 if ([_horizontalScroller allowFadingOut])
1011 [_horizontalScroller fadeOut];
1012 _timerScrollersHide = nil;
1016 - (void)_respondToScrollWheelEventWithDeltaX:(
float)deltaX deltaY:(float)deltaY
1019 contentBounds = [_contentView bounds],
1020 contentFrame = [_contentView frame],
1024 contentBounds.origin.x = ROUND(contentBounds.origin.x + deltaX);
1025 contentBounds.origin.y = ROUND(contentBounds.origin.y + deltaY);
1027 var constrainedOrigin = [_contentView constrainScrollPoint:CGPointCreateCopy(contentBounds.origin)],
1028 extraX = contentBounds.origin.x - constrainedOrigin.x,
1029 extraY = contentBounds.origin.y - constrainedOrigin.y;
1031 [
self _sendDelegateMessages];
1033 [_contentView scrollToPoint:constrainedOrigin];
1034 [_headerClipView scrollToPoint:CGPointMake(constrainedOrigin.x, 0.0)];
1036 if (extraX || extraY)
1041 - (void)_scrollViewWillScroll
1044 [_delegate scrollViewWillScroll:self];
1048 - (void)_scrollViewDidScroll
1050 [_scrollTimer invalidate];
1054 [_delegate scrollViewDidScroll:self];
1058 - (void)_didReceiveDefaultStyleChange:(
CPNotification)aNotification
1066 #pragma mark Utilities 1086 if (_contentView !== aClipView)
1089 if (_recursionCount > 5)
1098 if (_autohidesScrollers)
1100 [_verticalScroller setHidden:YES];
1101 [_horizontalScroller setHidden:YES];
1104 [_contentView setFrame:[
self _insetBounds]];
1105 [_headerClipView setFrame:CGRectMakeZero()];
1113 contentFrame = [
self _insetBounds],
1114 headerClipViewFrame = [
self _headerClipViewFrame],
1115 headerClipViewHeight = CGRectGetHeight(headerClipViewFrame);
1117 contentFrame.origin.y += headerClipViewHeight;
1118 contentFrame.size.height -= headerClipViewHeight;
1120 var difference = CGSizeMake(CGRectGetWidth(documentFrame) - CGRectGetWidth(contentFrame), CGRectGetHeight(documentFrame) - CGRectGetHeight(contentFrame)),
1123 hasVerticalScroll = difference.height > 0.0,
1124 hasHorizontalScroll = difference.width > 0.0,
1125 shouldShowVerticalScroller = _hasVerticalScroller && (!_autohidesScrollers || hasVerticalScroll),
1126 shouldShowHorizontalScroller = _hasHorizontalScroller && (!_autohidesScrollers || hasHorizontalScroll);
1129 if (shouldShowVerticalScroller)
1132 difference.width += verticalScrollerWidth;
1133 hasHorizontalScroll = difference.width > 0.0;
1134 shouldShowHorizontalScroller = _hasHorizontalScroller && (!_autohidesScrollers || hasHorizontalScroll);
1137 if (shouldShowHorizontalScroller)
1140 difference.height += horizontalScrollerHeight;
1141 hasVerticalScroll = difference.height > 0.0;
1142 shouldShowVerticalScroller = _hasVerticalScroller && (!_autohidesScrollers || hasVerticalScroll);
1146 [_verticalScroller setHidden:!shouldShowVerticalScroller];
1147 [_verticalScroller setEnabled:hasVerticalScroll];
1149 [_horizontalScroller setHidden:!shouldShowHorizontalScroller];
1150 [_horizontalScroller setEnabled:hasHorizontalScroll];
1156 if (shouldShowVerticalScroller)
1157 contentFrame.size.width -= verticalScrollerWidth;
1159 if (shouldShowHorizontalScroller)
1160 contentFrame.size.height -= horizontalScrollerHeight;
1164 var scrollPoint = [_contentView bounds].origin,
1165 wasShowingVerticalScroller = ![_verticalScroller isHidden],
1166 wasShowingHorizontalScroller = ![_horizontalScroller isHidden];
1168 if (shouldShowVerticalScroller)
1170 var verticalScrollerY =
1171 MAX(CGRectGetMinY(contentFrame), MAX(CGRectGetMaxY([
self _cornerViewFrame]), CGRectGetMaxY(headerClipViewFrame)));
1173 var verticalScrollerHeight = CGRectGetMaxY(contentFrame) - verticalScrollerY;
1177 verticalScrollerHeight -= horizontalScrollerHeight;
1179 var documentHeight = CGRectGetHeight(documentFrame);
1180 [_verticalScroller setFloatValue:(difference.height <= 0.0) ? 0.0 : scrollPoint.y / difference.height];
1181 [_verticalScroller setKnobProportion:documentHeight > 0 ? CGRectGetHeight(contentFrame) / documentHeight : 1.0];
1182 [_verticalScroller setFrame:CGRectMake(CGRectGetMaxX(contentFrame) - overlay, verticalScrollerY, verticalScrollerWidth, verticalScrollerHeight)];
1184 else if (wasShowingVerticalScroller)
1186 [_verticalScroller setFloatValue:0.0];
1187 [_verticalScroller setKnobProportion:1.0];
1190 if (shouldShowHorizontalScroller)
1192 var horizontalScrollerWidth = CGRectGetWidth(contentFrame);
1195 horizontalScrollerWidth -= verticalScrollerWidth;
1197 var documentWidth = CGRectGetWidth(documentFrame);
1199 [_horizontalScroller setFloatValue:(difference.width <= 0.0) ? 0.0 : scrollPoint.x / difference.width];
1200 [_horizontalScroller setKnobProportion:documentWidth > 0 ? CGRectGetWidth(contentFrame) / documentWidth : 1.0];
1201 [_horizontalScroller setFrame:CGRectMake(CGRectGetMinX(contentFrame), CGRectGetMaxY(contentFrame) - overlay, horizontalScrollerWidth, horizontalScrollerHeight)];
1203 else if (wasShowingHorizontalScroller)
1205 [_horizontalScroller setFloatValue:0.0];
1206 [_horizontalScroller setKnobProportion:1.0];
1209 [_contentView setFrame:contentFrame];
1210 [_headerClipView setFrame:[
self _headerClipViewFrame]];
1211 [[_headerClipView documentView] setNeedsDisplay:YES];
1214 [_cornerView setFrame:[
self _cornerViewFrame]];
1215 [_cornerView setHidden:NO];
1218 [_cornerView setHidden:YES];
1237 if (_hasHorizontalScroller)
1239 [_horizontalScroller setHidden:NO];
1240 [_horizontalScroller fadeIn];
1243 if (_hasVerticalScroller)
1245 [_verticalScroller setHidden:NO];
1246 [_verticalScroller fadeIn];
1249 if (_timerScrollersHide)
1250 [_timerScrollersHide invalidate]
1256 - (void)resizeSubviewsWithOldSize:(CGSize)aSize
1263 return [_contentView documentVisibleRect];
1267 #pragma mark Overrides 1270 - (void)_removeObservers
1276 name:CPScrollerStyleGlobalChangeNotification
1279 [
super _removeObservers];
1282 - (void)_addObservers
1288 [
self _didReceiveDefaultStyleChange:nil];
1292 name:CPScrollerStyleGlobalChangeNotification
1295 [
super _addObservers];
1300 - (void)drawRect:(CGRect)aRect
1307 var strokeRect = [
self bounds],
1312 switch (_borderType)
1320 [
self _drawGrayBezelInContext:context bounds:strokeRect];
1324 [
self _drawGrooveInContext:context bounds:strokeRect];
1332 - (void)_drawGrayBezelInContext:(CGContext)context
bounds:(CGRect)aRect
1334 var minX = CGRectGetMinX(aRect),
1335 maxX = CGRectGetMaxX(aRect),
1336 minY = CGRectGetMinY(aRect),
1337 maxY = CGRectGetMaxY(aRect),
1366 - (void)_drawGrooveInContext:(CGContext)context
bounds:(CGRect)aRect
1368 var minX = CGRectGetMinX(aRect),
1369 maxX = CGRectGetMaxX(aRect),
1370 minY = CGRectGetMinY(aRect),
1371 maxY = CGRectGetMaxY(aRect);
1401 var rect = CGRectOffset(aRect, 1.0, 1.0);
1403 rect.size.width -= 1.0;
1404 rect.size.height -= 1.0;
1424 if (_timerScrollersHide)
1425 [_timerScrollersHide invalidate];
1427 [_verticalScroller fadeIn];
1428 if (![_horizontalScroller
isHidden])
1429 [_horizontalScroller fadeIn];
1436 if (![anEvent hasPreciseScrollingDeltas])
1438 deltaX *= (_horizontalLineScroll || 1.0);
1439 deltaY *= (_verticalLineScroll || 1.0);
1442 [
self _respondToScrollWheelEventWithDeltaX:deltaX deltaY:deltaY];
1445 - (void)scrollPageUp:(
id)sender
1447 var contentBounds = [_contentView bounds];
1448 [
self moveByOffset:CGSizeMake(0.0, -(CGRectGetHeight(contentBounds) - _verticalPageScroll))];
1451 - (void)scrollPageDown:(
id)sender
1453 var contentBounds = [_contentView bounds];
1454 [
self moveByOffset:CGSizeMake(0.0, CGRectGetHeight(contentBounds) - _verticalPageScroll)];
1457 - (void)scrollToBeginningOfDocument:(
id)sender
1459 [_contentView scrollToPoint:CGPointMakeZero()];
1460 [_headerClipView scrollToPoint:CGPointMakeZero()];
1463 - (void)scrollToEndOfDocument:(
id)sender
1465 var contentBounds = [_contentView bounds],
1467 scrollPoint = CGPointMake(0.0, CGRectGetHeight(documentFrame) - CGRectGetHeight(contentBounds));
1469 [_contentView scrollToPoint:scrollPoint];
1470 [_headerClipView scrollToPoint:CGPointMakeZero()];
1473 - (void)moveLeft:(
id)sender
1475 [
self moveByOffset:CGSizeMake(-_horizontalLineScroll, 0.0)];
1478 - (void)moveRight:(
id)sender
1480 [
self moveByOffset:CGSizeMake(_horizontalLineScroll, 0.0)];
1483 - (void)moveUp:(
id)sender
1485 [
self moveByOffset:CGSizeMake(0.0, -_verticalLineScroll)];
1488 - (void)moveDown:(
id)sender
1490 [
self moveByOffset:CGSizeMake(0.0, _verticalLineScroll)];
1493 - (void)moveByOffset:(CGSize)aSize
1496 contentBounds = [_contentView bounds];
1498 contentBounds.origin.x += aSize.width;
1499 contentBounds.origin.y += aSize.height;
1501 [_contentView scrollToPoint:contentBounds.origin];
1502 [_headerClipView scrollToPoint:CGPointMake(contentBounds.origin.x, 0)];
1529 if (
self = [super initWithCoder:aCoder])
1531 _verticalLineScroll = [aCoder decodeFloatForKey:CPScrollViewVLineScrollKey];
1532 _verticalPageScroll = [aCoder decodeFloatForKey:CPScrollViewVPageScrollKey];
1534 _horizontalLineScroll = [aCoder decodeFloatForKey:CPScrollViewHLineScrollKey];
1535 _horizontalPageScroll = [aCoder decodeFloatForKey:CPScrollViewHPageScrollKey];
1537 _contentView = [aCoder decodeObjectForKey:CPScrollViewContentViewKey];
1538 _headerClipView = [aCoder decodeObjectForKey:CPScrollViewHeaderClipViewKey];
1540 if (!_headerClipView)
1546 _verticalScroller = [aCoder decodeObjectForKey:CPScrollViewVScrollerKey];
1547 _horizontalScroller = [aCoder decodeObjectForKey:CPScrollViewHScrollerKey];
1549 _hasVerticalScroller = [aCoder decodeBoolForKey:CPScrollViewHasVScrollerKey];
1550 _hasHorizontalScroller = [aCoder decodeBoolForKey:CPScrollViewHasHScrollerKey];
1551 _autohidesScrollers = [aCoder decodeBoolForKey:CPScrollViewAutohidesScrollerKey];
1553 _borderType = [aCoder decodeIntForKey:CPScrollViewBorderTypeKey];
1555 _cornerView = [aCoder decodeObjectForKey:CPScrollViewCornerViewKey];
1556 _bottomCornerView = [aCoder decodeObjectForKey:CPScrollViewBottomCornerViewKey];
1560 _implementedDelegateMethods = 0;
1567 name:CPScrollerStyleGlobalChangeNotification
1579 [
super awakeFromCib];
1581 [
self _updateScrollerStyle];
1582 [
self _updateCornerAndHeaderView];
1589 [aCoder encodeObject:_contentView forKey:CPScrollViewContentViewKey];
1590 [aCoder encodeObject:_headerClipView forKey:CPScrollViewHeaderClipViewKey];
1592 [aCoder encodeObject:_verticalScroller forKey:CPScrollViewVScrollerKey];
1593 [aCoder encodeObject:_horizontalScroller forKey:CPScrollViewHScrollerKey];
1595 [aCoder encodeFloat:_verticalLineScroll forKey:CPScrollViewVLineScrollKey];
1596 [aCoder encodeFloat:_verticalPageScroll forKey:CPScrollViewVPageScrollKey];
1597 [aCoder encodeFloat:_horizontalLineScroll forKey:CPScrollViewHLineScrollKey];
1598 [aCoder encodeFloat:_horizontalPageScroll forKey:CPScrollViewHPageScrollKey];
1600 [aCoder encodeBool:_hasVerticalScroller forKey:CPScrollViewHasVScrollerKey];
1601 [aCoder encodeBool:_hasHorizontalScroller forKey:CPScrollViewHasHScrollerKey];
1602 [aCoder encodeBool:_autohidesScrollers forKey:CPScrollViewAutohidesScrollerKey];
1604 [aCoder encodeObject:_cornerView forKey:CPScrollViewCornerViewKey];
1605 [aCoder encodeObject:_bottomCornerView forKey:CPScrollViewBottomCornerViewKey];
1607 [aCoder encodeInt:_borderType forKey:CPScrollViewBorderTypeKey];
1609 [aCoder encodeInt:_scrollerStyle forKey:CPScrollViewScrollerStyleKey];
1610 [aCoder encodeInt:_scrollerKnobStyle forKey:CPScrollViewScrollerKnobStyleKey];
id initWithFrame:(CGRect aFrame)
void addSubview:(CPView aSubview)
A CALayer is similar to a CPView
void drawRect:(CGRect aRect)
A representation of a single point in time.
CPGraphicsContext currentContext()
function CGContextSetStrokeColor(aContext, aColor)
void addObserver:selector:name:object:(id anObserver, [selector] SEL aSelector, [name] CPString aNotificationName, [object] id anObject)
void setFrame:(CGRect aFrame)
void postNotificationName:object:(CPString aNotificationName, [object] id anObject)
function CGContextAddLineToPoint(aContext, x, y)
function CGContextStrokePath(aContext)
CPNotificationCenter defaultCenter()
A mutable key-value pair collection.
CPScrollView enclosingScrollView()
function CGContextSetLineWidth(aContext, aLineWidth)
An immutable string (collection of characters).
void setHidden:(BOOL aFlag)
void setNeedsDisplay:(BOOL aFlag)
void encodeWithCoder:(CPCoder aCoder)
function CGContextBeginPath(aContext)
A notification that can be posted to a CPNotificationCenter.
CPTimer scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:(CPTimeInterval seconds, [target] id aTarget, [selector] SEL aSelector, [userInfo] id userInfo, [repeats] BOOL shouldRepeat)
A timer object that can send a message after the given time interval.
id objectForInfoDictionaryKey:(CPString aKey)
Defines methods for use when archiving & restoring (enc/decoding).
function CGContextStrokeRect(aContext, aRect)
Sends messages (CPNotification) between objects.
void setBackgroundColor:(CPColor aColor)
void removeObserver:name:object:(id anObserver, [name] CPString aNotificationName, [object] id anObject)
id dateWithTimeIntervalSinceNow:(CPTimeInterval seconds)
function CGContextMoveToPoint(aContext, x, y)