API  0.9.6
 All Classes Files Functions Variables Macros Modules Pages
CPButton Class Reference

#import <CPButton.h>

+ Inheritance diagram for CPButton:

Instance Methods

(BOOL) - allowsMixedState
 
(CPImage- alternateImage
 
(CPString- alternateTitle
 
(CGRect) - bezelRectForBounds:
 
(unsigned) - bezelStyle
 
(CGRect) - contentRectForBounds:
 
(CPView- createEphemeralSubviewNamed:
 
(void) - encodeWithCoder:
 
(CPInteger) - highlightsBy
 
(CPImage- image
 
(BOOL) - imageDimsWhenDisabled
 
(float) - imageOffset
 
(id) - initWithCoder:
 
(id) - initWithFrame:
 
(void) - invalidateTimers
 
(BOOL) - isBordered
 
(CPString- keyEquivalent
 
(unsigned) - keyEquivalentModifierMask
 
(void) - layoutSubviews
 
(void) - mouseDown:
 
(CPInteger) - nextState
 
(void) - onContinousEvent:
 
(void) - performClick:
 
(BOOL) - performKeyEquivalent:
 
(CGRect) - rectForEphemeralSubviewNamed:
 
(void) - setAllowsMixedState:
 
(void) - setAlternateImage:
 
(void) - setAlternateTitle:
 
(void) - setBezelStyle:
 
(void) - setBordered:
 
(void) - setButtonType:
 
(void) - setHighlightsBy:
 
(void) - setImage:
 
(void) - setImageDimsWhenDisabled:
 
(void) - setImageOffset:
 
(void) - setKeyEquivalent:
 
(void) - setKeyEquivalentModifierMask:
 
(void) - setNextState
 
(void) - setObjectValue:
 
(void) - setPeriodicDelay:interval:
 
(void) - setShowsStateBy:
 
(void) - setState:
 
(void) - setTitle:
 
(CPInteger) - showsStateBy
 
(void) - sizeToFit
 
(BOOL) - startTrackingAt:
 
(CPInteger) - state
 
(void) - stopTracking:at:mouseIsUp:
 
(CPString- title
 
(void) - viewWillMoveToWindow:
 
- Instance Methods inherited from CPControl
(SEL) - action
 
(CPTextAlignment) - alignment
 
(BOOL) - continueTracking:at:
 
(double) - doubleValue
 
(float) - floatValue
 
(CPFont- font
 
(CPFormatter- formatter
 
(void) - highlight:
 
(CPCellImagePosition) - imagePosition
 
(CPImageScaling) - imageScaling
 
(int) - integerValue
 
(int) - intValue
 
(BOOL) - isContinuous
 
(BOOL) - isEnabled
 
(BOOL) - isHighlighted
 
(CPLineBreakMode) - lineBreakMode
 
(unsigned) - mouseDownFlags
 
(void) - mouseEntered:
 
(void) - mouseExited:
 
(id) - objectValue
 
(BOOL) - sendAction:to:
 
(int) - sendActionOn:
 
(BOOL) - sendsActionOnEndEditing
 
(void) - setAction:
 
(void) - setAlignment:
 
(void) - setContinuous:
 
(void) - setDoubleValue:
 
(void) - setEnabled:
 
(void) - setFloatValue:
 
(void) - setFont:
 
(void) - setFormatter:
 
(void) - setHighlighted:
 
(void) - setImagePosition:
 
(void) - setImageScaling:
 
(void) - setIntegerValue:
 
(void) - setIntValue:
 
(void) - setLineBreakMode:
 
(void) - setSendsActionOnEndEditing:
 
(void) - setState:
 
(void) - setStringValue:
 
(void) - setTarget:
 
(void) - setTextColor:
 
(void) - setTextShadowColor:
 
(void) - setTextShadowOffset:
 
(void) - setVerticalAlignment:
 
(CPString- stringValue
 
(void) - takeDoubleValueFrom:
 
(void) - takeFloatValueFrom:
 
(void) - takeIntegerValueFrom:
 
(void) - takeIntValueFrom:
 
(void) - takeObjectValueFrom:
 
(void) - takeStringValueFrom:
 
(id) - target
 
(CPColor- textColor
 
(void) - textDidBeginEditing:
 
(void) - textDidChange:
 
(void) - textDidEndEditing:
 
(CPColor- textShadowColor
 
(CGSize) - textShadowOffset
 
(void) - trackMouse:
 
(BOOL) - tracksMouseOutsideOfFrame
 
(void) - unhighlightButtonTimerDidFinish:
 
(CPTextVerticalAlignment) - verticalAlignment
 
- Instance Methods inherited from CPView
(BOOL) - acceptsFirstMouse:
 
(void) - addSubview:
 
(void) - addSubview:positioned:relativeTo:
 
(CGRect) - adjustScroll:
 
(float) - alphaValue
 
(BOOL) - autoresizesSubviews
 
(unsigned) - autoresizingMask
 
(BOOL) - autoscroll:
 
(CPColor- backgroundColor
 
(CGRect) - bounds
 
(CGPoint) - boundsOrigin
 
(CGSize) - boundsSize
 
(BOOL) - canBecomeKeyView
 
(CGPoint) - center
 
(BOOL) - clipsToBounds
 
(CGPoint) - convertPoint:fromView:
 
(CGPoint) - convertPoint:toView:
 
(CGPoint) - convertPointFromBase:
 
(CGPoint) - convertPointToBase:
 
(CGRect) - convertRect:fromView:
 
(CGRect) - convertRect:toView:
 
(CGRect) - convertRectFromBase:
 
(CGRect) - convertRectToBase:
 
(CGSize) - convertSize:fromView:
 
(CGSize) - convertSize:toView:
 
(id) - currentValueForThemeAttribute:
 
(void) - didAddSubview:
 
(void) - display
 
(void) - displayIfNeeded
 
(void) - displayIfNeededInRect:
 
(void) - displayRect:
 
(void) - displayRectIgnoringOpacity:inContext:
 
(void) - dragImage:at:offset:event:pasteboard:source:slideBack:
 
(void) - dragView:at:offset:event:pasteboard:source:slideBack:
 
(void) - drawRect:
 
(CPMenuItem- enclosingMenuItem
 
(CPScrollView- enclosingScrollView
 
(BOOL) - enterFullScreenMode
 
(BOOL) - enterFullScreenMode:withOptions:
 
(CPView- ephemeralSubviewNamed:
 
(void) - exitFullScreenMode
 
(void) - exitFullScreenModeWithOptions:
 
(CGRect) - frame
 
(CGPoint) - frameOrigin
 
(CGSize) - frameSize
 
(BOOL) - hasThemeAttribute:
 
(BOOL) - hasThemeState:
 
(CPView- hitTest:
 
(BOOL) - hitTests
 
(id) - init
 
(BOOL) - inLiveResize
 
(BOOL) - isDescendantOf:
 
(BOOL) - isFlipped
 
(BOOL) - isHidden
 
(BOOL) - isHiddenOrHasHiddenAncestor
 
(BOOL) - isInFullScreenMode
 
(BOOL) - isOpaque
 
(CALayer- layer
 
(CPView- layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:
 
(void) - layoutIfNeeded
 
(void) - lockFocus
 
(CPMenu- menuForEvent:
 
(BOOL) - mouseDownCanMoveWindow
 
(BOOL) - needsDisplay
 
(BOOL) - needsPanelToBecomeKey
 
(CPView- nextKeyView
 
(CPView- nextValidKeyView
 
(BOOL) - postsBoundsChangedNotifications
 
(BOOL) - postsFrameChangedNotifications
 
(CPView- previousKeyView
 
(CPView- previousValidKeyView
 
(void) - reflectScrolledClipView:
 
(CPArray- registeredDraggedTypes
 
(void) - registerForDraggedTypes:
 
(void) - registerThemeValues:
 
(void) - registerThemeValues:inherit:
 
(void) - removeFromSuperview
 
(void) - replaceSubview:with:
 
(void) - resizeSubviewsWithOldSize:
 
(void) - resizeWithOldSuperviewSize:
 
(void) - rightMouseDown:
 
(void) - scrollClipView:toPoint:
 
(void) - scrollPoint:
 
(void) - scrollRect:by:
 
(BOOL) - scrollRectToVisible:
 
(void) - setAlphaValue:
 
(void) - setAutoresizesSubviews:
 
(void) - setAutoresizingMask:
 
(void) - setBackgroundColor:
 
(void) - setBounds:
 
(void) - setBoundsOrigin:
 
(void) - setBoundsSize:
 
(void) - setCenter:
 
(void) - setClipsToBounds:
 
(void) - setFrame:
 
(void) - setFrameOrigin:
 
(void) - setFrameSize:
 
(void) - setHidden:
 
(void) - setHitTests:
 
(void) - setLayer:
 
(void) - setNeedsDisplay:
 
(void) - setNeedsDisplayInRect:
 
(void) - setNeedsLayout
 
(void) - setNextKeyView:
 
(void) - setPostsBoundsChangedNotifications:
 
(void) - setPostsFrameChangedNotifications:
 
(void) - setSubviews:
 
(void) - setTag:
 
(void) - setTheme:
 
(void) - setThemeClass:
 
(BOOL) - setThemeState:
 
(void) - setToolTip:
 
(void) - setValue:forThemeAttribute:
 
(void) - setValue:forThemeAttribute:inState:
 
(void) - setWantsLayer:
 
(CPArray- subviews
 
(CPView- superview
 
(CPInteger) - tag
 
(CPTheme- theme
 
(CPString- themeClass
 
(unsigned) - themeState
 
(CPString- toolTip
 
(void) - unlockFocus
 
(void) - unregisterDraggedTypes
 
(BOOL) - unsetThemeState:
 
(id) - valueForThemeAttribute:
 
(id) - valueForThemeAttribute:inState:
 
(void) - viewDidChangeTheme
 
(void) - viewDidEndLiveResize
 
(void) - viewDidHide
 
(void) - viewDidMoveToSuperview
 
(void) - viewDidMoveToWindow
 
(void) - viewDidUnhide
 
(void) - viewWillDraw
 
(void) - viewWillMoveToSuperview:
 
(void) - viewWillStartLiveResize
 
(CPView- viewWithTag:
 
(CGRect) - visibleRect
 
(BOOL) - wantsLayer
 
(void) - willRemoveSubview:
 
(CPWindow- window
 
- Instance Methods inherited from CPResponder
(BOOL) - acceptsFirstResponder
 
(BOOL) - becomeFirstResponder
 
(void) - doCommandBySelector:
 
(void) - flagsChanged:
 
(void) - insertBackTab:
 
(void) - insertLineBreak:
 
(void) - insertNewline:
 
(void) - insertTab:
 
(void) - insertText:
 
(void) - interpretKeyEvents:
 
(void) - keyDown:
 
(void) - keyUp:
 
(CPMenu- menu
 
(void) - mouseDragged:
 
(void) - mouseMoved:
 
(void) - mouseUp:
 
(CPResponder- nextResponder
 
(void) - noResponderFor:
 
(BOOL) - resignFirstResponder
 
(void) - rightMouseUp:
 
(void) - scrollWheel:
 
(void) - setMenu:
 
(void) - setNextResponder:
 
(BOOL) - tryToPerform:with:
 
(CPUndoManager- undoManager
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPString- description
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray- exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Class Methods

(id) + buttonWithTitle:
 
(id) + buttonWithTitle:theme:
 
(CPString+ defaultThemeClass
 
(id) + themeAttributes
 
- Class Methods inherited from CPControl
(void) + initialize
 
- Class Methods inherited from CPView
(CPMenu+ defaultMenu
 
(CPSet+ keyPathsForValuesAffectingBounds
 
(CPSet+ keyPathsForValuesAffectingFrame
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(Class) + class
 
(void) + exposeBinding:
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isSubclassOfClass:
 
(CPSet+ keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Additional Inherited Members

- Instance Variables inherited from CPObject
Class isa
 

Detailed Description

CPButton is a subclass of CPControl that intercepts mouse-down events and sends an action message to a target object when it's clicked or pressed.

Definition at line 2 of file CPButton.h.

Method Documentation

- (BOOL) allowsMixedState
implementation

Returns a Boolean value indicating whether the button allows a mixed state.

Returns
YES if the button has a 'mixed' state in addition to on and off.

Definition at line 187 of file CPButton.j.

- (CPImage) alternateImage
implementation

Returns the image used when the button is in an alternate state.

Reimplemented in CPRadio, and CPCheckBox.

Definition at line 368 of file CPButton.j.

- (CPString) alternateTitle
implementation

Definition at line 341 of file CPButton.j.

- (CGRect) bezelRectForBounds: (CGRect)  bounds
implementation

Definition at line 579 of file CPButton.j.

- (unsigned) bezelStyle
implementation

Provided by category CPButton(NS).

Definition at line 880 of file CPButton.j.

+ (id) buttonWithTitle: (CPString aTitle
implementation

Definition at line 115 of file CPButton.j.

+ (id) buttonWithTitle: (CPString aTitle
theme: (CPTheme aTheme 
implementation

Definition at line 120 of file CPButton.j.

- (CGRect) contentRectForBounds: (CGRect)  bounds
implementation

Definition at line 572 of file CPButton.j.

- (CPView) createEphemeralSubviewNamed: (CPString aName
implementation

Reimplemented from CPView.

Definition at line 643 of file CPButton.j.

+ (CPString) defaultThemeClass
implementation

Reimplemented from CPView.

Reimplemented in CPRadio, CPPopUpButton, and CPCheckBox.

Definition at line 131 of file CPButton.j.

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Archives this button into the provided coder.

Parameters
aCoderthe coder to which the button's instance data will be written.

Reimplemented from CPControl.

Reimplemented in CPRadio.

Provided by category CPButton(CPCoding).

Definition at line 961 of file CPButton.j.

- (CPInteger) highlightsBy
implementation

Definition at line 421 of file CPButton.j.

- (CPImage) image
implementation

Reimplemented in CPRadio, and CPCheckBox.

Definition at line 351 of file CPButton.j.

- (BOOL) imageDimsWhenDisabled
implementation

Definition at line 483 of file CPButton.j.

- (float) imageOffset
implementation

Definition at line 378 of file CPButton.j.

- (id) initWithCoder: (CPCoder aCoder
implementation

Initializes the button by unarchiving data from aCoder.

Parameters
aCoderthe coder containing the archived CPButton.

Reimplemented from CPControl.

Reimplemented in CPRadio, and CPPopUpButton.

Provided by category CPButton(CPCoding).

Definition at line 909 of file CPButton.j.

- (id) initWithFrame: (CGRect)  aFrame
implementation

Initializes and returns a newly allocated CPButton object with a specified frame rectangle.

Parameters
aFrameThe frame rectangle for the created button object.
Returns
An initialized CPView object or nil if the object couldn't be created.

Reimplemented from CPControl.

Reimplemented in CPRadio, CPDisclosureButton, CPPopUpButton, and CPCheckBox.

Definition at line 147 of file CPButton.j.

- (void) invalidateTimers
implementation

Definition at line 557 of file CPButton.j.

- (BOOL) isBordered
implementation

Definition at line 739 of file CPButton.j.

- (CPString) keyEquivalent
implementation

Returns the keyboard shortcut for this button.

Definition at line 779 of file CPButton.j.

- (unsigned) keyEquivalentModifierMask
implementation

Sets the mask to be used with this button's key equivalent.

Definition at line 795 of file CPButton.j.

- (void) layoutSubviews
implementation

Reimplemented from CPView.

Definition at line 657 of file CPButton.j.

- (void) mouseDown: (CPEvent anEvent
implementation

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

Parameters
anEventcontains information about the click

Reimplemented from CPControl.

Reimplemented in CPPopUpButton.

Definition at line 494 of file CPButton.j.

- (CPInteger) nextState
implementation

Returns the button's next state.

Returns
The button's state. A button can have two or three states. If it has two, this value is either CPOffState (the normal or unpressed state) or CPOnState (the alternate or pressed state). If it has three, this value can be CPOnState (the feature is in effect everywhere), CPOffState (the feature is in effect nowhere), or CPMixedState (the feature is in effect somewhere).

Reimplemented from CPControl.

Reimplemented in CPRadio.

Definition at line 261 of file CPButton.j.

- (void) onContinousEvent: (CPTimer aTimer
implementation

Definition at line 510 of file CPButton.j.

- (void) performClick: (id)  sender
implementation

Perform a click on the receiver.

Parameters
sender- The sender object

Reimplemented from CPControl.

Definition at line 823 of file CPButton.j.

- (BOOL) performKeyEquivalent: (CPEvent anEvent
implementation

Checks the button's key equivalent against that in the event, and if they match simulates a button click.

Reimplemented from CPView.

Definition at line 804 of file CPButton.j.

- (CGRect) rectForEphemeralSubviewNamed: (CPString aName
implementation

Reimplemented from CPView.

Definition at line 632 of file CPButton.j.

- (void) setAllowsMixedState: (BOOL)  aFlag
implementation

Sets whether the button can have a 'mixed' state.

Parameters
aFlagspecifies whether a 'mixed' state is allowed or not

Definition at line 196 of file CPButton.j.

- (void) setAlternateImage: (CPImage anImage
implementation

Sets the button's image which is used in its alternate state.

Parameters
anImagethe image to be used while the button is in an alternate state

Definition at line 360 of file CPButton.j.

- (void) setAlternateTitle: (CPString aTitle
implementation

Definition at line 330 of file CPButton.j.

- (void) setBezelStyle: (unsigned)  aBezelStyle
implementation

Provided by category CPButton(NS).

Definition at line 863 of file CPButton.j.

- (void) setBordered: (BOOL)  shouldBeBordered
implementation

Definition at line 731 of file CPButton.j.

- (void) setButtonType: (CPButtonType)  aButtonType
implementation

Definition at line 426 of file CPButton.j.

- (void) setHighlightsBy: (CPInteger)  aMask
implementation

Definition at line 407 of file CPButton.j.

- (void) setImage: (CPImage anImage
implementation

Reimplemented in CPPopUpButton.

Definition at line 346 of file CPButton.j.

- (void) setImageDimsWhenDisabled: (BOOL)  imageShouldDimWhenDisabled
implementation

Definition at line 467 of file CPButton.j.

- (void) setImageOffset: (float)  theImageOffset
implementation

Definition at line 373 of file CPButton.j.

- (void) setKeyEquivalent: (CPString aString
implementation

Sets the keyboard shortcut for this button. For special keys see CPEvent.j CP...FunctionKey and CPText.j CP...Character.

Parameters
aStringthe keyboard shortcut as a string

Definition at line 750 of file CPButton.j.

- (void) setKeyEquivalentModifierMask: (unsigned)  aMask
implementation

Returns the mask used with this button's key equivalent.

Definition at line 787 of file CPButton.j.

- (void) setNextState
implementation

Sets the button's next state to aState.

Parameters
aStatePossible states are any of the CPButton globals: CPOffState, CPOnState, CPMixedState

Definition at line 278 of file CPButton.j.

- (void) setObjectValue: (id)  anObjectValue
implementation

Sets the value of the button using an Objective-J object.

Parameters
anObjectValueThe value of the button interpreted as an Objective-J object.

Reimplemented from CPControl.

Reimplemented in CPRadio.

Definition at line 213 of file CPButton.j.

- (void) setPeriodicDelay: (float)  aDelay
interval: (float)  anInterval 
implementation

Definition at line 488 of file CPButton.j.

- (void) setShowsStateBy: (CPInteger)  aMask
implementation

Definition at line 383 of file CPButton.j.

- (void) setState: (CPInteger)  aState
implementation

Sets the button's state to aState.

Parameters
aStatePossible states are any of the CPButton globals: CPOffState, CPOnState, CPMixedState

Definition at line 291 of file CPButton.j.

- (void) setTitle: (CPString aTitle
implementation

Sets the title displayed by the button when in its normal state.

Parameters
aTitleThe string to set as the button's title. This title is always shown on buttons that don’t use their alternate contents when highlighting or displaying their alternate state.

Reimplemented in CPPopUpButton.

Definition at line 309 of file CPButton.j.

- (CPInteger) showsStateBy
implementation

Definition at line 402 of file CPButton.j.

- (void) sizeToFit
implementation

Adjust the size of the button to fit the title and surrounding button image.

Definition at line 622 of file CPButton.j.

- (BOOL) startTrackingAt: (CGPoint)  aPoint
implementation

Reimplemented from CPControl.

Reimplemented in CPRadio, and CPCheckBox.

Definition at line 516 of file CPButton.j.

- (CPInteger) state
implementation

Returns the button's current state

Definition at line 299 of file CPButton.j.

- (void) stopTracking: (CGPoint)  lastPoint
at: (CGPoint)  aPoint
mouseIsUp: (BOOL)  mouseIsUp 
implementation

Reimplemented from CPControl.

Definition at line 538 of file CPButton.j.

+ (id) themeAttributes
implementation

Reimplemented from CPControl.

Definition at line 136 of file CPButton.j.

- (CPString) title
implementation

Returns the title displayed on the button when it’s in its normal state.

Returns
The title displayed on the receiver when it’s in its normal state or the empty string if the button doesn’t display a title.

Definition at line 325 of file CPButton.j.

- (void) viewWillMoveToWindow: (CPWindow aWindow
implementation

Called when the receiver is about to be moved to a new window.

Parameters
aWindowthe window to which the receiver will be moved.

Reimplemented from CPView.

Definition at line 762 of file CPButton.j.


The documentation for this class was generated from the following files: