Class CPTabView

CPObject
    extended byCPResponder
        extended byCPView
            extended byCPTabView

@implementation CPTabView : CPView

This class represents a view that has multiple subviews (CPTabViewItem) presented as individual tabs. Only one CPTabViewItem is shown at a time, and other CPTabViewItems can be made visible (one at a time) by clicking on the CPTabViewItem's tab at the top of the tab view. THe currently selected CPTabViewItem is the view that is displayed.


Method Summary
-(id)initWithFrame:(CGRect)aFrame
          Initializes the receiver for usage with the specified bounding rectangle.
-(void)addTabViewItem:(CPTabViewItem)aTabViewItem
          Adds a CPTabViewItem to the tab view.
-(CGRect)contentRect
          Returns the content rectangle.
-(int)indexOfTabViewItem:(CPTabViewItem)aTabViewItem
          Returns the index of the specified item.
-(int)indexOfTabViewItemWithIdentifier:(CPString)anIdentifier
          Returns the index of the CPTabViewItem with the specified identifier.
-(void)insertTabViewItem:(CPTabViewItem)aTabViewItem atIndex:(unsigned)anIndex
          Inserts a CPTabViewItem into the tab view at the specified index.
-(void)mouseDown:(CPEvent)anEvent
          Notifies the receiver that the user has clicked the mouse down in its area.
-(unsigned)numberOfTabViewItems
          Returns the number of items in the tab view.
-(void)removeTabViewItem:(CPTabViewItem)aTabViewItem
          Removes the specified tab view item from the tab view.
-(void)selectFirstTabViewItem:(id)aSender
          Sets the first tab view item in the array to be displayed to the user.
-(void)selectLastTabViewItem:(id)aSender
          Sets the last tab view item in the array to be displayed to the user.
-(void)selectNextTabViewItem:(id)aSender
          Sets the next tab item in the array to be displayed.
-(void)selectPreviousTabViewItem:(id)aSender
          Selects the previous item in the array for display.
-(void)selectTabViewItem:(CPTabViewItem)aTabViewItem
          Displays the specified item in the tab view.
-(void)selectTabViewItemAtIndex:(unsigned)anIndex
          Selects the item at the specified index.
-(CPTabViewItem)selectedTabViewItem
          Returns the current item being displayed.
-(void)setDelegate:(id)aDelegate
          Sets the delegate for this tab view.
-(void)setTabViewType:(CPTabViewType)aTabViewType
          Sets the tab view type.
-(CPTabViewItem)tabViewItemAtIndex:(unsigned)anIndex
          Returns the CPTabViewItem at the specified index.
-(CPArray)tabViewItems
          Returns the array of items that backs this tab view.
-(CPTabViewType)tabViewType
          Returns the tab view type.
-(void)viewDidMoveToWindow
          Called when the receiver has been moved to a new CPWindow.

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 CPView
initWithFrame, acceptsFirstMouse, addSubview, addSubview, adjustScroll, alphaValue, autoresizesSubviews, autoresizingMask, autoscroll, backgroundColor, bounds, convertPoint, convertPoint, convertRect, convertRect, convertSize, convertSize, didAddSubview, display, displayIfNeeded, displayIfNeededInRect, displayRect, displayRectIgnoringOpacity, dragImage, dragView, drawRect, enclosingMenuItem, enclosingScrollView, enterFullScreenMode, exitFullScreenModeWithOptions, frame, hitTest, hitTests, isDescendantOf, isFlipped, isHidden, isHiddenOrHasHiddenAncestor, isInFullScreenMode, isOpaque, lockFocus, mouseDown, mouseDownCanMoveWindow, needsDisplay, postsBoundsChangedNotifications, postsFrameChangedNotifications, reflectScrolledClipView, registerForDraggedTypes, registeredDraggedTypes, removeFromSuperview, replaceSubview, resizeSubviewsWithOldSize, resizeWithOldSuperviewSize, scrollClipView, scrollPoint, scrollRectToVisible, scrollRect, setAlphaValue, setAutoresizesSubviews, setAutoresizingMask, setBackgroundColor, setBounds, setBoundsOrigin, setBoundsSize, setFrame, setFrameOrigin, setFrameSize, setHidden, setHitTests, setNeedsDisplay, setNeedsDisplayInRect, setPostsBoundsChangedNotifications, setPostsFrameChangedNotifications, subviews, superview, unlockFocus, unregisterDraggedTypes, viewDidMoveToSuperview, viewDidMoveToWindow, viewWillMoveToSuperview, viewWillMoveToWindow, visibleRect, willRemoveSubview, window


