CPObjectCPResponder
CPView
CPControl
CPColorWell
@implementation CPColorWell : CPControl
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 CPColorWell
s. You can activate multiple CPColorWell
s 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.
Method Summary | |
---|---|
-(id) | initWithFrame:(CGRect)aFrame Initializes the receiver for usage with the specified bounding rectangle. |
-(void) | activate:(BOOL)shouldBeExclusive Activates the color well, displays the color panel, and makes the panel's current color the same as its own. |
-(CPColor) | color Returns the color well's current color. |
-(void) | colorPanelDidChangeColor:(CPNotification)aNotification |
-(void) | colorPanelWillClose:(CPNotification)aNotification |
-(void) | colorWellDidBecomeExclusive:(CPNotification)aNotification |
-(void) | deactivate Deactivates the color well. |
-(void) | drawBezelWithHighlight:(BOOL)shouldHighlight |
-(void) | drawWellInside:(CGRect)aRect Draws the colored area inside the color well without borders. |
-(BOOL) | isActive Returns YES if the color well is active. |
-(void) | mouseDown:(CPEvent)anEvent Notifies the receiver that the user has clicked the mouse down in its area. |
-(void) | mouseDragged:(CPEvent)anEvent Notifies the receiver that the user has initiated a drag over it. |
-(void) | mouseUp:(CPEvent)anEvent Notifies the receiver that the user has released the left mouse button. |
-(void) | setColor:(CPColor)aColor Sets the color well's current color. |
-(void) | takeColorFrom:(id)aSender Changes the color of the well to that of aSender . |
Methods inherited from class CPControl |
---|
initWithFrame, action, alignment, backgroundColorForName, floatValue, font, isEnabled, mouseUp, sendAction, setAction, setAlignment, setBackgroundColor, setBackgroundColorWithName, setBackgroundColor, setEnabled, setFloatValue, setFont, setTarget, setTextColor, setTextShadow, target, textColor, textShadow |
Method Detail |
---|
-(id)initWithFrame:(CGRect)aFrame
aFrame
-(void)activate:(BOOL)shouldBeExclusive
YES
, deactivates any other CPColorWell
s. NO
, keeps them active.shouldBeExclusive
- whether other color wells should be deactivated.-(CPColor)color
-(void)colorPanelDidChangeColor:(CPNotification)aNotification
aNotification
-(void)colorPanelWillClose:(CPNotification)aNotification
aNotification
-(void)colorWellDidBecomeExclusive:(CPNotification)aNotification
aNotification
-(void)deactivate
-(void)drawBezelWithHighlight:(BOOL)shouldHighlight
shouldHighlight
-(void)drawWellInside:(CGRect)aRect
aRect
- the location at which to draw-(BOOL)isActive
YES
if the color well is active.-(void)mouseDown:(CPEvent)anEvent
anEvent
- contains information about the click-(void)mouseDragged:(CPEvent)anEvent
anEvent
- contains information about the drag-(void)mouseUp:(CPEvent)anEvent
anEvent
- contains information about the release-(void)setColor:(CPColor)aColor
aColor
-(void)takeColorFrom:(id)aSender
aSender
.aSender
- the object from which to retrieve the colorCreated on Sat Sep 13 14:15:43 PDT 2008