![]() |
API 0.9.5
|
#import <CPButton.h>
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.
- (BOOL) allowsMixedState |
Returns a Boolean value indicating whether the button allows a mixed state.
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.
Definition at line 117 of file CPButton.j.
- (CGRect) contentRectForBounds: | (CGRect) | bounds |
Definition at line 524 of file CPButton.j.
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.
aCoder | the 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
.
aCoder | the 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.
aFrame | The frame rectangle for the created button object. |
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.
anEvent | contains 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.
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.
aFlag | specifies 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.
anImage | the 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.
aString | the 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
.
aState | Possible 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.
anObjectValue | The 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
.
aState | Possible 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.
aTitle | The 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.
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.
aWindow | the window to which the receiver will be moved. |
Reimplemented from CPView.
Definition at line 688 of file CPButton.j.