Method Detail

initWithFrame

-(id)initWithFrame:(CGRect)aFrame
Initializes the receiver for usage with the specified bounding rectangle
Parameters:
aFrame
Returns:
the initialized view

addTabViewItem

-(void)addTabViewItem:(CPTabViewItem)aTabViewItem
Adds a CPTabViewItem to the tab view.
Parameters:
aTabViewItem - the item to add

contentRect

-(CGRect)contentRect
Returns the content rectangle.

indexOfTabViewItem

-(int)indexOfTabViewItem:(CPTabViewItem)aTabViewItem
Returns the index of the specified item
Parameters:
aTabViewItem - the item to find the index for

indexOfTabViewItemWithIdentifier

-(int)indexOfTabViewItemWithIdentifier:(CPString)anIdentifier
Returns the index of the CPTabViewItem with the specified identifier.
Parameters:
anIdentifier - the identifier of the item

insertTabViewItem

-(void)insertTabViewItem:(CPTabViewItem)aTabViewItem atIndex:(unsigned)anIndex
Inserts a CPTabViewItem into the tab view at the specified index.
Parameters:
aTabViewItem - the item to insert
anIndex - the index for the item

mouseDown

-(void)mouseDown:(CPEvent)anEvent
Notifies the receiver that the user has clicked the mouse down in its area.
Parameters:
anEvent - contains information about the click

numberOfTabViewItems

-(unsigned)numberOfTabViewItems
Returns the number of items in the tab view.

removeTabViewItem

-(void)removeTabViewItem:(CPTabViewItem)aTabViewItem
Removes the specified tab view item from the tab view.
Parameters:
aTabViewItem - the item to remove

selectFirstTabViewItem

-(void)selectFirstTabViewItem:(id)aSender
Sets the first tab view item in the array to be displayed to the user.
Parameters:
aSender - the object making this request

selectLastTabViewItem

-(void)selectLastTabViewItem:(id)aSender
Sets the last tab view item in the array to be displayed to the user.
Parameters:
aSender - the object making this request

selectNextTabViewItem

-(void)selectNextTabViewItem:(id)aSender
Sets the next tab item in the array to be displayed.
Parameters:
aSender - the object making this request

selectPreviousTabViewItem

-(void)selectPreviousTabViewItem:(id)aSender
Selects the previous item in the array for display.
Parameters:
aSender - the object making this request

selectTabViewItem

-(void)selectTabViewItem:(CPTabViewItem)aTabViewItem
Displays the specified item in the tab view.
Parameters:
aTabViewItem - the item to display

selectTabViewItemAtIndex

-(void)selectTabViewItemAtIndex:(unsigned)anIndex
Selects the item at the specified index.
Parameters:
anIndex - the index of the item to display.

selectedTabViewItem

-(CPTabViewItem)selectedTabViewItem
Returns the current item being displayed.

setDelegate

-(void)setDelegate:(id)aDelegate
Sets the delegate for this tab view.
Parameters:
aDelegate - the tab view's delegate

setTabViewType

-(void)setTabViewType:(CPTabViewType)aTabViewType
Sets the tab view type.
Parameters:
aTabViewType - the view type

tabViewItemAtIndex

-(CPTabViewItem)tabViewItemAtIndex:(unsigned)anIndex
Returns the CPTabViewItem at the specified index.
Parameters:
anIndex

tabViewItems

-(CPArray)tabViewItems
Returns the array of items that backs this tab view.

tabViewType

-(CPTabViewType)tabViewType
Returns the tab view type.

viewDidMoveToWindow

-(void)viewDidMoveToWindow
Called when the receiver has been moved to a new CPWindow.

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