![]() |
API 0.9.5
|
#import <CPColorWell.h>
Instance Methods | |
(void) | - activate: |
(CPColor) | - color |
(void) | - colorPanelDidChangeColor: |
(void) | - colorPanelWillClose: |
(void) | - colorWellDidBecomeExclusive: |
(void) | - deactivate |
(void) | - drawBezelWithHighlight: |
(void) | - drawWellInside: |
(void) | - encodeWithCoder: |
(id) | - initWithCoder: |
(id) | - initWithFrame: |
(BOOL) | - isActive |
(BOOL) | - isBordered |
(void) | - mouseDown: |
(void) | - mouseDragged: |
(void) | - mouseUp: |
(void) | - setBordered: |
(void) | - setColor: |
(void) | - takeColorFrom: |
CPColorWell is a CPControl for selecting and displaying a single color value. An example of a CPColorWell object (or simply color well) is found in CPColorPanel, which uses a color well to display the current color selection.
An application can have one or more active CPColorWells. You can activate multiple CPColorWells by invoking the -activate
: method with NO
as its argument. When a mouse-down event occurs on an CPColorWell's border, it becomes the only active color well. When a color well becomes active, it brings up the color panel also.
Definition at line 2 of file CPColorWell.h.
- (void) activate: | (BOOL) | shouldBeExclusive |
Activates the color well, displays the color panel, and makes the panel's current color the same as its own. If exclusive is YES
, deactivates any other CPColorWells. NO
, keeps them active.
shouldBeExclusive | whether other color wells should be deactivated. |
Definition at line 140 of file CPColorWell.j.
- (CPColor) color |
Returns the color well's current color.
Definition at line 107 of file CPColorWell.j.
- (void) colorPanelDidChangeColor: | (CPNotification) | aNotification |
Definition at line 210 of file CPColorWell.j.
- (void) colorPanelWillClose: | (CPNotification) | aNotification |
Definition at line 223 of file CPColorWell.j.
- (void) colorWellDidBecomeExclusive: | (CPNotification) | aNotification |
Definition at line 217 of file CPColorWell.j.
- (void) deactivate |
Deactivates the color well.
Definition at line 164 of file CPColorWell.j.
- (void) drawBezelWithHighlight: | (BOOL) | shouldHighlight |
Definition at line 187 of file CPColorWell.j.
- (void) drawWellInside: | (CGRect) | aRect |
Draws the colored area inside the color well without borders.
aRect | the location at which to draw |
Definition at line 195 of file CPColorWell.j.
- (void) encodeWithCoder: | (CPCoder) | aCoder |
Archives this button into the provided coder.
aCoder | the coder to which the color well's instance data will be written. |
Reimplemented from CPControl.
Definition at line 293 of file CPColorWell.j.
- (id) initWithCoder: | (CPCoder) | aCoder |
Initializes the color well by unarchiving data from aCoder
.
aCoder | the coder containing the archived CPColorWell. |
Reimplemented from CPControl.
Definition at line 270 of file CPColorWell.j.
- (id) initWithFrame: | (CGRect) | aFrame |
Initializes the receiver for usage with the specified bounding rectangle
Reimplemented from CPControl.
Definition at line 45 of file CPColorWell.j.
- (BOOL) isActive |
Returns YES
if the color well is active.
Definition at line 180 of file CPColorWell.j.
- (BOOL) isBordered |
Returns whether the color well is bordered
Definition at line 84 of file CPColorWell.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.
Definition at line 228 of file CPColorWell.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.
anEvent | contains information about the drag |
Reimplemented from CPResponder.
Definition at line 236 of file CPColorWell.j.
- (void) mouseUp: | (CPEvent) | anEvent |
Notifies the receiver that the user has released the left mouse button.
anEvent | contains information about the release |
Reimplemented from CPResponder.
Definition at line 244 of file CPColorWell.j.
- (void) setBordered: | (BOOL) | bordered |
Sets the color well's current color.
Definition at line 92 of file CPColorWell.j.
- (void) setColor: | (CPColor) | aColor |
Sets the color well's current color.
Definition at line 115 of file CPColorWell.j.
- (void) takeColorFrom: | (id) | aSender |
Changes the color of the well to that of aSender
.
aSender | the object from which to retrieve the color |
Definition at line 129 of file CPColorWell.j.