API  1.0.0
CPTableView Class Reference

#import <CPTableView.h>

+ Inheritance diagram for CPTableView:

Instance Methods

(BOOL) - acceptsFirstResponder
 
(void) - addTableColumn:
 
(BOOL) - allowsColumnReordering
 
(BOOL) - allowsColumnResizing
 
(BOOL) - allowsColumnSelection
 
(BOOL) - allowsEmptySelection
 
(BOOL) - allowsMultipleSelection
 
(CPArray) - alternatingRowBackgroundColors
 
(CPString- autosaveName
 
(BOOL) - autosaveTableColumns
 
(void) - becomeKeyWindow
 
(void) - bind:toObject:withKeyPath:options:
 
(BOOL) - canDragRowsWithIndexes:atPoint:
 
(CPInteger) - clickedColumn
 
(CPInteger) - clickedRow
 
(CPInteger) - columnAtPoint:
 
(unsigned) - columnAutoresizingStyle
 
(CPInteger) - columnForView:
 
(CPIndexSet- columnIndexesInRect:
 
(CPInteger) - columnWithIdentifier:
 
(void) - concludeDragOperation:
 
(BOOL) - continueTracking:at:
 
(CPView- cornerView
 
(id) - dataSource
 
(id) - delegate
 
(void) - deselectAll
 
(void) - deselectAll:
 
(void) - deselectColumn:
 
(void) - deselectRow:
 
(BOOL) - disableAutomaticResizing
 
(SEL) - doubleAction
 
(void) - draggedImage:endedAt:operation:
 
(void) - draggedView:endedAt:operation:
 
(CPTableViewDraggingDestinationFeedbackStyle) - draggingDestinationFeedbackStyle
 
(void) - draggingEnded:
 
(CPDragOperation) - draggingEntered:
 
(void) - draggingExited:
 
(CPDragOperation) - draggingUpdated:
 
(CPImage- dragImageForRowsWithIndexes:tableColumns:event:offset:
 
(CPView- dragViewForRowsWithIndexes:tableColumns:event:offset:
 
(void) - drawBackgroundInClipRect:
 
(void) - drawGridInClipRect:
 
(void) - drawRow:clipRect:
 
(void) - editColumn:row:withEvent:select:
 
(CPInteger) - editedColumn
 
(CPInteger) - editedRow
 
(void) - encodeWithCoder:
 
(void) - enumerateAvailableViewsUsingBlock:
 
(CGRect) - exposedRect
 
(CGRect) - frameOfDataViewAtColumn:row:
 
(void) - getColumn:row:forView:
 
(CPColor- gridColor
 
(unsigned) - gridStyleMask
 
(CPView- headerView
 
(CPTableColumn- highlightedTableColumn
 
(void) - highlightSelectionInClipRect:
 
(CPView- hitTest:
 
(id) - initWithCoder:
 
(id) - initWithFrame:
 
(CGSize) - intercellSpacing
 
(BOOL) - isColumnSelected:
 
(BOOL) - isRowSelected:
 
(void) - keyDown:
 
(void) - layoutSubviews
 
(void) - load
 
(id) - makeViewWithIdentifier:owner:
 
(CPMenu- menuForEvent:
 
(void) - moveColumn:toColumn:
 
(BOOL) - needsPanelToBecomeKey
 
(void) - noteHeightOfRowsWithIndexesChanged:
 
(void) - noteNumberOfRowsChanged
 
(int) - numberOfColumns
 
(int) - numberOfRows
 
(CPInteger) - numberOfSelectedColumns
 
(CPInteger) - numberOfSelectedRows
 
(void) - observeValueForKeyPath:ofObject:change:context:
 
(BOOL) - performDragOperation:
 
(CPView- preparedViewAtColumn:row:
 
(BOOL) - prepareForDragOperation:
 
(CGRect) - rectOfColumn:
 
(CGRect) - rectOfRow:
 
(void) - reloadData
 
(void) - reloadDataForRowIndexes:columnIndexes:
 
(void) - removeTableColumn:
 
(void) - resignKeyWindow
 
(void) - resizeWithOldSuperviewSize:
 
(CPInteger) - rowAtPoint:
 
(CPInteger) - rowForView:
 
(unsigned) - rowHeight
 
(CPRange) - rowsInRect:
 
(void) - scrollColumnToVisible:
 
(void) - scrollRowToVisible:
 
(void) - selectAll:
 
(void) - selectColumnIndexes:byExtendingSelection:
 
(int) - selectedColumn
 
(CPIndexSet- selectedColumnIndexes
 
(int) - selectedRow
 
(CPIndexSet- selectedRowIndexes
 
(CPDictionary- selectionGradientColors
 
(CPColor- selectionHighlightColor
 
(unsigned) - selectionHighlightStyle
 
(void) - selectRowIndexes:byExtendingSelection:
 
(void) - setAllowsColumnReordering:
 
(void) - setAllowsColumnResizing:
 
(void) - setAllowsColumnSelection:
 
(void) - setAllowsEmptySelection:
 
(void) - setAllowsMultipleSelection:
 
(void) - setAlternatingRowBackgroundColors:
 
(void) - setAutosaveName:
 
(void) - setAutosaveTableColumns:
 
(void) - setBoundsOrigin:
 
(void) - setBoundsSize:
 
(void) - setColumnAutoresizingStyle:
 
(void) - setCornerView:
 
(void) - setDataSource:
 
(void) - setDelegate:
 
(void) - setDisableAutomaticResizing:
 
(void) - setDoubleAction:
 
(void) - setDraggingDestinationFeedbackStyle:
 
(void) - setDraggingSourceOperationMask:forLocal:
 
(void) - setDropRow:dropOperation:
 
(void) - setFrameOrigin:
 
(void) - setFrameSize:
 
(void) - setGridColor:
 
(void) - setGridStyleMask:
 
(void) - setHeaderView:
 
(void) - setHighlightedTableColumn:
 
(void) - setIndicatorImage:inTableColumn:
 
(void) - setIntercellSpacing:
 
(void) - setNeedsDisplay:
 
(void) - setNeedsLayout
 
(void) - setRowHeight:
 
(void) - setSelectionGradientColors:
 
(void) - setSelectionHighlightColor:
 
(void) - setSelectionHighlightStyle:
 
(void) - setSortDescriptors:
 
(void) - setUsesAlternatingRowBackgroundColors:
 
(void) - setVerticalMotionCanBeginDrag:
 
(void) - sizeLastColumnToFit
 
(CPArray) - sortDescriptors
 
(BOOL) - startTrackingAt:
 
(void) - stopTracking:at:mouseIsUp:
 
(void) - superviewBoundsChanged:
 
(void) - superviewFrameChanged:
 
(CPArray) - tableColumns
 
(CPTableColumn- tableColumnWithIdentifier:
 
(void) - tile
 
(void) - trackMouse:
 
(BOOL) - tracksMouseOutsideOfFrame
 
(CPColor- unfocusedSelectionGradientColors
 
(CPColor- unfocusedSelectionHighlightColor
 
(BOOL) - usesAlternatingRowBackgroundColors
 
(BOOL) - verticalMotionCanBeginDrag
 
(id) - viewAtColumn:row:makeIfNecessary:
 
(void) - viewWillMoveToSuperview:
 
(void) - viewWillMoveToWindow:
 
(BOOL) - wantsPeriodicDraggingUpdates
 
- Instance Methods inherited from CPControl
(BOOL) - acceptsFirstMouse:
 
(SEL) - action
 
(CPTextAlignment) - alignment
 
(CPWritingDirection) - baseWritingDirection
 
(CPControlSize) - controlSize
 
(double) - doubleValue
 
(float) - floatValue
 
(CPFont- font
 
(CPFormatter- formatter
 
(void) - highlight:
 
(CPCellImagePosition) - imagePosition
 
(CPUInteger) - imageScaling
 
(int) - integerValue
 
(int) - intValue
 
(BOOL) - isContinuous
 
(BOOL) - isEnabled
 
(BOOL) - isHighlighted
 
(CPLineBreakMode) - lineBreakMode
 
(void) - mouseDown:
 
(unsigned) - mouseDownFlags
 
(void) - mouseEntered:
 
(void) - mouseExited:
 
(CPInteger) - nextState
 
(id) - objectValue
 
(void) - performClick:
 
(BOOL) - sendAction:to:
 
(int) - sendActionOn:
 
(BOOL) - sendsActionOnEndEditing
 
(void) - setAction:
 
(void) - setAlignment:
 
(void) - setBaseWritingDirection:
 
(void) - setContinuous:
 
(void) - setControlSize:
 
(void) - setDoubleValue:
 
(void) - setEnabled:
 
(void) - setFloatValue:
 
(void) - setFont:
 
(void) - setFormatter:
 
(void) - setHighlighted:
 
(void) - setImagePosition:
 
(void) - setImageScaling:
 
(void) - setIntegerValue:
 
(void) - setIntValue:
 
(void) - setLineBreakMode:
 
(void) - setObjectValue:
 
(void) - setSendsActionOnEndEditing:
 
(void) - setState:
 
(void) - setStringValue:
 
(void) - setTarget:
 
(void) - setTextColor:
 
(void) - setTextShadowColor:
 
(void) - setTextShadowOffset:
 
(void) - setVerticalAlignment:
 
(CPString- stringValue
 
(void) - takeDoubleValueFrom:
 
(void) - takeFloatValueFrom:
 
(void) - takeIntegerValueFrom:
 
(void) - takeIntValueFrom:
 
(void) - takeObjectValueFrom:
 
(void) - takeStringValueFrom:
 
(id) - target
 
(CPColor- textColor
 
(void) - textDidBeginEditing:
 
(void) - textDidChange:
 
(void) - textDidEndEditing:
 
(CPColor- textShadowColor
 
(CGSize) - textShadowOffset
 
(void) - unhighlightButtonTimerDidFinish:
 
(void) - updateTrackingAreas
 
(CPTextVerticalAlignment) - verticalAlignment
 
- Instance Methods inherited from CPView
(void) - addSubview:
 
(void) - addSubview:positioned:relativeTo:
 
(void) - addTrackingArea:
 
(CGRect) - adjustScroll:
 
(float) - alphaValue
 
(CAAnimation- animationForKey:
 
(CPDictionary- animations
 
(id) - animator
 
(BOOL) - autoresizesSubviews
 
(unsigned) - autoresizingMask
 
(BOOL) - autoscroll:
 
(CPColor- backgroundColor
 
(BOOL) - becomeFirstResponder
 
(CGRect) - bounds
 
(CGPoint) - boundsOrigin
 
(CGSize) - boundsSize
 
(BOOL) - canBecomeKeyView
 
(CGPoint) - center
 
(BOOL) - clipsToBounds
 
(CGPoint) - convertPoint:fromView:
 
(CGPoint) - convertPoint:toView:
 
(CGPoint) - convertPointFromBase:
 
(CGPoint) - convertPointToBase:
 
(CGRect) - convertRect:fromView:
 
(CGRect) - convertRect:toView:
 
(CGRect) - convertRectFromBase:
 
(CGRect) - convertRectToBase:
 
(CGSize) - convertSize:fromView:
 
(CGSize) - convertSize:toView:
 
(CPView- createEphemeralSubviewNamed:
 
(CPString- debug_description
 
(void) - didAddSubview:
 
(void) - display
 
(void) - displayIfNeeded
 
(void) - displayIfNeededInRect:
 
(void) - displayRect:
 
(void) - displayRectIgnoringOpacity:inContext:
 
(void) - dragImage:at:offset:event:pasteboard:source:slideBack:
 
(void) - dragView:at:offset:event:pasteboard:source:slideBack:
 
(void) - drawRect:
 
(CPAppearance- effectiveAppearance
 
(CPMenuItem- enclosingMenuItem
 
(CPScrollView- enclosingScrollView
 
(BOOL) - enterFullScreenMode
 
(BOOL) - enterFullScreenMode:withOptions:
 
(CPView- ephemeralSubviewNamed:
 
(void) - exitFullScreenMode
 
(void) - exitFullScreenModeWithOptions:
 
(CGRect) - frame
 
(CGPoint) - frameOrigin
 
(CGRect) - frameRectOfView:inSuperviewSize:
 
(CGSize) - frameSize
 
(CGRect) - frameWithNewSuperviewSize:
 
(BOOL) - hasCustomDrawRect
 
(BOOL) - hasCustomLayoutSubviews
 
(BOOL) - hitTests
 
(id) - init
 
(BOOL) - inLiveResize
 
(BOOL) - isDescendantOf:
 
(BOOL) - isFlipped
 
(BOOL) - isHidden
 
(BOOL) - isHiddenOrHasHiddenAncestor
 
(BOOL) - isInFullScreenMode
 
(BOOL) - isOpaque
 
(CALayer- layer
 
(void) - layout
 
(CPView- layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:
 
(void) - layoutIfNeeded
 
(void) - lockFocus
 
(BOOL) - mouseDownCanMoveWindow
 
(BOOL) - needsDisplay
 
(BOOL) - needsLayout
 
(CPView- nextKeyView
 
(CPView- nextValidKeyView
 
(void) - objectDidChangeTheme
 
(BOOL) - performKeyEquivalent:
 
(BOOL) - postsBoundsChangedNotifications
 
(BOOL) - postsFrameChangedNotifications
 
(CPView- previousKeyView
 
(CPView- previousValidKeyView
 
(CGRect) - rectForEphemeralSubviewNamed:
 
(void) - reflectScrolledClipView:
 
(CPArray) - registeredDraggedTypes
 
(void) - registerForDraggedTypes:
 
(void) - removeFromSuperview
 
(void) - removeTrackingArea:
 
(void) - replaceSubview:with:
 
(BOOL) - resignFirstResponder
 
(void) - resizeSubviewsWithOldSize:
 
(void) - rightMouseDown:
 
(CGSize) - scaleSize
 
(void) - scaleUnitSquareToSize:
 
(void) - scrollClipView:toPoint:
 
(void) - scrollPoint:
 
(void) - scrollRect:by:
 
(BOOL) - scrollRectToVisible:
 
(void) - setAlphaValue:
 
(void) - setAnimations:
 
(void) - setAppearance:
 
(void) - setAutoresizesSubviews:
 
(void) - setAutoresizingMask:
 
(void) - setBackgroundColor:
 
(void) - setBounds:
 
(void) - setCenter:
 
(void) - setClipsToBounds:
 
(void) - setDOMClassName:
 
(void) - setFrame:
 
(void) - setHidden:
 
(void) - setHitTests:
 
(void) - setLayer:
 
(void) - setNeedsDisplayInRect:
 
(void) - setNeedsLayout:
 
(void) - setNextKeyView:
 
(void) - setPostsBoundsChangedNotifications:
 
(void) - setPostsFrameChangedNotifications:
 
(void) - setScaleSize:
 
(void) - setSubviews:
 
(void) - setTag:
 
(void) - setThemeClass:
 
(BOOL) - setThemeState:
 
(void) - setToolTip:
 
(void) - setValue:forThemeAttribute:
 
(void) - setValue:forThemeAttribute:inState:
 
(void) - setWantsLayer:
 
(CPArray) - subviews
 
(CPView- superview
 
(CPInteger) - tag
 
(void) - unlockFocus
 
(void) - unregisterDraggedTypes
 
(BOOL) - unsetThemeState:
 
(void) - viewDidEndLiveResize
 
(void) - viewDidHide
 
(void) - viewDidLayout
 
(void) - viewDidMoveToSuperview
 
(void) - viewDidMoveToWindow
 
(void) - viewDidUnhide
 
(void) - viewWillDraw
 
(void) - viewWillLayout
 
(void) - viewWillStartLiveResize
 
(CPView- viewWithTag:
 
(CGRect) - visibleRect
 
(BOOL) - wantsLayer
 
(void) - willRemoveSubview:
 
(CPWindow- window
 

Class Methods

(CPString+ defaultThemeClass
 
(CPDictionary+ themeAttributes
 
- Class Methods inherited from CPControl
(void) + initialize
 
- Class Methods inherited from CPView
(Class) + animatorClass
 
(CAAnimation+ defaultAnimationForKey:
 
(CPMenu+ defaultMenu
 
(BOOL) + isHighDPIDrawingEnabled
 
(CPSet) + keyPathsForValuesAffectingBounds
 
(CPSet) + keyPathsForValuesAffectingFrame
 
(void) + setHighDPIDrawingEnabled:
 

Detailed Description

A table view control displays record-oriented data in a table and allows the user to edit values and resize and rearrange columns. A CPTableView requires you to either set a data source which implements numberOfRowsInTableView: and tableView:objectValueForTableColumn:row:, or alternatively to provide data through Key Value Bindings.

To use a table view with Key Value Bindings, bind each column's CPValueBinding to an array.field path - typically this would be to a path in an array controller like arrangedObjects.X, where X is the name of a field. Optionally also bind the table's selectionIndexes and sortDescriptors to the array controller.

All delegate and data source methods are documented in the setDataSource: and setDelegate: methods.

If you want to display something other than just text in the table you should call setDataView: on a CPTableColumn object. More documentation in that class including theme states.

Note
CPTableView does not contain its own scrollview. You should be sure you place the tableview in a CPScrollView on your own.

Definition at line 2 of file CPTableView.h.

Method Documentation

◆ acceptsFirstResponder()

- (BOOL) acceptsFirstResponder
implementation

Definition at line 5045 of file CPTableView.j.

◆ addTableColumn:()

- (void) addTableColumn: (CPTableColumn aTableColumn
implementation

Adds a given column as the last column of the receiver.

Parameters
aColumnThe column to add to the receiver.

Reimplemented in CPOutlineView.

Definition at line 1077 of file CPTableView.j.

◆ allowsColumnReordering()

- (BOOL) allowsColumnReordering
implementation

Returns YES if the user is allowed to reorder the columns, otherwise NO.

Definition at line 704 of file CPTableView.j.

◆ allowsColumnResizing()

- (BOOL) allowsColumnResizing
implementation

Returns YES if the user is allowed to manually resize the columns, otherwise NO.

Definition at line 721 of file CPTableView.j.

◆ allowsColumnSelection()

- (BOOL) allowsColumnSelection
implementation

Returns YES if the user is allowed to select a column by clicking it, otherwise NO.

Definition at line 776 of file CPTableView.j.

◆ allowsEmptySelection()

- (BOOL) allowsEmptySelection
implementation

Returns YES if the tableview is allowed to have an unselected row or column, otherwise NO.

Definition at line 757 of file CPTableView.j.

◆ allowsMultipleSelection()

- (BOOL) allowsMultipleSelection
implementation

Returns YES if the tableview is allowed to have multiple selections, otherwise NO.

Returns
BOOL - YES if the tableview is allowed to have multiple selections otherwise NO.

Definition at line 740 of file CPTableView.j.

◆ alternatingRowBackgroundColors()

- (CPArray) alternatingRowBackgroundColors
implementation

Returns an array of the alternating background colors

Definition at line 872 of file CPTableView.j.

◆ autosaveName()

- (CPString) autosaveName
implementation

Returns the autosave name of the tableview.

Definition at line 2545 of file CPTableView.j.

◆ autosaveTableColumns()

- (BOOL) autosaveTableColumns
implementation

Returns YES the table columns should autosave, otherwise NO.

Definition at line 2564 of file CPTableView.j.

◆ becomeKeyWindow()

- (void) becomeKeyWindow
implementation

Definition at line 5029 of file CPTableView.j.

◆ bind:toObject:withKeyPath:options:()

- (void) bind: (CPString aBinding
toObject: (id)  anObject
withKeyPath: (CPString aKeyPath
options: (CPDictionary options 
implementation

Provided by category CPTableView(Bindings).

Definition at line 6053 of file CPTableView.j.

◆ canDragRowsWithIndexes:atPoint:()

- (BOOL) canDragRowsWithIndexes: (CPIndexSet rowIndexes
atPoint: (CGPoint)  mouseDownPoint 
implementation

Returns whether the receiver allows dragging the rows at rowIndexes with a drag initiated at mousedDownPoint.

Parameters
rowIndexesan index set of rows to be dragged
aPointthe point at which the mouse was clicked.

Definition at line 3042 of file CPTableView.j.

◆ clickedColumn()

- (CPInteger) clickedColumn
implementation

Definition at line 678 of file CPTableView.j.

◆ clickedRow()

- (CPInteger) clickedRow
implementation

Returns the index of the the row the user clicked to trigger an action, or -1 if no row was clicked.

Definition at line 686 of file CPTableView.j.

◆ columnAtPoint:()

- (CPInteger) columnAtPoint: (CGPoint)  aPoint
implementation

Returns the index of a column at a given point. If no column is there CPNotFound is returned.

Parameters
aPointa CGPoint

Definition at line 1945 of file CPTableView.j.

◆ columnAutoresizingStyle()

- (unsigned) columnAutoresizingStyle
implementation

Returns the column auto resizing style of the receiver.

Definition at line 2329 of file CPTableView.j.

◆ columnForView:()

- (CPInteger) columnForView: (CPView aView
implementation

Returns the index of the column for the specified view.

Parameters
viewThe view.
Returns
The index of the column corresponding to the view. Returns -1 if the view is not a dataView, or a subview of a dataView. This is typically needed in the action method for a CPButton (or CPControl) to find out what row (and column) the action should be performed on. The implementation is O(rxc) where r is the number of visible rows, and c is the number of visible columns, so this method should generally not be called within a loop.

Definition at line 2065 of file CPTableView.j.

◆ columnIndexesInRect:()

- (CPIndexSet) columnIndexesInRect: (CGRect)  aRect
implementation

Returns the indexes of the receiver's columns that intersect the specified rectangle.

Parameters
aRecta rectangle in the coordinate system of the receiver.

Definition at line 1911 of file CPTableView.j.

◆ columnWithIdentifier:()

- (CPInteger) columnWithIdentifier: (CPString anIdentifier
implementation

Returns the index of the column with the specified identifier

Parameters
anIdentifierthe string value of the tablecolumn identifier
Returns
the index of the column

Definition at line 1255 of file CPTableView.j.

◆ concludeDragOperation:()

- (void) concludeDragOperation: (id)  sender
implementation

Definition at line 4896 of file CPTableView.j.

◆ continueTracking:at:()

- (BOOL) continueTracking: (CGPoint)  lastPoint
at: (CGPoint)  aPoint 
implementation

Reimplemented from CPControl.

Definition at line 4543 of file CPTableView.j.

◆ cornerView()

- (CPView) cornerView
implementation

Returns the cornerview for the scrollview

Definition at line 1642 of file CPTableView.j.

◆ dataSource()

- (id) dataSource
implementation

Returns the object that provides the data displayed by the receiver.

Reimplemented in CPOutlineView.

Definition at line 590 of file CPTableView.j.

◆ defaultThemeClass()

+ (CPString) defaultThemeClass
implementation

Reimplemented from CPView.

Definition at line 315 of file CPTableView.j.

◆ delegate()

- (id) delegate
implementation

Returns the delegate object for the table view.

Reimplemented in CPOutlineView.

Definition at line 2887 of file CPTableView.j.

◆ deselectAll()

- (void) deselectAll
implementation

Deselects all rows and columns

Definition at line 1564 of file CPTableView.j.

◆ deselectAll:()

- (void) deselectAll: (id)  sender
implementation

Definition at line 1587 of file CPTableView.j.

◆ deselectColumn:()

- (void) deselectColumn: (CPInteger)  anIndex
implementation

Deselects the column at a given index

Parameters
anIndexthe index of the column to deselect

Definition at line 1500 of file CPTableView.j.

◆ deselectRow:()

- (void) deselectRow: (CPInteger)  aRow
implementation

Deselects a row at a given index

Parameters
aRowthe row to deselect

Definition at line 1513 of file CPTableView.j.

◆ disableAutomaticResizing()

- (BOOL) disableAutomaticResizing
implementation

Synthesized accessor method.

Provided by category CPTableView(CPSynthesizedAccessors).

Definition at line 6426 of file CPTableView.j.

◆ doubleAction()

- (SEL) doubleAction
implementation

Returns the double click action selector.

Definition at line 670 of file CPTableView.j.

◆ draggedImage:endedAt:operation:()

- (void) draggedImage: (CPImage anImage
endedAt: (CGPoint)  aLocation
operation: (CPDragOperation)  anOperation 
implementation

Provided by category CPTableView(TableViewDataSource).

Definition at line 5645 of file CPTableView.j.

◆ draggedView:endedAt:operation:()

- (void) draggedView: (CPImage aView
endedAt: (CGPoint)  aLocation
operation: (CPDragOperation)  anOperation 
implementation

Definition at line 4905 of file CPTableView.j.

◆ draggingDestinationFeedbackStyle()

- (CPTableViewDraggingDestinationFeedbackStyle) draggingDestinationFeedbackStyle
implementation

Returns the tableview dragging destination feedback style.

Can be:

        CPTableViewDraggingDestinationFeedbackStyleNone
        CPTableViewDraggingDestinationFeedbackStyleRegular
        CPTableViewDraggingDestinationFeedbackStyleSourceList

Definition at line 3244 of file CPTableView.j.

◆ draggingEnded:()

- (void) draggingEnded: (id)  sender
implementation

Definition at line 4731 of file CPTableView.j.

◆ draggingEntered:()

- (CPDragOperation) draggingEntered: (id)  sender
implementation

Definition at line 4698 of file CPTableView.j.

◆ draggingExited:()

- (void) draggingExited: (id)  sender
implementation

Definition at line 4723 of file CPTableView.j.

◆ draggingUpdated:()

- (CPDragOperation) draggingUpdated: (id)  sender
implementation

Definition at line 4828 of file CPTableView.j.

◆ dragImageForRowsWithIndexes:tableColumns:event:offset:()

- (CPImage) dragImageForRowsWithIndexes: (CPIndexSet dragRows
tableColumns: (CPArray)  theTableColumns
event: (CPEvent dragEvent
offset: (CGPoint)  dragImageOffset 
implementation

Computes and returns an image to use for dragging. This method is invoked ONLY IF dragViewForRowsWithIndexes:tableColumns:event:offset: returns nil.

Parameters
dragRowsan index set with the dragged row indexes
theTableColumnsan array of the table columns which are being dragged
dragEventthe event which initiated the drag
offseta point at which to set the drag image to be offset from the cursor
Returns
CPImage an image to use for the drag feedback

Definition at line 3057 of file CPTableView.j.

◆ dragViewForRowsWithIndexes:tableColumns:event:offset:()

- (CPView) dragViewForRowsWithIndexes: (CPIndexSet theDraggedRows
tableColumns: (CPArray)  theTableColumns
event: (CPEvent theDragEvent
offset: (CGPoint)  dragViewOffset 
implementation

Computes and returns a view to use for dragging. By default this is a slightly transparent copy of the dataviews which are being dragged. You can override this in a subclass to show different dragging feedback. Additionally you can return nil from this method and implement:

  • (CPImage)dragImageForRowsWithIndexes:tableColumns:event:offset: - if you want to return a simple image.
Parameters
dragRowsan index set with the dragged row indexes
theTableColumnsan array of the table columns which are being dragged
dragEventthe event which initiated the drag
offseta point at which to set the drag image to be offset from the cursor
Returns
CPView a view used as the dragging feedback

Definition at line 3074 of file CPTableView.j.

◆ drawBackgroundInClipRect:()

- (void) drawBackgroundInClipRect: (CGRect)  aRect
implementation

Draws the background in a given clip rect. This method should only be overridden if you want something other than a solid color or alternating row colors.

Note
this method should not be called directly, instead use setNeedsDisplay:

Definition at line 4015 of file CPTableView.j.

◆ drawGridInClipRect:()

- (void) drawGridInClipRect: (CGRect)  aRect
implementation

Draws the grid for the tableview based on the set grid mask in a given clip rect.

Note
this method should not be called directly, instead use setNeedsDisplay:

Definition at line 4071 of file CPTableView.j.

◆ drawRow:clipRect:()

- (void) drawRow: (CPInteger)  row
clipRect: (CGRect)  rect 
implementation

While this method doesn't do anything in Cappuccino, subclasses can override it to customize the appearance of a row.

Note
tableView:willDisplayView:forTableColumn:row is sent to the delegate before drawing

Definition at line 4396 of file CPTableView.j.

◆ editColumn:row:withEvent:select:()

- (void) editColumn: (CPInteger)  columnIndex
row: (CPInteger)  rowIndex
withEvent: (CPEvent theEvent
select: (BOOL)  flag 
implementation

Edits the dataview at a given row and column. This method is usually invoked automatically and should rarely be invoked directly The row at supplied rowIndex must be selected otherwise an exception is thrown.

Parameters
columnIndexthe index of the column to edit
rowIndexthe index of the row to edit
theEventthe mouse event which triggers the edit, you can pass nil
flagYES if the dataview text should be selected, otherwise NO. (NOT YET IMPLEMENTED)

Definition at line 5307 of file CPTableView.j.

◆ editedColumn()

- (CPInteger) editedColumn
implementation

Returns the column of the currently edited cell, or CPNotFound if none.

Definition at line 5345 of file CPTableView.j.

◆ editedRow()

- (CPInteger) editedRow
implementation

Returns the row of the currently edited cell, or CPNotFound if none.

Definition at line 5353 of file CPTableView.j.

◆ encodeWithCoder:()

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Archives the view to a coder.

Parameters
aCoderthe object into which the view's data will be archived.

Reimplemented from CPControl.

Reimplemented in CPOutlineView.

Provided by category CPTableView(CPCoding).

Definition at line 6159 of file CPTableView.j.

◆ enumerateAvailableViewsUsingBlock:()

- (void) enumerateAvailableViewsUsingBlock: (Function/*CPView *dataView, CPInteger row, CPInteger column*, @ref stop*/)  handler
implementation

Allows the enumeration of all the table views that are known to the table view.

Parameters
handlerThe function to apply to elements in the set.

The function takes three arguments:

Parameters
dataViewThe view for the column and row.
columnThe column index of the view.
rowThe row index of the view.

Definition at line 3833 of file CPTableView.j.

◆ exposedRect()

- (CGRect) exposedRect
implementation

Returns a CGRect of the exposed area of the tableview.

Definition at line 3380 of file CPTableView.j.

◆ frameOfDataViewAtColumn:row:()

- (CGRect) frameOfDataViewAtColumn: (CPInteger)  aColumn
row: (CPInteger)  aRow 
implementation

Returns a rect for the dataview / cell at the column and row given. If the column or row index is greater than the number of columns or rows a CGZeroRect is returned

Parameters
aColumnindex of the column
aRowindex of the row

Reimplemented in CPOutlineView.

Definition at line 2139 of file CPTableView.j.

◆ getColumn:row:forView:()

- (void) getColumn: (Function)  columnRef
row: (Function)  rowRef
forView: (CPView aView 
implementation

Definition at line 2077 of file CPTableView.j.

◆ gridColor()

- (CPColor) gridColor
implementation

Returns a CPColor object of set grid color

Definition at line 1043 of file CPTableView.j.

◆ gridStyleMask()

- (unsigned) gridStyleMask
implementation

Returns a grid mask

Definition at line 1066 of file CPTableView.j.

◆ headerView()

- (CPView) headerView
implementation

Returns the headerview for the receiver. The headerview contains column headerviews for each table column.

Definition at line 1666 of file CPTableView.j.

◆ highlightedTableColumn()

- (CPTableColumn) highlightedTableColumn
implementation

Returns the CPTableColumn object of the highlighted table column.

Definition at line 3011 of file CPTableView.j.

◆ highlightSelectionInClipRect:()

- (void) highlightSelectionInClipRect: (CGRect)  aRect
implementation

Draws the selection with the set selection highlight style in a given clip rect. You can change the highlight style to a source list style gradient in setSelectionHighlightStyle:

Note
this method should not be called directly, instead use setNeedsDisplay:

Definition at line 4149 of file CPTableView.j.

◆ hitTest:()

- (CPView) hitTest: (CGPoint)  aPoint
implementation

Reimplemented from CPView.

Definition at line 5061 of file CPTableView.j.

◆ initWithCoder:()

- (id) initWithCoder: (CPCoder aCoder
implementation

Initializes the view from an archive.

Parameters
aCoderthe coder from which to initialize
Returns
the initialized view

Reimplemented from CPControl.

Reimplemented in CPOutlineView.

Provided by category CPTableView(CPCoding).

Definition at line 6105 of file CPTableView.j.

◆ initWithFrame:()

- (id) initWithFrame: (CGRect)  aFrame
implementation

Initializes the receiver for usage with the specified bounding rectangle

Returns
the initialized view

Reimplemented from CPControl.

Reimplemented in CPOutlineView.

Definition at line 353 of file CPTableView.j.

◆ intercellSpacing()

- (CGSize) intercellSpacing
implementation

Returns the intercell spacing in a CGSize object.

Definition at line 807 of file CPTableView.j.

◆ isColumnSelected:()

- (BOOL) isColumnSelected: (CPInteger)  anIndex
implementation

Returns YES if the column at a given index is selected, otherwise NO.

Parameters
anIndexthe index of a column
Returns
YES if the column is selected, otherwise NO.

Definition at line 1543 of file CPTableView.j.

◆ isRowSelected:()

- (BOOL) isRowSelected: (CPInteger)  aRow
implementation

Returns YES if the row at a given index is selected, otherwise NO.

Parameters
aRowthe index of a row
Returns
YES if the row is selected, otherwise NO.

Definition at line 1554 of file CPTableView.j.

◆ keyDown:()

- (void) keyDown: (CPEvent anEvent
implementation

Reimplemented in CPOutlineView.

Definition at line 5361 of file CPTableView.j.

◆ layoutSubviews()

- (void) layoutSubviews
implementation

Reimplemented from CPView.

Definition at line 4405 of file CPTableView.j.

◆ load()

- (void) load
implementation

Loads all the data and dataviews for the receiver.

Definition at line 3400 of file CPTableView.j.

◆ makeViewWithIdentifier:owner:()

- (id) makeViewWithIdentifier: (CPString anIdentifier
owner: (id)  anOwner 
implementation

Definition at line 3689 of file CPTableView.j.

◆ menuForEvent:()

- (CPMenu) menuForEvent: (CPEvent theEvent
implementation

Reimplemented from CPView.

Definition at line 4506 of file CPTableView.j.

◆ moveColumn:toColumn:()

- (void) moveColumn: (CPInteger)  theColumnIndex
toColumn: (CPInteger)  theToIndex 
implementation

Moves the column and heading at a given index to a new given index.

Parameters
theColumnIndexThe current index of the column to move.
theToIndexThe new index for the moved column.

Definition at line 1215 of file CPTableView.j.

◆ needsPanelToBecomeKey()

- (BOOL) needsPanelToBecomeKey
implementation

Reimplemented from CPView.

Definition at line 5053 of file CPTableView.j.

◆ noteHeightOfRowsWithIndexesChanged:()

- (void) noteHeightOfRowsWithIndexesChanged: (CPIndexSet anIndexSet
implementation

Informs the receiver that the rows specified in indexSet have changed height.

Parameters
anIndexSetan index set containing the indexes of the rows which changed height

Definition at line 2449 of file CPTableView.j.

◆ noteNumberOfRowsChanged()

- (void) noteNumberOfRowsChanged
implementation

Informs the receiver that the number of records in the datasource has changed.

Definition at line 2370 of file CPTableView.j.

◆ numberOfColumns()

- (int) numberOfColumns
implementation

Returns the number of columns in the table

Definition at line 1601 of file CPTableView.j.

◆ numberOfRows()

- (int) numberOfRows
implementation

Returns the number of rows in the receiver.

Definition at line 1609 of file CPTableView.j.

◆ numberOfSelectedColumns()

- (CPInteger) numberOfSelectedColumns
implementation

Returns the number of selected columns

Definition at line 1524 of file CPTableView.j.

◆ numberOfSelectedRows()

- (CPInteger) numberOfSelectedRows
implementation

Returns the number of selected columns

Definition at line 1532 of file CPTableView.j.

◆ observeValueForKeyPath:ofObject:change:context:()

- (void) observeValueForKeyPath: (CPString keyPath
ofObject: (id)  object
change: (CPDictionary change
context: (void)  context 
implementation

Definition at line 5328 of file CPTableView.j.

◆ performDragOperation:()

- (BOOL) performDragOperation: (id)  sender
implementation

Definition at line 4881 of file CPTableView.j.

◆ preparedViewAtColumn:row:()

- (CPView) preparedViewAtColumn: (CPInteger)  column
row: (CPInteger)  row 
implementation

Definition at line 3555 of file CPTableView.j.

◆ prepareForDragOperation:()

- (BOOL) prepareForDragOperation: (id)  sender
implementation

Definition at line 4869 of file CPTableView.j.

◆ rectOfColumn:()

- (CGRect) rectOfColumn: (CPInteger)  aColumnIndex
implementation

Returns a CGRect with the location and size of the column If aColumnIndex lies outside the range of the table columns a CGZeroRect is returned

Parameters
aColumnIndexthe index of the column to return the rect of

Definition at line 1754 of file CPTableView.j.

◆ rectOfRow:()

- (CGRect) rectOfRow: (CPInteger)  aRowIndex
implementation

Returns a CGRect with the location and size of the row. CGRectZero is returned if aRowIndex doesn't exist.

Parameters
aRowIndexthe index of the row you want the rect of

Definition at line 1842 of file CPTableView.j.

◆ reloadData()

- (void) reloadData
implementation

Reloads the data for visible data views.

Definition at line 599 of file CPTableView.j.

◆ reloadDataForRowIndexes:columnIndexes:()

- (void) reloadDataForRowIndexes: (CPIndexSet rowIndexes
columnIndexes: (CPIndexSet columnIndexes 
implementation

Reloads the data for only the specified rows and columns.

Parameters
rowIndexesThe indexes of the rows to update.
columnIndexesThe indexes of the columns to update.

Definition at line 609 of file CPTableView.j.

◆ removeTableColumn:()

- (void) removeTableColumn: (CPTableColumn aTableColumn
implementation

Removes a given column from the receiver.

Parameters
aTableColumnThe column to remove from the receiver.

Reimplemented in CPOutlineView.

Definition at line 1106 of file CPTableView.j.

◆ resignKeyWindow()

- (void) resignKeyWindow
implementation

Definition at line 5037 of file CPTableView.j.

◆ resizeWithOldSuperviewSize:()

- (void) resizeWithOldSuperviewSize: (CGSize)  aSize
implementation

Reimplemented from CPView.

Definition at line 2157 of file CPTableView.j.

◆ rowAtPoint:()

- (CPInteger) rowAtPoint: (CGPoint)  aPoint
implementation

Returns the index of a row at a particular point. If no row exists at that point -1 is returned.

Parameters
aPointa CGPoint

Definition at line 1995 of file CPTableView.j.

◆ rowForView:()

- (CPInteger) rowForView: (CPView aView
implementation

Returns the index of the row for the specified view.

Parameters
viewThe view.
Returns
The index of the row corresponding to the view. Returns -1 if the view is not a dataView, or a subview of a dataView. This is typically needed in the action method for a CPButton (or CPControl) to find out what row (and column) the action should be performed on. The implementation is O(rxc) where r is the number of visible rows, and c is the number of visible columns, so this method should generally not be called within a loop.

Definition at line 2048 of file CPTableView.j.

◆ rowHeight()

- (unsigned) rowHeight
implementation

Returns the height of each row.

Definition at line 834 of file CPTableView.j.

◆ rowsInRect:()

- (CPRange) rowsInRect: (CGRect)  aRect
implementation

Returns a range of indices for the rows that lie wholly or partially within the vertical boundaries of a given rectangle.

Parameters
aRectA rectangle in the coordinate system of the receiver.

Definition at line 1852 of file CPTableView.j.

◆ scrollColumnToVisible:()

- (void) scrollColumnToVisible: (int)  columnIndex
implementation

Scrolls the receiver and header view horizontally in an enclosing CPClipView so the column specified by columnIndex is visible.

Parameters
aColumnIndexthe index of the column to scroll to.

Definition at line 2513 of file CPTableView.j.

◆ scrollRowToVisible:()

- (void) scrollRowToVisible: (int)  rowIndex
implementation

Scrolls the receiver vertically in an enclosing CPClipView so the row specified by rowIndex is visible.

Parameters
aRowIndexthe index of the row to scroll to.

Definition at line 2497 of file CPTableView.j.

◆ selectAll:()

- (void) selectAll: (id)  sender
implementation

Definition at line 1570 of file CPTableView.j.

◆ selectColumnIndexes:byExtendingSelection:()

- (void) selectColumnIndexes: (CPIndexSet columns
byExtendingSelection: (BOOL)  shouldExtendSelection 
implementation

Sets the column selection using indexes.

Parameters
columnsa CPIndexSet of columns to select
aFlagshould extend the selection thereby retaining the previous selection

Definition at line 1307 of file CPTableView.j.

◆ selectedColumn()

- (int) selectedColumn
implementation

Returns the index of the last selected column.

Definition at line 1466 of file CPTableView.j.

◆ selectedColumnIndexes()

- (CPIndexSet) selectedColumnIndexes
implementation

Returns an index set of all the selected columns.

Definition at line 1474 of file CPTableView.j.

◆ selectedRow()

- (int) selectedRow
implementation

Returns the index of the last selected row.

Definition at line 1482 of file CPTableView.j.

◆ selectedRowIndexes()

- (CPIndexSet) selectedRowIndexes
implementation

Returns an index set with the indexes of all the selected rows.

Definition at line 1490 of file CPTableView.j.

◆ selectionGradientColors()

- (CPDictionary) selectionGradientColors
implementation

Returns a dictionary of containing the keys:

    CPSourceListGradient
    CPSourceListTopLineColor
    CPSourceListBottomLineColor

Definition at line 976 of file CPTableView.j.

◆ selectionHighlightColor()

- (CPColor) selectionHighlightColor
implementation

Returns the highlight color for a focused row or column selection.

Definition at line 935 of file CPTableView.j.

◆ selectionHighlightStyle()

- (unsigned) selectionHighlightStyle
implementation

Returns an enumerated value for the selection highlight style.

Valid values are:
        CPTableViewSelectionHighlightStyleNone
        CPTableViewSelectionHighlightStyleRegular
        CPTableViewSelectionHighlightStyleSourceList

Definition at line 888 of file CPTableView.j.

◆ selectRowIndexes:byExtendingSelection:()

- (void) selectRowIndexes: (CPIndexSet rows
byExtendingSelection: (BOOL)  shouldExtendSelection 
implementation

Sets the row selection using indexes.

Parameters
rowsa CPIndexSet of rows to select
aFlagshould extend the selection thereby retaining the previous selection

Definition at line 1365 of file CPTableView.j.

◆ setAllowsColumnReordering:()

- (void) setAllowsColumnReordering: (BOOL)  shouldAllowColumnReordering
implementation

If you want to allow the user to reorder the columns pass YES, otherwise NO.

Definition at line 696 of file CPTableView.j.

◆ setAllowsColumnResizing:()

- (void) setAllowsColumnResizing: (BOOL)  shouldAllowColumnResizing
implementation

Passing YES will allow the user to resize columns. Passing NO will keep the table columns unmovable by the user.

Note
The this does not affect autoresizing behavior.

Definition at line 713 of file CPTableView.j.

◆ setAllowsColumnSelection:()

- (void) setAllowsColumnSelection: (BOOL)  shouldAllowColumnSelection
implementation

Controls whether the user can select an entire column by clicking its header.

Parameters
aFlagYES to allow the user to select columns, otherwise NO.

Definition at line 767 of file CPTableView.j.

◆ setAllowsEmptySelection:()

- (void) setAllowsEmptySelection: (BOOL)  shouldAllowEmptySelection
implementation

Controls whether the receiver allows zero rows or columns to be selected.

Parameters
aFlagYES if an empty selection is allowed, otherwise NO.

Definition at line 749 of file CPTableView.j.

◆ setAllowsMultipleSelection:()

- (void) setAllowsMultipleSelection: (BOOL)  shouldAllowMultipleSelection
implementation

Controls whether the user can select more than one row or column at a time.

Parameters
aFlagYES to allow the user to select multiple rows or columns, otherwise NO.

Definition at line 730 of file CPTableView.j.

◆ setAlternatingRowBackgroundColors:()

- (void) setAlternatingRowBackgroundColors: (CPArray)  alternatingRowBackgroundColors
implementation

Sets the colors for the rows as they alternate. The number of colors can be arbitrary. By default these colors are white and light blue.

Parameters
anArrayan array of CPColors

Definition at line 862 of file CPTableView.j.

◆ setAutosaveName:()

- (void) setAutosaveName: (CPString theAutosaveName
implementation

Set the name under which the table information is automatically saved to theAutosaveName. The table information is saved separately for each user and for each application that user uses.

Note
Even though a table view has an autosave name, it may not be saving table information automatically. To set whether table information is being saved automatically, use setAutosaveTableColumns:

Definition at line 2531 of file CPTableView.j.

◆ setAutosaveTableColumns:()

- (void) setAutosaveTableColumns: (BOOL)  shouldAutosave
implementation

Sets whether the order and width of this table view's columns are automatically saved.

The table information is saved separately for each user and for each application that user uses.

Note
that if autosaveName returns nil, this setting is ignored and table information isn't saved.

Definition at line 2556 of file CPTableView.j.

◆ setBoundsOrigin:()

- (void) setBoundsOrigin: (CGPoint)  aPoint
implementation

Reimplemented from CPView.

Definition at line 3947 of file CPTableView.j.

◆ setBoundsSize:()

- (void) setBoundsSize: (CGSize)  aSize
implementation

Reimplemented from CPView.

Definition at line 3957 of file CPTableView.j.

◆ setColumnAutoresizingStyle:()

- (void) setColumnAutoresizingStyle: (unsigned)  style
implementation

Sets the column autoresizing style of the receiver to a given style.

Parameters
aStylethe column autoresizing style for the receiver. Valid values are:
        CPTableViewNoColumnAutoresizing
        CPTableViewUniformColumnAutoresizingStyle
        CPTableViewLastColumnOnlyAutoresizingStyle
        CPTableViewFirstColumnOnlyAutoresizingStyle

Definition at line 2320 of file CPTableView.j.

◆ setCornerView:()

- (void) setCornerView: (CPView aView
implementation

Sets the cornerview for the scrollview

Definition at line 1650 of file CPTableView.j.

◆ setDataSource:()

- (void) setDataSource: (id <CPTableViewDataSource>)  aDataSource
implementation

Sets the receiver's data source to a given object. The data source implements various methods for handling the tableview's data when bindings are not used.

Parameters
anObjectThe data source for the receiver. This object must implement numberOfRowsInTableView: and tableView:objectValueForTableColumn:row:
These methods are outlined below.

Overview

CPTableView generally requires a datasource to run. This data source can be thought of just like a delegate, but specifically for the tableview data. Methods include:

You must implement these data source methods:

Returns the number of rows in the tableview

- (int)numberOfRowsInTableView:(CPTableView)aTableView;

Returns the object value for each dataview. Each dataview will be sent a setObjectValue: method which will contain the object you return from this datasource method.

- (id)tableView:(CPTableView)aTableView objectValueForTableColumn:(CPTableColumn)aColumn row:(CPInteger)aRowIndex;

Editing:

Sets the data object for an item in a given row and column. This needs to be implemented if you want inline editing support

- (void)tableView:(CPTableView)aTableView setObjectValue:(id)anObject forTableColumn:(CPTableColumn)aTableColumn row:(CPInteger)rowIndex;

Sorting:

The tableview will call this method if you click the tableheader. You should sort the datasource based off of the new sort descriptors and reload the data

- (void)tableView:(CPTableView)aTableView sortDescriptorsDidChange:(CPArray)oldDescriptors;

Drag and Drop:

Note
In order for the tableview to receive drops don't forget to first register the tableview for drag types like you do with every other view.

Return the drag operation (move, copy, etc) that should be performed if a registered drag type is over the tableview The data source can retarget a drop if you want by calling

-(void)setDropRow:(CPInteger)aRow dropOperation:(CPTableViewDropOperation)anOperation;
- (CPDragOperation)tableView:(CPTableView)aTableView validateDrop:(CPDraggingInfo)info proposedRow:(CPInteger)row proposedDropOperation:(CPTableViewDropOperation)operation;

Returns YES if the drop operation is allowed otherwise NO. This method is invoked by the tableview after a drag should begin, but before it is started. If you don't want the drag to being return NO. If you want the drag to begin you should return YES and place the drag data on the pboard.

- (BOOL)tableView:(CPTableView)aTableView writeRowsWithIndexes:(CPIndexSet)rowIndexes toPasteboard:(CPPasteboard)pboard;

Return YES if the operation was successful otherwise return NO. The data source should incorporate the data from the dragging pasteboard in this method implementation. To get this data use the draggingPasteboard method on the CPDraggingInfo object.

- (BOOL)tableView:(CPTableView)aTableView acceptDrop:(CPDraggingInfo)info row:(CPInteger)row dropOperation:(CPTableViewDropOperation)operation;

NOT YET IMPLEMENTED

- (CPArray)tableView:(CPTableView)aTableView namesOfPromisedFilesDroppedAtDestination:(CPURL)dropDestination forDraggedRowsWithIndexes:(CPIndexSet)indexSet;

Definition at line 547 of file CPTableView.j.

◆ setDelegate:()

- (void) setDelegate: (id <CPTableViewDelegate>)  aDelegate
implementation

Sets the delegate of the receiver.

Parameters
aDelegatethe delegate object for the tableview.
The delegate can provide notification for user interaction, display behaviour, contextual menus, and more.

Views for Rows and Columns:

Returns the view used to display the specified row and column.

- (CPView)tableView:(CPTableView)tableView viewForTableColumn:(CPTableColumn)tableColumn row:(CPInteger)row
Parameters
Theview to display the specified column and row. Returning nil is acceptable, and a view will not be shown at that location.

This method is required if you wish to use a view-based table view in Interface builder or cell-based table views without using CPTableColumn's setDataView: method.

It is recommended that the implementation of this method first call the CPTableView method makeViewWithIdentifier:owner: passing, respectively, the tableColumn parameter’s identifier and self as the owner to attempt to reuse a view that is no longer visible. The frame of the view returned by this method is not important, and it will be automatically set by the table.

The view's properties should be properly set up before returning the result. The delegate do not need to implement tableview:objectValueforTableColumn:row:.

When using bindings, this method is optional if at least one identifier has been associated with the table view at design time. If this method is not implemented, the table will automatically call the CPTableView method makeViewWithIdentifier:owner: with the tableColumn parameter’s identifier and the table view’s delegate respectively as parameters, to attempt to reuse a previous view, or automatically unarchive a prototype associated with the table view.

The autoresizingMask of the returned view will automatically be set to CPViewNotSizable if the data view was created in Interface builder in a table column. Otherwise, for example if the view is created manually in code, this method expects the data view to have a CPViewNotSizable mask.

Displaying Cells:

Called when the tableview is about to display a dataview

- (void)tableView:(CPTableView)aTableView willDisplayView:(id)aView forTableColumn:(CPTableColumn)aTableColumn row:(CPInteger)rowIndex;

Group rows are a way to separate a groups of data in a tableview. Return YES if the given row is a group row, otherwise NO.

- (BOOL)tableView:(CPTableView)tableView isGroupRow:(CPInteger)row;

Editing Cells:

Return YES if the dataview at a given index and column should be edited, otherwise NO.

- (BOOL)tableView:(CPTableView)aTableView shouldEditTableColumn:(CPTableColumn)aTableColumn row:(CPInteger)rowIndex;

Setting Row and Column Size:

Return the height of the row at a given index. Only implement this if you want variable row heights. Otherwise use setRowHeight: on the tableview.

- (float)tableView:(CPTableView)tableView heightOfRow:(CPInteger)row;

Selection:

Note
These methods are only called when the user does something.

Return YES if the selection of the tableview should change, otherwise NO to keep the current selection.

- (BOOL)selectionShouldChangeInTableView:(CPTableView)aTableView;

Return YES if the row at a given index should be selected, other NO to deny the selection.

- (BOOL)tableView:(CPTableView)aTableView shouldSelectRow:(CPInteger)rowIndex;

Return YES if the table column given should be selected, otherwise NO to deny the selection.

- (BOOL)tableView:(CPTableView)aTableView shouldSelectTableColumn:(CPTableColumn)aTableColumn;

Informs the delegate that the tableview is in the process of changing the selection. This usually happens when the user is dragging their mouse across rows.

- (void)tableViewSelectionIsChanging:(CPNotification)aNotification

Informs the delegate that the tableview selection has changed.

- (void)tableViewSelectionDidChange:(CPNotification)aNotification;

Moving and Resizing Columns:

Return YES if the column at a given index should move to a new column index, otherwise NO. When a column is initially dragged by the user, the delegate is first called with a newColumnIndex value of -1

- (BOOL)tableView:(CPTableView)tableView shouldReorderColumn:(CPInteger)columnIndex toColumn:(CPInteger)newColumnIndex;

Notifies the delegate that the tableview drag occurred. This is sent on mouse up.

- (void)tableView:(CPTableView)tableView didDragTableColumn:(CPTableColumn)tableColumn;

Notifies the delegate that a table column was moved by the user.

- (void)tableViewColumnDidMove:(CPNotification)aNotification;

Notifies the delegate that the user resized the table column

- (void)tableViewColumnDidResize:(CPNotification)aNotification;

Responding to Mouse Events:

Sent when the user clicks a table column but doesn't drag.

- (void)tableView:(CPTableView)tableView didClickTableColumn:(CPTableColumn)tableColumn;

Notify the delegate that the user has clicked the table header of a column.

- (void)tableView:(CPTableView)tableView mouseDownInHeaderOfTableColumn:(CPTableColumn)tableColumn;

Contextual Menus:

Called when the user right-clicks on the tableview. -1 is passed for the row or column if the user doesn't right click on a real row or column Return a CPMenu that should be displayed if the user right-clicks. If you do not implement this the tableview will call super on menuForEvent

- (CPMenu)tableView:(CPTableView)aTableView menuForTableColumn:(CPTableColumn)aColumn row:(CPInteger)aRow;

Delete Key

Called when the user presses the delete key. Many times you will want to delete data (or prompt for deletion) when the user presses the delete key. Your delegate can implement this method to avoid subclassing the tableview to add this behaviour.

- (void)tableViewDeleteKeyPressed:(CPTableView)aTableView;

Definition at line 2793 of file CPTableView.j.

◆ setDisableAutomaticResizing:()

- (void) setDisableAutomaticResizing: (BOOL)  aValue
implementation

Synthesized accessor method.

Provided by category CPTableView(CPSynthesizedAccessors).

Definition at line 6434 of file CPTableView.j.

◆ setDoubleAction:()

- (void) setDoubleAction: (SEL)  anAction
implementation

Sets the message sent to the target when the user double-clicks an uneditable cell or a column header to a given selector.

Parameters
aSelectorThe message the receiver sends to its target when the user double-clicks an uneditable cell or a column header.

Definition at line 662 of file CPTableView.j.

◆ setDraggingDestinationFeedbackStyle:()

- (void) setDraggingDestinationFeedbackStyle: (CPTableViewDraggingDestinationFeedbackStyle)  aStyle
implementation

Sets the feedback style for when the table is the destination of a drag operation. This style is used to determine how the tableview looks when it is the receiver of a drag and drop operation.

Can be:

        CPTableViewDraggingDestinationFeedbackStyleNone
        CPTableViewDraggingDestinationFeedbackStyleRegular
        CPTableViewDraggingDestinationFeedbackStyleSourceList

Definition at line 3228 of file CPTableView.j.

◆ setDraggingSourceOperationMask:forLocal:()

- (void) setDraggingSourceOperationMask: (CPDragOperation)  mask
forLocal: (BOOL)  isLocal 
implementation

Sets the default operation mask for the drag behavior of the table view.

Note
isLocal is not implemented.

Definition at line 3191 of file CPTableView.j.

◆ setDropRow:dropOperation:()

- (void) setDropRow: (CPInteger)  row
dropOperation: (CPTableViewDropOperation)  operation 
implementation

This should be called inside tableView:validateDrop:... method either CPTableViewDropOn or CPTableViewDropAbove, Specify the row as -1 to select the whole table for drop on.

Definition at line 3202 of file CPTableView.j.

◆ setFrameOrigin:()

- (void) setFrameOrigin: (CGPoint)  aPoint
implementation

Reimplemented from CPView.

Definition at line 3937 of file CPTableView.j.

◆ setFrameSize:()

- (void) setFrameSize: (CGSize)  aSize
implementation

we override here because we have to adjust the header

Reimplemented from CPView.

Definition at line 3924 of file CPTableView.j.

◆ setGridColor:()

- (void) setGridColor: (CPColor aColor
implementation

Sets the grid color in the non highlighted state.

Parameters
aColora CPColor

Definition at line 1033 of file CPTableView.j.

◆ setGridStyleMask:()

- (void) setGridStyleMask: (unsigned)  aGrideStyleMask
implementation

Sets the grid style mask to specify if no grid lines, vertical grid lines, or horizontal grid lines should be displayed.

Parameters
gridTypeThe grid style mask. CPTableViewGridNone, CPTableViewSolidVerticalGridLineMask, CPTableViewSolidHorizontalGridLineMask

Definition at line 1053 of file CPTableView.j.

◆ setHeaderView:()

- (void) setHeaderView: (CPView aHeaderView
implementation

Sets the headerview for the tableview. This is the container view for the table column header views. This view also handles events for resizing and dragging.

If you don't want your tableview to have a headerview you should pass nil. (also see setCornerView:) If you're looking to customize the header text of a column see CPTableColumn's -(CPView)headerView; method.

Definition at line 1679 of file CPTableView.j.

◆ setHighlightedTableColumn:()

- (void) setHighlightedTableColumn: (CPTableColumn aTableColumn
implementation

Sets the table column for which the header should be highlighted.

Definition at line 3019 of file CPTableView.j.

◆ setIndicatorImage:inTableColumn:()

- (void) setIndicatorImage: (CPImage anImage
inTableColumn: (CPTableColumn aTableColumn 
implementation

Sets the indicator image of aTableColumn to anImage. The tableview will set the sort indicator images automatically; if you want a different image you can supply it here.

Parameters
anImagethe image for the column
aTableColumnthe table column object for which to set the image

Definition at line 2982 of file CPTableView.j.

◆ setIntercellSpacing:()

- (void) setIntercellSpacing: (CGSize)  aSize
implementation

Sets the width and height between dataviews. This value is (3.0, 2.0) by default.

Parameters
aSizea CGSize object that defines the space between the cells

Definition at line 788 of file CPTableView.j.

◆ setNeedsDisplay:()

- (void) setNeedsDisplay: (BOOL)  aFlag
implementation

Reimplemented from CPView.

Definition at line 3967 of file CPTableView.j.

◆ setNeedsLayout()

- (void) setNeedsLayout
implementation

Reimplemented from CPView.

Definition at line 3978 of file CPTableView.j.

◆ setRowHeight:()

- (void) setRowHeight: (unsigned)  aRowHeight
implementation

Sets the height of each row.

Note
This may still used even if variable row height is being used.
Parameters
aRowHeightthe height of each row

Definition at line 818 of file CPTableView.j.

◆ setSelectionGradientColors:()

- (void) setSelectionGradientColors: (CPDictionary aDictionary
implementation

Sets the highlight gradient for a row or column selection This is specific to the

Parameters
aDictionarya CPDictionary expects three keys to be set:
        CPSourceListGradient which is a CGGradient
        CPSourceListTopLineColor which is a CPColor
        CPSourceListBottomLineColor which is a CPColor

Definition at line 962 of file CPTableView.j.

◆ setSelectionHighlightColor:()

- (void) setSelectionHighlightColor: (CPColor aColor
implementation

Sets the highlight color for a row or column selection.

Parameters
aColora CPColor

Definition at line 923 of file CPTableView.j.

◆ setSelectionHighlightStyle:()

- (void) setSelectionHighlightStyle: (unsigned)  aSelectionHighlightStyle
implementation

Sets the selection highlight style to an enumerated value. This value can also affect the way the tableview draws feedback when the user is dragging.

Valid values are:

        CPTableViewSelectionHighlightStyleNone
        CPTableViewSelectionHighlightStyleRegular
        CPTableViewSelectionHighlightStyleSourceList

Definition at line 904 of file CPTableView.j.

◆ setSortDescriptors:()

- (void) setSortDescriptors: (CPArray)  sortDescriptors
implementation

Sets the table view's CPSortDescriptors objects in an array.

Parameters
sortDescriptorsan array of sort descriptors.

Definition at line 3294 of file CPTableView.j.

◆ setUsesAlternatingRowBackgroundColors:()

- (void) setUsesAlternatingRowBackgroundColors: (BOOL)  shouldUseAlternatingRowBackgroundColors
implementation

Sets whether the receiver uses the standard alternating row colors for its background.

Parameters
aFlagYES to specify standard alternating row colors for the background, NO to specify a solid color.

Definition at line 844 of file CPTableView.j.

◆ setVerticalMotionCanBeginDrag:()

- (void) setVerticalMotionCanBeginDrag: (BOOL)  aFlag
implementation

Sets whether vertical motion is treated as a drag or selection change to flag.

Parameters
aFlagif flag is NO then vertical motion will not start a drag. The default is YES.

Definition at line 3254 of file CPTableView.j.

◆ sizeLastColumnToFit()

- (void) sizeLastColumnToFit
implementation

Resizes the last column if there's room so the receiver fits exactly within its enclosing clip view.

Definition at line 2337 of file CPTableView.j.

◆ sortDescriptors()

- (CPArray) sortDescriptors
implementation

Returns an array of the current sort descriptors currently used by the table.

Definition at line 3335 of file CPTableView.j.

◆ startTrackingAt:()

- (BOOL) startTrackingAt: (CGPoint)  aPoint
implementation

Reimplemented from CPControl.

Definition at line 4460 of file CPTableView.j.

◆ stopTracking:at:mouseIsUp:()

- (void) stopTracking: (CGPoint)  lastPoint
at: (CGPoint)  aPoint
mouseIsUp: (BOOL)  mouseIsUp 
implementation

Reimplemented from CPControl.

Definition at line 4630 of file CPTableView.j.

◆ superviewBoundsChanged:()

- (void) superviewBoundsChanged: (CPNotification aNotification
implementation

Definition at line 4431 of file CPTableView.j.

◆ superviewFrameChanged:()

- (void) superviewFrameChanged: (CPNotification aNotification
implementation

Definition at line 4442 of file CPTableView.j.

◆ tableColumns()

- (CPArray) tableColumns
implementation

Returns an array of CPTableColumns of all the receiver's columns.

Definition at line 1244 of file CPTableView.j.

◆ tableColumnWithIdentifier:()

- (CPTableColumn) tableColumnWithIdentifier: (CPString anIdentifier
implementation

Returns the CPTableColumn object with the given identifier string.

Parameters
anIdentifierthe string value of the identifier
Returns
a CPTableColumn object with the given identifier

Definition at line 1273 of file CPTableView.j.

◆ themeAttributes()

+ (CPDictionary) themeAttributes
implementation

Reimplemented from CPControl.

Definition at line 323 of file CPTableView.j.

◆ tile()

- (void) tile
implementation

Lays out the dataviews and resizes the tableview so that everything fits.

Definition at line 2458 of file CPTableView.j.

◆ trackMouse:()

- (void) trackMouse: (CPEvent anEvent
implementation

Reimplemented from CPControl.

Definition at line 4522 of file CPTableView.j.

◆ tracksMouseOutsideOfFrame()

- (BOOL) tracksMouseOutsideOfFrame
implementation

Returns YES if the receiver tracks the mouse outside the frame, otherwise NO.

Reimplemented from CPControl.

Definition at line 4452 of file CPTableView.j.

◆ unfocusedSelectionGradientColors()

- (CPColor) unfocusedSelectionGradientColors
implementation

Returns a dictionary of containing the keys:

    CPSourceListGradient
    CPSourceListTopLineColor
    CPSourceListBottomLineColor

Definition at line 990 of file CPTableView.j.

◆ unfocusedSelectionHighlightColor()

- (CPColor) unfocusedSelectionHighlightColor
implementation

Returns the highlight color for an unfocused row or column selection.

Definition at line 943 of file CPTableView.j.

◆ usesAlternatingRowBackgroundColors()

- (BOOL) usesAlternatingRowBackgroundColors
implementation

Returns YES if the tableview uses alternating row background colors, otherwise NO.

Definition at line 852 of file CPTableView.j.

◆ verticalMotionCanBeginDrag()

- (BOOL) verticalMotionCanBeginDrag
implementation

Returns YES if vertical motion can begin a drag of the tableview, otherwise NO.

Definition at line 3262 of file CPTableView.j.

◆ viewAtColumn:row:makeIfNecessary:()

- (id) viewAtColumn: (CPInteger)  column
row: (CPInteger)  row
makeIfNecessary: (BOOL)  makeIfNecessary 
implementation

Returns an instance of CPView

Parameters
columnThe index of the column in the tableColumn array
rowThe index of the row
makeIfNecessaryYES if a view is required, NO if you want to update properties on a view, if one is available.

This method first attempts to return an available view, which is generally in the visible area. If there is no available view, and makeIfNecessary is YES, a prepared temporary view is returned. If makeIfNecessary is NO, and the view is not available, nil will be returned.

An exception will be thrown if row is an invalid row index and if column is an invalid column index

Definition at line 3719 of file CPTableView.j.

◆ viewWillMoveToSuperview:()

- (void) viewWillMoveToSuperview: (CPView aView
implementation

Reimplemented from CPView.

Definition at line 4413 of file CPTableView.j.

◆ viewWillMoveToWindow:()

- (void) viewWillMoveToWindow: (CPWindow aWindow
implementation

Called when the receiver is about to be moved to a new window.

Parameters
aWindowthe window to which the receiver will be moved.

Reimplemented from CPView.

Definition at line 5116 of file CPTableView.j.

◆ wantsPeriodicDraggingUpdates()

- (BOOL) wantsPeriodicDraggingUpdates
implementation

Definition at line 4750 of file CPTableView.j.


The documentation for this class was generated from the following files: