Class CPToolbar

CPObject
    extended byCPToolbar

@implementation CPToolbar : CPObject

A CPToolbar is displayed at the top of a window with multiple buttons (tools) that offer the user quick access to features.


Method Summary
-(id)initWithIdentifier:(CPString)anIdentifier
          Initializes the toolbar with the specified identifier.
-(id)delegate
          Returns the toolbar's delegate.
-(CPString)identifier
          Returns the toolbar's identifier.
-(int)indexOfItem:(CPToolbarItem)anItem
          Returns the index of the specified toolbar item.
-(BOOL)isVisible
          Returns YES if the toolbar is currently visible.
-(CPArray)items
          Returns all the items in this toolbar.
-(CPArray)itemsSortedByVisibilityPriority
          Returns the toolbar items sorted by their visibilityPriority(ies).
-(void)setDelegate:(id)aDelegate
          Sets the delegate for the toolbar.
-(void)setDisplayMode:(CPToolbarDisplayMode)aDisplayMode
          Sets the toolbar's display mode.
-(void)setVisible:(BOOL)aFlag
          Sets whether the toolbar should be visible.
-(CPArray)visibleItems
          Returns all the visible items in this toolbar.

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

Delegate Method Summary
-(CPArray)toolbarDefaultItemIdentifiers:(CPToolbar)toolbar
          Called to obtain the toolbar's default item identifiers.
-(CPArray)toolbarAllowedItemIdentifiers:(CPToolbar)toolbar
          Called to obtain the toolbar's default item identifiers.
-(CPToolbarItem)toolbar:(CPToolbar)toolbar itemForItemIdentifier:(CPString)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag
          Called to obtain a toolbar item.


Method Detail

initWithIdentifier

-(id)initWithIdentifier:(CPString)anIdentifier
Initializes the toolbar with the specified identifier.
Parameters:
anIdentifier - the identifier for the toolbar
Returns:
the initialized toolbar

delegate

-(id)delegate
Returns the toolbar's delegate

identifier

-(CPString)identifier
Returns the toolbar's identifier

indexOfItem

-(int)indexOfItem:(CPToolbarItem)anItem
Returns the index of the specified toolbar item
Parameters:
anItem - the item to obtain the index for

isVisible

-(BOOL)isVisible
Returns YES if the toolbar is currently visible

items

-(CPArray)items
Returns all the items in this toolbar.

itemsSortedByVisibilityPriority

-(CPArray)itemsSortedByVisibilityPriority
Returns the toolbar items sorted by their visibilityPriority(ies).

setDelegate

-(void)setDelegate:(id)aDelegate
Sets the delegate for the toolbar.
Parameters:
aDelegate - the new toolbar delegate

setDisplayMode

-(void)setDisplayMode:(CPToolbarDisplayMode)aDisplayMode
Sets the toolbar's display mode. NOT YET IMPLEMENTED.
Parameters:
aDisplayMode

setVisible

-(void)setVisible:(BOOL)aFlag
Sets whether the toolbar should be visible.
Parameters:
aFlag - YES makes the toolbar visible

visibleItems

-(CPArray)visibleItems
Returns all the visible items in this toolbar

Delegate Method Detail

toolbarDefaultItemIdentifiers

-(CPArray)toolbarDefaultItemIdentifiers:(CPToolbar)toolbar
Called to obtain the toolbar's default item identifiers. Required.
Parameters:
toolbar - the toolbar to obtain identifiers for
Returns:
an array of default item identifiers in the order on the toolbar

toolbarAllowedItemIdentifiers

-(CPArray)toolbarAllowedItemIdentifiers:(CPToolbar)toolbar
Called to obtain the toolbar's default item identifiers. Required.
Parameters:
toolbar - the toolbar to obtain identifiers for
Returns:
an array of default item identifiers in the order on the toolbar

toolbar

-(CPToolbarItem)toolbar:(CPToolbar)toolbar itemForItemIdentifier:(CPString)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag
Called to obtain a toolbar item. Required.
Parameters:
toolbar - the toolbar the item belongs to
itemIdentifier - the identifier of the toolbar item
flag - YES means the item will be placed in the toolbar. NO means the item will be displayed for some other purpose (non-functional)
Returns:
the toolbar item or nil if no such item belongs in the toolbar

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