Public Member Functions | |
(BOOL) | - acceptsFirstResponder [implementation] |
(BOOL) | - allowsEmptySelection [implementation] |
(BOOL) | - allowsMultipleSelection [implementation] |
(CPArray) | - backgroundColors [implementation] |
(CPArray) | - content [implementation] |
(id) | - delegate [implementation] |
(void) | - deleteBackward: [implementation] |
(void) | - encodeWithCoder: [implementation] |
(CGRect) | - frameForItemAtIndex: [implementation] |
(CGRect) | - frameForItemsAtIndexes: [implementation] |
(id) | - initWithCoder: [implementation] |
(id) | - initWithFrame: [implementation] |
(BOOL) | - isFirstResponder [implementation] |
(BOOL) | - isSelectable [implementation] |
(CPCollectionViewItem) | - itemAtIndex: [implementation] |
(CPCollectionViewItem) | - itemPrototype [implementation] |
(CPArray) | - items [implementation] |
(void) | - keyDown: [implementation] |
(CGSize) | - maxItemSize [implementation] |
(unsigned) | - maxNumberOfColumns [implementation] |
(unsigned) | - maxNumberOfRows [implementation] |
(CGSize) | - minItemSize [implementation] |
(void) | - mouseDown: [implementation] |
(void) | - mouseDragged: [implementation] |
(void) | - mouseUp: [implementation] |
(void) | - moveDown: [implementation] |
(void) | - moveLeft: [implementation] |
(void) | - moveRight: [implementation] |
(void) | - moveUp: [implementation] |
(CPCollectionViewItem) | - newItemForRepresentedObject: [implementation] |
(unsigned) | - numberOfColumns [implementation] |
(unsigned) | - numberOfRows [implementation] |
(void) | - pasteboard:provideDataForType: [implementation] |
(CGRect) | - rectForItemAtIndex: [implementation] |
(CGRect) | - rectForItemsAtIndexes: [implementation] |
(void) | - reloadContent [implementation] |
(void) | - resizeSubviewsWithOldSize: [implementation] |
(CPIndexSet) | - selectionIndexes [implementation] |
(void) | - setAllowsEmptySelection: [implementation] |
(void) | - setAllowsMultipleSelection: [implementation] |
(void) | - setBackgroundColors: [implementation] |
(void) | - setContent: [implementation] |
(void) | - setDelegate: [implementation] |
(void) | - setItemPrototype: [implementation] |
(void) | - setMaxItemSize: [implementation] |
(void) | - setMaxNumberOfColumns: [implementation] |
(void) | - setMaxNumberOfRows: [implementation] |
(void) | - setMinItemSize: [implementation] |
(void) | - setSelectable: [implementation] |
(void) | - setSelectionIndexes: [implementation] |
(void) | - setVerticalMargin: [implementation] |
(void) | - tile [implementation] |
(float) | - verticalMargin [implementation] |
This class displays an array as a grid of objects, where each object is represented by a view. The view is controlled by creating a CPCollectionViewItem and specifying its view, then setting that item as the collection view prototype.
-(void)collectionViewDidChangeSelection:(CPCollectionView)collectionView; Called when the selection in the collection view has changed.
collectionView | the collection view who's selection changed |
-(void)collectionView:(CPCollectionView)collectionView didDoubleClickOnItemAtIndex:(int)index; Called when the user double-clicks on an item in the collection view.
collectionView | the collection view that received the double-click | |
index | the index of the item that received the double-click |
-(CPData)collectionView:(CPCollectionView)collectionView dataForItemsAtIndexes:(CPIndexSet)indices forType:(CPString)aType; Invoked to obtain data for a set of indices.
collectionView | the collection view to obtain data for | |
indices | the indices to return data for | |
aType | the data type |
-(CPArray)collectionView:(CPCollectionView)collectionView dragTypesForItemsAtIndexes:(CPIndexSet)indices; Invoked to obtain the data types supported by the specified indices for placement on the pasteboard.
collectionView | the collection view the items reside in | |
indices | the indices to obtain drag types |
Definition at line 66 of file CPCollectionView.j.
- (BOOL) acceptsFirstResponder | [implementation] |
Returns YES
by default.
Definition at line 184 of file CPCollectionView.j.
- (BOOL) allowsEmptySelection | [implementation] |
Returns YES
if the user can select no items, NO
otherwise.
Definition at line 272 of file CPCollectionView.j.
- (BOOL) allowsMultipleSelection | [implementation] |
Returns YES
if the user can select multiple items, NO
otherwise.
Definition at line 289 of file CPCollectionView.j.
- (CPArray) backgroundColors | [implementation] |
Definition at line 564 of file CPCollectionView.j.
- (CPArray) content | [implementation] |
Returns the collection view content array
Definition at line 217 of file CPCollectionView.j.
- (id) delegate | [implementation] |
Returns the collection view's delegate
Definition at line 678 of file CPCollectionView.j.
- (void) deleteBackward: | (id) | sender | [implementation] |
Definition at line 761 of file CPCollectionView.j.
- (void) encodeWithCoder: | (CPCoder) | aCoder | [implementation] |
Definition at line 844 of file CPCollectionView.j.
- (CGRect) frameForItemAtIndex: | (unsigned) | anIndex | [implementation] |
Definition at line 688 of file CPCollectionView.j.
- (CGRect) frameForItemsAtIndexes: | (CPIndexSet) | anIndexSet | [implementation] |
Definition at line 693 of file CPCollectionView.j.
- (id) initWithCoder: | (CPCoder) | aCoder | [implementation] |
Definition at line 812 of file CPCollectionView.j.
- (id) initWithFrame: | (CGRect) | aFrame | [implementation] |
Definition at line 104 of file CPCollectionView.j.
- (BOOL) isFirstResponder | [implementation] |
Returns whether the receiver is currently the first responder.
Definition at line 192 of file CPCollectionView.j.
- (BOOL) isSelectable | [implementation] |
Returns YES
if the collection view is selectable, and NO
otherwise.
Definition at line 255 of file CPCollectionView.j.
- (CPCollectionViewItem) itemAtIndex: | (unsigned) | anIndex | [implementation] |
Definition at line 683 of file CPCollectionView.j.
- (CPCollectionViewItem) itemPrototype | [implementation] |
Returns the current item prototype
Definition at line 149 of file CPCollectionView.j.
- (CPArray) items | [implementation] |
Returns the collection view items.
Definition at line 225 of file CPCollectionView.j.
- (void) keyDown: | (CPEvent) | anEvent | [implementation] |
Definition at line 776 of file CPCollectionView.j.
- (CGSize) maxItemSize | [implementation] |
Returns the current maximum item size.
Definition at line 540 of file CPCollectionView.j.
- (unsigned) maxNumberOfColumns | [implementation] |
Returns the maximum number of columns
Definition at line 479 of file CPCollectionView.j.
- (unsigned) maxNumberOfRows | [implementation] |
Returns the maximum number of rows.
Definition at line 457 of file CPCollectionView.j.
- (CGSize) minItemSize | [implementation] |
Returns the current minimum item size
Definition at line 518 of file CPCollectionView.j.
- (void) mouseDown: | (CPEvent) | anEvent | [implementation] |
Definition at line 575 of file CPCollectionView.j.
- (void) mouseDragged: | (CPEvent) | anEvent | [implementation] |
Definition at line 591 of file CPCollectionView.j.
- (void) mouseUp: | (CPEvent) | anEvent | [implementation] |
Definition at line 569 of file CPCollectionView.j.
- (void) moveDown: | (id) | sender | [implementation] |
Definition at line 741 of file CPCollectionView.j.
- (void) moveLeft: | (id) | sender | [implementation] |
Definition at line 721 of file CPCollectionView.j.
- (void) moveRight: | (id) | sender | [implementation] |
Definition at line 733 of file CPCollectionView.j.
- (void) moveUp: | (id) | sender | [implementation] |
Definition at line 749 of file CPCollectionView.j.
- (CPCollectionViewItem) newItemForRepresentedObject: | (id) | anObject | [implementation] |
Returns a collection view item for anObject
.
anObject | the object to be represented. |
Definition at line 158 of file CPCollectionView.j.
- (unsigned) numberOfColumns | [implementation] |
Returns the current number of columns
Definition at line 496 of file CPCollectionView.j.
- (unsigned) numberOfRows | [implementation] |
Returns the current number of rows
Definition at line 487 of file CPCollectionView.j.
- (void) pasteboard: | (CPPasteboard) | aPasteboard | ||
provideDataForType: | (CPString) | aType | ||
[implementation] |
Places the selected items on the specified pasteboard. The items are requested from the collection's delegate.
aPasteboard | the pasteboard to put the items on | |
aType | the format the pasteboard data |
Definition at line 635 of file CPCollectionView.j.
- (CGRect) rectForItemAtIndex: | (int) | anIndex | [implementation] |
Definition at line 785 of file CPCollectionView.j.
- (CGRect) rectForItemsAtIndexes: | (CPIndexSet) | anIndexSet | [implementation] |
Definition at line 794 of file CPCollectionView.j.
- (void) reloadContent | [implementation] |
Definition at line 328 of file CPCollectionView.j.
- (void) resizeSubviewsWithOldSize: | (CGSize) | aSize | [implementation] |
Definition at line 434 of file CPCollectionView.j.
- (CPIndexSet) selectionIndexes | [implementation] |
Returns a set of the selected indices.
Definition at line 322 of file CPCollectionView.j.
- (void) setAllowsEmptySelection: | (BOOL) | shouldAllowEmptySelection | [implementation] |
Sets whether the user may have no items selected. If YES, mouse clicks not on any item will empty the current selection. The first item will also start off as selected.
shouldAllowMultipleSelection | YES allows the user to select multiple items |
Definition at line 264 of file CPCollectionView.j.
- (void) setAllowsMultipleSelection: | (BOOL) | shouldAllowMultipleSelection | [implementation] |
Sets whether the user can select multiple items.
shouldAllowMultipleSelection | YES allows the user to select multiple items |
Definition at line 281 of file CPCollectionView.j.
- (void) setBackgroundColors: | (CPArray) | backgroundColors | [implementation] |
Definition at line 545 of file CPCollectionView.j.
- (void) setContent: | (CPArray) | anArray | [implementation] |
Sets the content of the collection view to the content in anArray
. This array can be of any type, and each element will be passed to the -setRepresentedObject
: method. It's the responsibility of your custom collection view item to interpret the object.
anArray | the content array |
Definition at line 204 of file CPCollectionView.j.
- (void) setDelegate: | (id) | aDelegate | [implementation] |
Sets the collection view's delegate
aDelegate | the new delegate |
Definition at line 670 of file CPCollectionView.j.
- (void) setItemPrototype: | (CPCollectionViewItem) | anItem | [implementation] |
Sets the item prototype to anItem
anItem | the new item prototype |
Definition at line 136 of file CPCollectionView.j.
- (void) setMaxItemSize: | (CGSize) | aSize | [implementation] |
Sets the maximum item size.
aSize | the new maximum item size |
Definition at line 527 of file CPCollectionView.j.
- (void) setMaxNumberOfColumns: | (unsigned) | aMaxNumberOfColumns | [implementation] |
Sets the maximum number of columns.
aMaxNumberOfColumns | the new maximum number of columns |
Definition at line 466 of file CPCollectionView.j.
- (void) setMaxNumberOfRows: | (unsigned) | aMaxNumberOfRows | [implementation] |
Sets the maximum number of rows.
aMaxNumberOfRows | the new maximum number of rows |
Definition at line 444 of file CPCollectionView.j.
- (void) setMinItemSize: | (CGSize) | aSize | [implementation] |
Sets the minimum size for an item
aSize | the new minimum item size |
Definition at line 505 of file CPCollectionView.j.
- (void) setSelectable: | (BOOL) | isSelectable | [implementation] |
Sets whether the user is allowed to select items
isSelectable | YES allows the user to select items. |
Definition at line 235 of file CPCollectionView.j.
- (void) setSelectionIndexes: | (CPIndexSet) | anIndexSet | [implementation] |
Sets the selected items based on the provided indices.
anIndexSet | the set of items to be selected |
Definition at line 298 of file CPCollectionView.j.
- (void) setVerticalMargin: | (float) | aVerticalMargin | [implementation] |
Sets the collection view's vertical spacing between elements.
aVerticalMargin | the number of pixels to place between elements |
Definition at line 647 of file CPCollectionView.j.
- (void) tile | [implementation] |
Definition at line 365 of file CPCollectionView.j.
- (float) verticalMargin | [implementation] |
Gets the collection view's current vertical spacing between elements.
Definition at line 661 of file CPCollectionView.j.