Class CPColorPanel

CPObject
    extended byCPResponder
        extended byCPWindow
            extended byCPPanel
                extended byCPColorPanel

@implementation CPColorPanel : CPPanel

CPColorPanel provides a reusable panel that can be used displayed on screen to prompt the user for a color selection. To obtain the panel, call the sharedColorPanel method.


Method Summary
+(void)setPickerMode:(CPColorPanelMode)mode
          Returns the shared color panel set to display in mode.
+(CPColorPanel)sharedColorPanel
          Returns (and if necessary, creates) the shared color panel.
-(selector)action
          Returns the current target action.
-(CPColor)color
          Returns the panel's currently selected color.
-(CPColorPanelMode)mode
          Returns the color panel's current display mode.
-(void)orderFront:(id)aSender
          Makes the receiver the front most window in the screen ordering.
-(void)setAction:(selector)anAction
          Sets the action that gets sent to the target.
-(void)setColor:(CPColor)aColor
          Sets the color of the panel, and updates the picker.
-(void)setMode:(CPColorPanelMode)mode
          Sets the mode (look) of the color panel.
-(void)setTarget:(id)aTarget
          Sets the target for the color panel.
-(id)target
          Returns the current target.

Methods inherited from class CPObject
initialize, alloc, class, instanceMethodForSelector, instancesRespondToSelector, isSubclassOfClass, load, new, setVersion, superclass, version, init, autorelease, awakeAfterUsingCoder, class, classForCoder, classForKeyedArchiver, className, copy, dealloc, description, doesNotRecognizeSelector, forwardInvocation, hash, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableCopy, performSelector, performSelector, performSelector, release, replacementObjectForArchiver, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, retain, self, superclass

Methods inherited from class CPResponder
acceptsFirstResponder, becomeFirstResponder, deleteBackward, doCommandBySelector, insertLineBreak, insertText, interpretKeyEvents, keyDown, keyUp, menu, mouseDown, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseUp, nextResponder, noResponderFor, performKeyEquivalent, resignFirstResponder, scrollWheel, setMenu, setNextResponder, tryToPerform, undoManager

Methods inherited from class CPWindow
frameRectForContentRect, initWithContentRect, acceptsFirstResponder, acceptsMouseMovedEvents, attachedSheet, backgroundColor, becomeKeyWindow, becomeMainWindow, canBecomeKeyWindow, canBecomeMainWindow, center, close, contentRectForFrameRect, contentView, delegate, doCommandBySelector, dragImage, dragView, firstResponder, frame, frameRectForContentRect, hasShadow, isDocumentEdited, isDocumentSaving, isKeyWindow, isMainWindow, isMovableByWindowBackground, isSheet, isVisible, level, makeFirstResponder, makeKeyAndOrderFront, makeKeyWindow, makeMainWindow, maxSize, minSize, orderFront, orderOut, orderWindow, performClose, representedFilename, representedURL, resignKeyWindow, resignMainWindow, resizeIndicatorOffset, sendEvent, setAcceptsMouseMovedEvents, setBackgroundColor, setContentView, setDelegate, setDocumentEdited, setDocumentSaving, setFrame, setFrameOrigin, setFrameSize, setFrame, setHasShadow, setLevel, setMaxSize, setMinSize, setMovableByWindowBackground, setRepresentedFilename, setRepresentedURL, setResizeIndicatorOffset, setShowsResizeIndicator, setTitle, setTitleWithRepresentedFilename, setToolbar, setWindowController, showsResizeIndicator, styleMask, title, toolbar, windowController, windowNumber, worksWhenModal

Methods inherited from class CPPanel
becomesKeyOnlyIfNeeded, canBecomeMainWindow, isFloatingPanel, setBecomesKeyOnlyIfNeeded, setFloatingPanel, setWorksWhenModal, worksWhenModal


Method Detail

setPickerMode

+(void)setPickerMode:(CPColorPanelMode)mode
Returns the shared color panel set to display in mode.
Parameters:
mode - the mode to which the color panel will be set before returning

sharedColorPanel

+(CPColorPanel)sharedColorPanel
Returns (and if necessary, creates) the shared color panel.

action

-(selector)action
Returns the current target action.

color

-(CPColor)color
Returns the panel's currently selected color.

mode

-(CPColorPanelMode)mode
Returns the color panel's current display mode.

orderFront

-(void)orderFront:(id)aSender
Makes the receiver the front most window in the screen ordering.
Parameters:
aSender - the object that requested this

setAction

-(void)setAction:(selector)anAction
Sets the action that gets sent to the target. This action is sent whenever a color is selected in the panel.
Parameters:
anAction - the action that will be sent

setColor

-(void)setColor:(CPColor)aColor
Sets the color of the panel, and updates the picker. Also posts a CPColorPanelDidChangeNotification.
Parameters:
aColor

setMode

-(void)setMode:(CPColorPanelMode)mode
Sets the mode (look) of the color panel.
Parameters:
mode - the mode in which to display the color panel

setTarget

-(void)setTarget:(id)aTarget
Sets the target for the color panel. Messages are sent to the target when colors are selected in the panel.
Parameters:
aTarget

target

-(id)target
Returns the current target. The target receives messages when colors are selected in the panel.

Created on Sat Sep 13 14:15:43 PDT 2008