API 0.9.5
CPButton Class Reference

#import <CPButton.h>

Inheritance diagram for CPButton:

List of all members.

Instance Methods

(BOOL) - allowsMixedState
(CPImage- alternateImage
(CPString- alternateTitle
(CGRect) - bezelRectForBounds:
(unsigned) - bezelStyle
(CGRect) - contentRectForBounds:
(CPView- createEphemeralSubviewNamed:
(void) - encodeWithCoder:
(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:
(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:

Class Methods

(id) + buttonWithTitle:
(id) + buttonWithTitle:theme:
(CPString+ defaultThemeClass
(id) + themeAttributes

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

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

- (CPImage) alternateImage

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

Definition at line 356 of file CPButton.j.

- (CPString) alternateTitle

Definition at line 329 of file CPButton.j.

- (CGRect) bezelRectForBounds: (CGRect)  bounds

Definition at line 540 of file CPButton.j.

- (unsigned) bezelStyle

Definition at line 764 of file CPButton.j.

+ (id) buttonWithTitle: (CPString aTitle

Definition at line 112 of file CPButton.j.

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

Definition at line 117 of file CPButton.j.

- (CGRect) contentRectForBounds: (CGRect)  bounds

Definition at line 524 of file CPButton.j.

- (CPView) createEphemeralSubviewNamed: (CPString aName

Reimplemented from CPView.

Definition at line 612 of file CPButton.j.

+ (CPString) defaultThemeClass

Reimplemented from CPView.

Reimplemented in CPCheckBox, CPPopUpButton, and CPRadio.

Definition at line 128 of file CPButton.j.

- (void) encodeWithCoder: (CPCoder aCoder

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.

Definition at line 832 of file CPButton.j.

- (CPImage) image

Definition at line 339 of file CPButton.j.

- (BOOL) imageDimsWhenDisabled

Definition at line 458 of file CPButton.j.

- (float) imageOffset

Definition at line 366 of file CPButton.j.

- (id) initWithCoder: (CPCoder aCoder

Initializes the button by unarchiving data from aCoder.

Parameters:
aCoderthe coder containing the archived CPButton.

Reimplemented from CPControl.

Reimplemented in CPPopUpButton, and CPRadio.

Definition at line 791 of file CPButton.j.

- (id) initWithFrame: (CGRect)  aFrame

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 CPCheckBox, CPPopUpButton, and CPRadio.

Definition at line 144 of file CPButton.j.

- (void) invalidateTimers

Definition at line 509 of file CPButton.j.

- (BOOL) isBordered

Definition at line 665 of file CPButton.j.

- (CPString) keyEquivalent

Returns the keyboard shortcut for this button.

Definition at line 705 of file CPButton.j.

- (unsigned) keyEquivalentModifierMask

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

Definition at line 721 of file CPButton.j.

- (void) layoutSubviews

Reimplemented from CPView.

Definition at line 626 of file CPButton.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 from CPControl.

Reimplemented in CPPopUpButton.

Definition at line 469 of file CPButton.j.

- (CPInteger) nextState

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

- (void) onContinousEvent: (CPTimer aTimer

Definition at line 485 of file CPButton.j.

- (BOOL) performKeyEquivalent: (CPEvent anEvent

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

- (CGRect) rectForEphemeralSubviewNamed: (CPString aName

Reimplemented from CPView.

Definition at line 601 of file CPButton.j.

- (void) setAllowsMixedState: (BOOL)  aFlag

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

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

Definition at line 191 of file CPButton.j.

- (void) setAlternateImage: (CPImage anImage

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

- (void) setAlternateTitle: (CPString aTitle

Definition at line 318 of file CPButton.j.

- (void) setBezelStyle: (unsigned)  aBezelStyle

Definition at line 747 of file CPButton.j.

- (void) setBordered: (BOOL)  shouldBeBordered

Definition at line 657 of file CPButton.j.

- (void) setButtonType: (CPButtonType)  aButtonType

Definition at line 401 of file CPButton.j.

- (void) setHighlightsBy: (CPInteger)  aMask

Definition at line 387 of file CPButton.j.

- (void) setImage: (CPImage anImage

Reimplemented in CPPopUpButton.

Definition at line 334 of file CPButton.j.

- (void) setImageDimsWhenDisabled: (BOOL)  imageShouldDimWhenDisabled

Definition at line 442 of file CPButton.j.

- (void) setImageOffset: (float)  theImageOffset

Definition at line 361 of file CPButton.j.

- (void) setKeyEquivalent: (CPString aString

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

- (void) setKeyEquivalentModifierMask: (unsigned)  aMask

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

Definition at line 713 of file CPButton.j.

- (void) setNextState

Sets the button's next state to aState.

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

Definition at line 266 of file CPButton.j.

- (void) setObjectValue: (id)  anObjectValue

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

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

Definition at line 463 of file CPButton.j.

- (void) setShowsStateBy: (CPInteger)  aMask

Definition at line 371 of file CPButton.j.

- (void) setState: (CPInteger)  aState

Sets the button's state to aState.

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

Definition at line 279 of file CPButton.j.

- (void) setTitle: (CPString aTitle

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

- (CPInteger) showsStateBy

Definition at line 382 of file CPButton.j.

- (void) sizeToFit

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

Definition at line 591 of file CPButton.j.

- (BOOL) startTrackingAt: (CGPoint)  aPoint

Reimplemented from CPControl.

Definition at line 491 of file CPButton.j.

- (CPInteger) state

Returns the button's current state

Definition at line 287 of file CPButton.j.

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

Reimplemented from CPControl.

Definition at line 498 of file CPButton.j.

+ (id) themeAttributes

Reimplemented from CPControl.

Definition at line 133 of file CPButton.j.

- (CPString) title

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

- (void) viewWillMoveToWindow: (CPWindow aWindow

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


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