Class CPResponder

CPObject
    extended byCPResponder
Direct Known Subclasses:
CPApplication, CPDocument, CPView, CPWindow, CPWindowController, NSResponder

@implementation CPResponder : CPObject

Method Summary
-(id)initWithCoder:(CPCoder)aCoder
          Initializes the responder with data from a coder.
-(id)NS_initWithCoder:(CPCoder)aCoder
-(BOOL)acceptsFirstResponder
          Returns YES if the receiver is able to become the first responder.
-(BOOL)becomeFirstResponder
          Notifies the receiver that it will become the first responder.
-(void)deleteBackward:(id)aSender
          Deletes one character backward, or the selection if anything is selected.
-(void)doCommandBySelector:(SEL)aSelector
          The receiver will attempt to perform the command, if it responds to it.
-(void)encodeWithCoder:(CPCoder)aCoder
          Archives the responder to a coder.
-(void)insertLineBreak:(id)aSender
          Insert a line break at the caret position or selection.
-(void)insertText:(CPString)aString
          Inserts some text at the caret position or selection.
-(void)interpretKeyEvents:(CPArray)events
          Called to interpret a series of key events.
-(void)keyDown:(CPEvent)anEvent
          Notifies the receiver that the user has pressed a key.
-(void)keyUp:(CPEvent)anEvent
          Notifies the receiver that the user has released a key.
-(CPMenu)menu
-(void)mouseDown:(CPEvent)anEvent
          Notifies the receiver that the user has clicked the mouse down in its area.
-(void)mouseDragged:(CPEvent)anEvent
          Notifies the receiver that the user has initiated a drag over it.
-(void)mouseEntered:(CPEvent)anEvent
-(void)mouseExited:(CPEvent)anEvent
          Notifies the receiver that the mouse exited the receiver's area.
-(void)mouseMoved:(CPEvent)anEvent
          Notifies the receiver that the user has moved the mouse (with no buttons down).
-(void)mouseUp:(CPEvent)anEvent
          Notifies the receiver that the user has released the left mouse button.
-(CPResponder)nextResponder
          Returns the responder after the receiver.
-(void)noResponderFor:(SEL)anEventSelector
          Called when an event finds no suitable responder.
-(BOOL)performKeyEquivalent:(CPEvent)anEvent
          FIXME This description is bad.
-(BOOL)resignFirstResponder
          Notifies the receiver that it has been asked to give up first responder status.
-(void)scrollWheel:(CPEvent)anEvent
          Notifies the receiver that the mouse scroll wheel has moved.
-(void)setMenu:(CPMenu)aMenu
-(void)setNextResponder:(CPResponder)aResponder
          Sets the receiver's next responder.
-(BOOL)tryToPerform:(SEL)aSelector with:(id)anObject
          The receiver will attempt to perform the command, or pass it on to the next responder if it doesn't respond to it.
-(CPUndoManager)undoManager
          Returns the undo manager for the receiver.

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


Method Detail

initWithCoder

-(id)initWithCoder:(CPCoder)aCoder
Initializes the responder with data from a coder.
Parameters:
aCoder - the coder from which data will be read
Returns:
the initialized responder

NS_initWithCoder

-(id)NS_initWithCoder:(CPCoder)aCoder
Parameters:
aCoder

acceptsFirstResponder

-(BOOL)acceptsFirstResponder
Returns YES if the receiver is able to become the first responder. NO otherwise.

becomeFirstResponder

-(BOOL)becomeFirstResponder
Notifies the receiver that it will become the first responder. The receiver can reject first responder if it returns NO. The default implementation always returns YES.
Returns:
YES if the receiver accepts first responder status.

deleteBackward

-(void)deleteBackward:(id)aSender
Deletes one character backward, or the selection if anything is selected.
Parameters:
aSender - the object requesting this

doCommandBySelector

-(void)doCommandBySelector:(SEL)aSelector
The receiver will attempt to perform the command, if it responds to it. If not, the nextResponder will be called to do it.
Parameters:
aSelector - the command to attempt

encodeWithCoder

-(void)encodeWithCoder:(CPCoder)aCoder
Archives the responder to a coder.
Parameters:
aCoder - the coder to which the responder will be archived

insertLineBreak

-(void)insertLineBreak:(id)aSender
Insert a line break at the caret position or selection.
Parameters:
aSender - the object requesting this

insertText

-(void)insertText:(CPString)aString
Inserts some text at the caret position or selection.
Parameters:
aString - the string to insert

interpretKeyEvents

-(void)interpretKeyEvents:(CPArray)events
Called to interpret a series of key events.
Parameters:
events - an array of key CPEvents

keyDown

-(void)keyDown:(CPEvent)anEvent
Notifies the receiver that the user has pressed a key.
Parameters:
anEvent - information about the key press

keyUp

-(void)keyUp:(CPEvent)anEvent
Notifies the receiver that the user has released a key.
Parameters:
anEvent - information about the key press

menu

-(CPMenu)menu

mouseDown

-(void)mouseDown:(CPEvent)anEvent
Notifies the receiver that the user has clicked the mouse down in its area.
Parameters:
anEvent - contains information about the click

mouseDragged

-(void)mouseDragged:(CPEvent)anEvent
Notifies the receiver that the user has initiated a drag over it. A drag is a mouse movement while the left button is down.
Parameters:
anEvent - contains information about the drag

mouseEntered

-(void)mouseEntered:(CPEvent)anEvent
Parameters:
anEvent

mouseExited

-(void)mouseExited:(CPEvent)anEvent
Notifies the receiver that the mouse exited the receiver's area.
Parameters:
anEvent - contains information about the exit

mouseMoved

-(void)mouseMoved:(CPEvent)anEvent
Notifies the receiver that the user has moved the mouse (with no buttons down).
Parameters:
anEvent - contains information about the movement

mouseUp

-(void)mouseUp:(CPEvent)anEvent
Notifies the receiver that the user has released the left mouse button.
Parameters:
anEvent - contains information about the release

nextResponder

-(CPResponder)nextResponder
Returns the responder after the receiver.

noResponderFor

-(void)noResponderFor:(SEL)anEventSelector
Called when an event finds no suitable responder.
Parameters:
anEventSelector - the command that failed

performKeyEquivalent

-(BOOL)performKeyEquivalent:(CPEvent)anEvent
FIXME This description is bad. Based on anEvent, the receiver should simulate the event.
Parameters:
anEvent - the event to simulate
Returns:
YES if the event receiver simulated the event

resignFirstResponder

-(BOOL)resignFirstResponder
Notifies the receiver that it has been asked to give up first responder status.
Returns:
YES if the receiver is willing to give up first responder status.

scrollWheel

-(void)scrollWheel:(CPEvent)anEvent
Notifies the receiver that the mouse scroll wheel has moved.
Parameters:
anEvent - information about the scroll

setMenu

-(void)setMenu:(CPMenu)aMenu
Parameters:
aMenu

setNextResponder

-(void)setNextResponder:(CPResponder)aResponder
Sets the receiver's next responder.
Parameters:
aResponder - the responder after the receiver

tryToPerform

-(BOOL)tryToPerform:(SEL)aSelector with:(id)anObject
The receiver will attempt to perform the command, or pass it on to the next responder if it doesn't respond to it.
Parameters:
aSelector - the command to perform
anObject - the argument to the method
Returns:
YES if the receiver was able to perform the command, or a responder down the chain was able to perform the command.

undoManager

-(CPUndoManager)undoManager
Returns the undo manager for the receiver.

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