Class CPToolbarItem

CPObject
    extended byCPToolbarItem

@implementation CPToolbarItem : CPObject

A representation of an item in a CPToolbar.


Global Variables
CPToolbarItemVisibilityPriorityStandard = 0
        
CPToolbarItemVisibilityPriorityUser = 2000
        
CPToolbarItemVisibilityPriorityLow = -1000
        
CPToolbarItemVisibilityPriorityHigh = 1000
        

Method Summary
-(id)initWithItemIdentifier:(CPString)anItemIdentifier
          Initializes the toolbar item with a specified identifier.
-(SEL)action
          Returns the action that is triggered when the user clicks this item.
-(CPImage)alternateImage
          Returns the alternate image.
-(id)copy
          Makes a deep copy of the receiver.
-(CPImage)image
          Returns the item's image.
-(BOOL)isEnabled
          Returns YES if the item is enabled.
-(CPString)itemIdentifier
          Returns the item's identifier.
-(CPString)label
          Returns the item's label.
-(CGSize)maxSize
          Returns the item's maximum size.
-(CGSize)minSize
          Returns the item's minimum size.
-(CPString)paletteLabel
          Returns the palette label.
-(void)setAction:(SEL)anAction
          Sets the action that is triggered when the user clicks this item.
-(void)setAlternateImage:(CPImage)anImage
          Sets the alternate image.
-(void)setEnabled:(BOOL)aFlag
          Sets whether the item is enabled.
-(void)setImage:(CPImage)anImage
          Sets the item's image.
-(void)setLabel:(CPString)aLabel
          Sets the item's label.
-(void)setMaxSize:(CGSize)aMaxSize
          Sets the item's new maximum size.
-(void)setMinSize:(CGSize)aMinSize
          Sets the item's minimum size.
-(void)setPaletteLabel:(CPString)aPaletteLabel
          Sets the palette label.
-(void)setTag:(int)aTag
          Sets the item's tag.
-(void)setTarget:(id)aTarget
          Sets the target of the action that is triggered when the user clicks this item.
-(void)setToolTip:(CPString)aToolTip
          Sets the item's tooltip.
-(void)setView:(CPView)aView
          Sets the item's view.
-(void)setVisibilityPriority:(int)aVisibilityPriority
          Sets the item's visibility priority.
-(int)tag
          Returns the item's tag.
-(id)target
          Returns the item's action target.
-(CPString)toolTip
          Returns the item's tooltip.
-(CPToolbar)toolbar
          Returns the toolbar of which this item is a part.
-(CPView)view
          Returns the item's view.
-(int)visibilityPriority
          Returns the item's visibility priority.

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


Method Detail

initWithItemIdentifier

-(id)initWithItemIdentifier:(CPString)anItemIdentifier
Initializes the toolbar item with a specified identifier.
Parameters:
anItemIdentifier - the item's identifier
Returns:
the initialized toolbar item

action

-(SEL)action
Returns the action that is triggered when the user clicks this item.

alternateImage

-(CPImage)alternateImage
Returns the alternate image. This image is displayed on the item when the user is clicking it.

copy

-(id)copy
Makes a deep copy of the receiver. The copy should be functionally equivalent to the receiver.
Returns:
the copy of the receiver

image

-(CPImage)image
Returns the item's image

isEnabled

-(BOOL)isEnabled
Returns YES if the item is enabled.

itemIdentifier

-(CPString)itemIdentifier
Returns the item's identifier.

label

-(CPString)label
Returns the item's label

maxSize

-(CGSize)maxSize
Returns the item's maximum size.

minSize

-(CGSize)minSize
Returns the item's minimum size.

paletteLabel

-(CPString)paletteLabel
Returns the palette label.

setAction

-(void)setAction:(SEL)anAction
Sets the action that is triggered when the user clicks this item.
Parameters:
anAction - the new action

setAlternateImage

-(void)setAlternateImage:(CPImage)anImage
Sets the alternate image. This image is displayed on the item when the user is clicking it.
Parameters:
anImage - the new alternate image

setEnabled

-(void)setEnabled:(BOOL)aFlag
Sets whether the item is enabled.
Parameters:
aFlag - YES enables the item

setImage

-(void)setImage:(CPImage)anImage
Sets the item's image.
Parameters:
anImage - the new item image

setLabel

-(void)setLabel:(CPString)aLabel
Sets the item's label.
Parameters:
aLabel - the new label for the item

setMaxSize

-(void)setMaxSize:(CGSize)aMaxSize
Sets the item's new maximum size.
Parameters:
aMaxSize - the new maximum size

setMinSize

-(void)setMinSize:(CGSize)aMinSize
Sets the item's minimum size.
Parameters:
aMinSize - the new minimum size

setPaletteLabel

-(void)setPaletteLabel:(CPString)aPaletteLabel
Sets the palette label
Parameters:
aPaletteLabel - the new palette label

setTag

-(void)setTag:(int)aTag
Sets the item's tag.
Parameters:
aTag - the new tag for the item

setTarget

-(void)setTarget:(id)aTarget
Sets the target of the action that is triggered when the user clicks this item. nil will cause the action to be passed on to the first responder.
Parameters:
aTarget - the new target

setToolTip

-(void)setToolTip:(CPString)aToolTip
Sets the item's tooltip. A tooltip pops up next to the cursor when the user hovers over the item with the mouse.
Parameters:
aToolTip - the new item tool tip

setView

-(void)setView:(CPView)aView
Sets the item's view
Parameters:
aView - the item's new view

setVisibilityPriority

-(void)setVisibilityPriority:(int)aVisibilityPriority
Sets the item's visibility priority. The value must be one of:
CPToolbarItemVisibilityPriorityStandard
CPToolbarItemVisibilityPriorityLow
CPToolbarItemVisibilityPriorityHigh
CPToolbarItemVisibilityPriorityUser
Parameters:
aVisibilityPriority

tag

-(int)tag
Returns the item's tag.

target

-(id)target
Returns the item's action target.

toolTip

-(CPString)toolTip
Returns the item's tooltip. A tooltip pops up next to the cursor when the user hovers over the item with the mouse.

toolbar

-(CPToolbar)toolbar
Returns the toolbar of which this item is a part.

view

-(CPView)view
Returns the item's view.

visibilityPriority

-(int)visibilityPriority
Returns the item's visibility priority. The value will be one of:
CPToolbarItemVisibilityPriorityStandard
CPToolbarItemVisibilityPriorityLow
CPToolbarItemVisibilityPriorityHigh
CPToolbarItemVisibilityPriorityUser

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