Class CPClipView

CPObject
    extended byCPResponder
        extended byCPView
            extended byCPClipView

@implementation CPClipView : CPView

CPClipView allows you to define a clip rect and display only that portion of its containing view. It is used to hold the document view in a CPScrollView.


Method Summary
-(CGPoint)constrainScrollPoint:(CGPoint)aPoint
          Returns a new point that may be adjusted from aPoint to make sure it lies within the document view.
-(id)documentView
          Returns the document view.
-(void)scrollToPoint:(CGPoint)aPoint
          Scrolls the clip view to the specified point.
-(void)setBoundsOrigin:(CGPoint)aPoint
          Sets the location of the receiver inside its frame.
-(void)setDocumentView:(CPView)aView
          Sets the document view to be aView.
-(void)viewBoundsChanged:(CPNotification)aNotification
          Handles a CPViewBoundsDidChangeNotification.
-(void)viewFrameChanged:(CPNotification)aNotification
          Handles a CPViewFrameDidChangeNotification.

Methods inherited from class CPObject
initialize, alloc, class, instanceMethodForSelector, instancesRespondToSelector, isSubclassOfClass, load, new, setVersion, superclass, version, init, autorelease, awakeAfterUsingCoder, class, classForCoder, classForKeyedArchiver, className, copy, dealloc, description, doesNotRecognizeSelector, forwardInvocation, hash, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableCopy, performSelector, performSelector, performSelector, release, replacementObjectForArchiver, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, retain, self, superclass

Methods inherited from class CPResponder
acceptsFirstResponder, becomeFirstResponder, deleteBackward, doCommandBySelector, insertLineBreak, insertText, interpretKeyEvents, keyDown, keyUp, menu, mouseDown, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseUp, nextResponder, noResponderFor, performKeyEquivalent, resignFirstResponder, scrollWheel, setMenu, setNextResponder, tryToPerform, undoManager

Methods inherited from class CPView
initWithFrame, acceptsFirstMouse, addSubview, addSubview, adjustScroll, alphaValue, autoresizesSubviews, autoresizingMask, autoscroll, backgroundColor, bounds, convertPoint, convertPoint, convertRect, convertRect, convertSize, convertSize, didAddSubview, display, displayIfNeeded, displayIfNeededInRect, displayRect, displayRectIgnoringOpacity, dragImage, dragView, drawRect, enclosingMenuItem, enclosingScrollView, enterFullScreenMode, exitFullScreenModeWithOptions, frame, hitTest, hitTests, isDescendantOf, isFlipped, isHidden, isHiddenOrHasHiddenAncestor, isInFullScreenMode, isOpaque, lockFocus, mouseDown, mouseDownCanMoveWindow, needsDisplay, postsBoundsChangedNotifications, postsFrameChangedNotifications, reflectScrolledClipView, registerForDraggedTypes, registeredDraggedTypes, removeFromSuperview, replaceSubview, resizeSubviewsWithOldSize, resizeWithOldSuperviewSize, scrollClipView, scrollPoint, scrollRectToVisible, scrollRect, setAlphaValue, setAutoresizesSubviews, setAutoresizingMask, setBackgroundColor, setBounds, setBoundsOrigin, setBoundsSize, setFrame, setFrameOrigin, setFrameSize, setHidden, setHitTests, setNeedsDisplay, setNeedsDisplayInRect, setPostsBoundsChangedNotifications, setPostsFrameChangedNotifications, subviews, superview, unlockFocus, unregisterDraggedTypes, viewDidMoveToSuperview, viewDidMoveToWindow, viewWillMoveToSuperview, viewWillMoveToWindow, visibleRect, willRemoveSubview, window


Method Detail

constrainScrollPoint

-(CGPoint)constrainScrollPoint:(CGPoint)aPoint
Returns a new point that may be adjusted from aPoint to make sure it lies within the document view.
Parameters:
aPoint -
Returns:
the adjusted point

documentView

-(id)documentView
Returns the document view.

scrollToPoint

-(void)scrollToPoint:(CGPoint)aPoint
Scrolls the clip view to the specified point. The method sets its bounds origin to aPoint.
Parameters:
aPoint

setBoundsOrigin

-(void)setBoundsOrigin:(CGPoint)aPoint
Sets the location of the receiver inside its frame. The method posts a CPViewBoundsDidChangeNotification to the default notification center if the receiver is configured to do so.
Parameters:
aPoint - the new location for the receiver

setDocumentView

-(void)setDocumentView:(CPView)aView
Sets the document view to be aView.
Parameters:
aView - the new document view. It's frame origin will be changed to (0,0) after calling this method.

viewBoundsChanged

-(void)viewBoundsChanged:(CPNotification)aNotification
Handles a CPViewBoundsDidChangeNotification.
Parameters:
aNotification - the notification event

viewFrameChanged

-(void)viewFrameChanged:(CPNotification)aNotification
Handles a CPViewFrameDidChangeNotification.
Parameters:
aNotification - the notification event

Created on Sat Sep 13 14:15:43 PDT 2008