API  0.9.7
 All Classes Files Functions Variables Macros Groups 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
(BOOL) - acceptsFirstMouse:
 
(SEL) - action
 
(CPTextAlignment) - alignment
 
(BOOL) - continueTracking:at:
 
(double) - doubleValue
 
(float) - floatValue
 
(CPFont- font
 
(CPFormatter- formatter
 
(void) - highlight:
 
(CPCellImagePosition) - imagePosition
 
(CPUInteger) - 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) - 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
 

Class Methods

(id) + buttonWithTitle:
 
(id) + buttonWithTitle:theme:
 
(CPString+ defaultThemeClass
 
(CPDictionary+ themeAttributes
 
- Class Methods inherited from CPControl
(void) + initialize
 

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 202 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 383 of file CPButton.j.

- (CPString) alternateTitle
implementation

Definition at line 356 of file CPButton.j.

- (CGRect) bezelRectForBounds: (CGRect)  bounds
implementation

Definition at line 605 of file CPButton.j.

- (unsigned) bezelStyle
implementation

Provided by category CPButton(NS).

Definition at line 906 of file CPButton.j.

+ (id) buttonWithTitle: (CPString aTitle
implementation

Definition at line 125 of file CPButton.j.

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

Definition at line 130 of file CPButton.j.

- (CGRect) contentRectForBounds: (CGRect)  bounds
implementation

Definition at line 598 of file CPButton.j.

- (CPView) createEphemeralSubviewNamed: (CPString aName
implementation

Definition at line 669 of file CPButton.j.

+ (CPString) defaultThemeClass
implementation

Reimplemented in CPRadio, CPPopUpButton, and CPCheckBox.

Definition at line 141 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 987 of file CPButton.j.

- (CPInteger) highlightsBy
implementation

Definition at line 436 of file CPButton.j.

- (CPImage) image
implementation

Reimplemented in CPRadio, and CPCheckBox.

Definition at line 366 of file CPButton.j.

- (BOOL) imageDimsWhenDisabled
implementation

Definition at line 507 of file CPButton.j.

- (float) imageOffset
implementation

Definition at line 393 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 935 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 162 of file CPButton.j.

- (void) invalidateTimers
implementation

Definition at line 583 of file CPButton.j.

- (BOOL) isBordered
implementation

Definition at line 765 of file CPButton.j.

- (CPString) keyEquivalent
implementation

Returns the keyboard shortcut for this button.

Definition at line 805 of file CPButton.j.

- (unsigned) keyEquivalentModifierMask
implementation

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

Definition at line 821 of file CPButton.j.

- (void) layoutSubviews
implementation

Definition at line 683 of file CPButton.j.

- (void) mouseDown: (CPEvent anEvent
implementation

Reimplemented from CPControl.

Reimplemented in CPPopUpButton.

Definition at line 518 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 276 of file CPButton.j.

- (void) onContinousEvent: (CPTimer aTimer
implementation

Definition at line 534 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 849 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.

Definition at line 830 of file CPButton.j.

- (CGRect) rectForEphemeralSubviewNamed: (CPString aName
implementation

Definition at line 658 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 211 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 375 of file CPButton.j.

- (void) setAlternateTitle: (CPString aTitle
implementation

Definition at line 345 of file CPButton.j.

- (void) setBezelStyle: (unsigned)  aBezelStyle
implementation

Provided by category CPButton(NS).

Definition at line 889 of file CPButton.j.

- (void) setBordered: (BOOL)  shouldBeBordered
implementation

Definition at line 757 of file CPButton.j.

- (void) setButtonType: (CPButtonType)  aButtonType
implementation

Definition at line 441 of file CPButton.j.

- (void) setHighlightsBy: (CPInteger)  aMask
implementation

Definition at line 422 of file CPButton.j.

- (void) setImage: (CPImage anImage
implementation

Reimplemented in CPPopUpButton.

Definition at line 361 of file CPButton.j.

- (void) setImageDimsWhenDisabled: (BOOL)  imageShouldDimWhenDisabled
implementation

Definition at line 491 of file CPButton.j.

- (void) setImageOffset: (float)  theImageOffset
implementation

Definition at line 388 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 776 of file CPButton.j.

- (void) setKeyEquivalentModifierMask: (unsigned)  aMask
implementation

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

Definition at line 813 of file CPButton.j.

- (void) setNextState
implementation

Sets the button's state to the next available state.

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

Definition at line 293 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, and CPPopUpButton.

Definition at line 228 of file CPButton.j.

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

Definition at line 512 of file CPButton.j.

- (void) setShowsStateBy: (CPInteger)  aMask
implementation

Definition at line 398 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

Reimplemented from CPControl.

Reimplemented in CPDisclosureButton.

Definition at line 306 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 324 of file CPButton.j.

- (CPInteger) showsStateBy
implementation

Definition at line 417 of file CPButton.j.

- (void) sizeToFit
implementation

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

Definition at line 648 of file CPButton.j.

- (BOOL) startTrackingAt: (CGPoint)  aPoint
implementation

Reimplemented from CPControl.

Reimplemented in CPRadio, and CPCheckBox.

Definition at line 540 of file CPButton.j.

- (CPInteger) state
implementation

Returns the button's current state

Definition at line 314 of file CPButton.j.

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

Reimplemented from CPControl.

Definition at line 564 of file CPButton.j.

+ (CPDictionary) themeAttributes
implementation

Reimplemented from CPControl.

Definition at line 146 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 340 of file CPButton.j.

- (void) viewWillMoveToWindow: (CPWindow aWindow
implementation

Definition at line 788 of file CPButton.j.


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