CPObjectCPResponder
CPView
CPControl
CPTableView
@implementation CPTableView : CPControl
CPTableView
is located within the AppKit framework and is used to display tables. It uses a delegate model for getting its data i.e. you give it an object that provides it with the data it should display.
Method Summary | |
---|---|
-(id) | initWithFrame:(CGRect)aFrame Initializes the receiver for usage with the specified bounding rectangle. |
-(void) | addTableColumn:(CPTableColumn)aTableColumn Adds a column to the table. |
-(float) | columnHeight Returns the table's column height. |
-(id) | dataSource Returns the object that has access to the table data. |
-(CGSize) | intercellSpacing Returns the width and height of the space between cells. |
-(void) | loadTableCellsInRect:(CGRect)aRect |
-(void) | moveColumn:(unsigned)fromIndex toColumn:(unsinged)toIndex Not yet implemented. |
-(void) | noteNumberOfRowsChanged Tells the table view that the number of rows in the table has changed. |
-(int) | numberOfColumns Returns the number of columns in the table. |
-(int) | numberOfRows Returns the number of rows in the table. |
-(CGRect) | rectOfColumn:(int)aColumnIndex Returns the rectangle bounding the specified column. |
-(CGRect) | rectOfRow:(int)aRowIndex Returns the rectangle bounding the specified row. |
-(void) | reloadData Reloads the data from the dataSource . |
-(void) | removeTableColumn:(CPTableColumn)aTableColumn Removes a column from the table. |
-(unsigned) | rowHeight Returns the height of a table row. |
-(void) | setDataSource:(id)aDataSource Sets the object that is used to obtain the table data. |
-(void) | setFrameSize:(CGSize)aSize Sets the receiver's frame size. |
-(void) | setIntercellSpacing:(CGSize)aSize Sets the width and height between cell. |
-(void) | setRowHeight:(unsigned)aRowHeight Sets the height of table rows. |
-(void) | sizeToFit Adjusts column widths to make them all visible at once. |
-(CPArray) | tableColumns Returns an array containing the table's CPTableColumn s. |
-(void) | tile Adjusts the size of the table and it's header view. |
Methods inherited from class CPControl |
---|
initWithFrame, action, alignment, backgroundColorForName, floatValue, font, isEnabled, mouseUp, sendAction, setAction, setAlignment, setBackgroundColor, setBackgroundColorWithName, setBackgroundColor, setEnabled, setFloatValue, setFont, setTarget, setTextColor, setTextShadow, target, textColor, textShadow |
Method Detail |
---|
-(id)initWithFrame:(CGRect)aFrame
aFrame
-(void)addTableColumn:(CPTableColumn)aTableColumn
aTableColumn
- the column to be added-(float)columnHeight
-(id)dataSource
-(CGSize)intercellSpacing
-(void)loadTableCellsInRect:(CGRect)aRect
aRect
-(void)moveColumn:(unsigned)fromIndex toColumn:(unsinged)toIndex
fromIndex
- the original index of the columntoIndex
- the desired index of the column-(void)noteNumberOfRowsChanged
-(int)numberOfColumns
-(int)numberOfRows
-(CGRect)rectOfColumn:(int)aColumnIndex
aColumnIndex
- the column to obtain a rectangle for-(CGRect)rectOfRow:(int)aRowIndex
aRowIndex
- the row to obtain a rectangle for-(void)reloadData
dataSource
. This is an
expensive method, so use it lightly.-(void)removeTableColumn:(CPTableColumn)aTableColumn
aTableColumn
- the column to remove-(unsigned)rowHeight
-(void)setDataSource:(id)aDataSource
- (int)numberOfRowsInTableView:(CPTableView
)aTableView - (id)tableView:(CPTableView
)aTableView objectValueForTableColumn:(CPTableColumn
)aTableColumn row:(int)rowIndex
aDataSource
- the object with the table dataCPInternalInconsistencyException
- if aDataSource
doesn't implement all the required methods-(void)setFrameSize:(CGSize)aSize
aSize
is the same as the frame's current dimensions, this
method simply returns. The method posts a CPViewFrameDidChangeNotification
to the
default notification center if the receiver is configured to do so.aSize
- the new size for the frame-(void)setIntercellSpacing:(CGSize)aSize
aSize
-(void)setRowHeight:(unsigned)aRowHeight
aRowHeight
- the new height of the table rows-(void)sizeToFit
tile
.-(CPArray)tableColumns
CPTableColumn
s.-(void)tile
Created on Sat Sep 13 14:15:43 PDT 2008