API 0.9.5
CPResponder Class Reference

#import <CPResponder.h>

Inheritance diagram for CPResponder:

List of all members.

Instance Methods

(BOOL) - acceptsFirstResponder
(BOOL) - becomeFirstResponder
(void) - doCommandBySelector:
(void) - encodeWithCoder:
(void) - flagsChanged:
(id) - initWithCoder:
(void) - insertBackTab:
(void) - insertLineBreak:
(void) - insertNewline:
(void) - insertTab:
(void) - insertText:
(void) - interpretKeyEvents:
(void) - keyDown:
(void) - keyUp:
(CPMenu- menu
(void) - mouseDown:
(void) - mouseDragged:
(void) - mouseEntered:
(void) - mouseExited:
(void) - mouseMoved:
(void) - mouseUp:
(CPResponder- nextResponder
(void) - noResponderFor:
(BOOL) - performKeyEquivalent:
(BOOL) - resignFirstResponder
(void) - rightMouseDown:
(void) - rightMouseUp:
(void) - scrollWheel:
(void) - setMenu:
(void) - setNextResponder:
(BOOL) - tryToPerform:with:
(CPUndoManager- undoManager

Detailed Description

Subclasses of CPResonder can be part of the responder chain.

Definition at line 2 of file CPResponder.h.


Method Documentation

- (BOOL) acceptsFirstResponder

Returns YES if the receiver is able to become the first responder. NO otherwise.

Reimplemented in CPBrowser, CPCollectionView, CPTableView, CPTextField, and CPWindow.

Definition at line 54 of file CPResponder.j.

- (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.

Reimplemented in CPTableView, CPTextField, and CPTokenField.

Definition at line 64 of file CPResponder.j.

- (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:
aSelectorthe command to attempt

Reimplemented in CPApplication, CPTextField, and CPWindow.

Definition at line 292 of file CPResponder.j.

- (void) encodeWithCoder: (CPCoder aCoder
- (void) flagsChanged: (CPEvent anEvent

Notifies the receiver that the user has pressed or released a modifier key (Shift, Control, and so on).

Parameters:
anEventinformation about the key press

Definition at line 228 of file CPResponder.j.

- (id) initWithCoder: (CPCoder aCoder

Initializes the responder with data from a coder.

Parameters:
aCoderthe coder from which data will be read
Returns:
the initialized responder

Reimplemented in CPBox, CPBrowser, CPButton, CPButtonBar, CPClipView, CPCollectionView, CPColorWell, CPControl, CPImageView, CPLevelIndicator, CPOutlineView, CPPopover, CPPopUpButton, CPProgressIndicator, CPRadio, CPScroller, CPScrollView, CPSearchField, CPSegmentedControl, CPSlider, CPSplitView, CPStepper, CPTableHeaderView, CPTableView, CPTabView, CPTextField, CPTokenField, CPView, CPViewController, and CPWebView.

Definition at line 361 of file CPResponder.j.

- (void) insertBackTab: (id)  sender

Definition at line 274 of file CPResponder.j.

- (void) insertLineBreak: (id)  aSender

Insert a line break at the caret position or selection.

Parameters:
aSenderthe object requesting this

Definition at line 256 of file CPResponder.j.

- (void) insertNewline: (id)  aSender

Insert a line break at the caret position or selection.

Parameters:
aSenderthe object requesting this

Reimplemented in CPTextField.

Definition at line 265 of file CPResponder.j.

- (void) insertTab: (id)  sender

Definition at line 270 of file CPResponder.j.

- (void) insertText: (CPString aString

Inserts some text at the caret position or selection.

Parameters:
aStringthe string to insert

Definition at line 282 of file CPResponder.j.

- (void) interpretKeyEvents: (CPArray events

Called to interpret a series of key events.

Parameters:
eventsan array of key CPEvents

Definition at line 100 of file CPResponder.j.

- (void) keyDown: (CPEvent anEvent

Notifies the receiver that the user has pressed a key.

Parameters:
anEventinformation about the key press

Reimplemented in CPBrowser, CPCollectionView, CPOutlineView, CPTableView, CPTextField, and CPWindow.

Definition at line 210 of file CPResponder.j.

- (void) keyUp: (CPEvent anEvent

Notifies the receiver that the user has released a key.

Parameters:
anEventinformation about the key press

Reimplemented in CPTextField.

Definition at line 219 of file CPResponder.j.

- (CPMenu) menu

Reimplemented in CPSearchField.

Definition at line 326 of file CPResponder.j.

- (void) mouseDown: (CPEvent anEvent

Notifies the receiver that the user has clicked the mouse down in its area.

Parameters:
anEventcontains information about the click

Reimplemented in CPButton, CPCollectionView, CPColorWell, CPControl, CPFlashView, CPImageView, CPLevelIndicator, CPPopUpButton, CPScroller, CPSearchField, CPSegmentedControl, CPSplitView, CPTableHeaderView, CPTabView, CPTextField, CPTokenField, and CPView.

Definition at line 132 of file CPResponder.j.

- (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:
anEventcontains information about the drag

Reimplemented in CPCollectionView, CPColorWell, CPFlashView, and CPTextField.

Definition at line 151 of file CPResponder.j.

- (void) mouseEntered: (CPEvent anEvent

Reimplemented in CPControl, CPScroller, CPSplitView, and CPTableHeaderView.

Definition at line 183 of file CPResponder.j.

- (void) mouseExited: (CPEvent anEvent

Notifies the receiver that the mouse exited the receiver's area.

Parameters:
anEventcontains information about the exit

Reimplemented in CPControl, CPScroller, CPSplitView, and CPTableHeaderView.

Definition at line 192 of file CPResponder.j.

- (void) mouseMoved: (CPEvent anEvent

Notifies the receiver that the user has moved the mouse (with no buttons down).

Parameters:
anEventcontains information about the movement

Reimplemented in CPSplitView, and CPTableHeaderView.

Definition at line 178 of file CPResponder.j.

- (void) mouseUp: (CPEvent anEvent

Notifies the receiver that the user has released the left mouse button.

Parameters:
anEventcontains information about the release

Reimplemented in CPCollectionView, CPColorWell, CPFlashView, CPSegmentedControl, CPTextField, and CPTokenField.

Definition at line 160 of file CPResponder.j.

- (CPResponder) nextResponder

Returns the responder after the receiver.

Definition at line 91 of file CPResponder.j.

- (void) noResponderFor: (SEL)  anEventSelector

Called when an event finds no suitable responder.

Parameters:
anEventSelectorthe command that failed

Definition at line 345 of file CPResponder.j.

- (BOOL) performKeyEquivalent: (CPEvent anEvent

Overridden by subclasses to handle a key equivalent.

If the character code or codes in anEvent match the receiver’s key equivalent, the receiver should respond to the event and return YES. The default implementation does nothing and returns NO.

You should extract the characters for a key equivalent using [anEvent charactersIgnoringModifiers].

Parameters:
anEventAn event object that represents the key equivalent pressed
Returns:
YES if theEvent is a key equivalent that the receiver handled, NO if it is not a key equivalent that it should handle.

Reimplemented in CPButton, CPView, and CPWindow.

Definition at line 246 of file CPResponder.j.

- (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.

Reimplemented in CPSearchField, CPTextField, and CPTokenField.

Definition at line 73 of file CPResponder.j.

- (void) rightMouseDown: (CPEvent anEvent

Notifies the receiver that the user has clicked the right mouse down in its area.

Parameters:
anEventcontains information about the right click

Reimplemented in CPPopUpButton, and CPView.

Definition at line 141 of file CPResponder.j.

- (void) rightMouseUp: (CPEvent anEvent

Notifies the receiver that the user has released the right mouse button.

Parameters:
anEventcontains information about the release

Definition at line 169 of file CPResponder.j.

- (void) scrollWheel: (CPEvent anEvent

Notifies the receiver that the mouse scroll wheel has moved.

Parameters:
anEventinformation about the scroll

Reimplemented in CPScrollView.

Definition at line 201 of file CPResponder.j.

- (void) setMenu: (CPMenu aMenu

Reimplemented in CPApplication.

Definition at line 321 of file CPResponder.j.

- (void) setNextResponder: (CPResponder aResponder

Sets the receiver's next responder.

Parameters:
aResponderthe responder after the receiver

Definition at line 83 of file CPResponder.j.

- (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:
aSelectorthe command to perform
anObjectthe 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.

Reimplemented in CPApplication.

Definition at line 307 of file CPResponder.j.

- (CPUndoManager) undoManager

Returns the undo manager for the receiver.

Reimplemented in CPDocument.

Definition at line 335 of file CPResponder.j.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines