Doc fixes and more docs in the tableview.

This commit is contained in:
Randall Luecke committed 2011-01-20 03:07:01 -05:00
1 parent 4458884048
commit f07543045a
2 files changed
+76 -7

No files matched your search

+49 -3
View File
@@ -40,6 +40,9 @@ CPTableColumnUserResizingMask = 1 << 1;
A CPTableColumn determines its own size constrains and resizing behaviour.
The default dataview is a CPTextField but you can set it to any view you'd like. See -setDataView: for documentaion including theme states.
To customize the text of the column header you can simply call setStringValue: on the headerview of a table column.
For example: [[myTableColumn headerView] setStringValue:"My Title"];
*/
@implementation CPTableColumn : CPObject
{
@@ -296,7 +299,12 @@ CPTableColumnUserResizingMask = 1 << 1;
/*!
Sets the header view for the column.
The headerview handles the display of sort indicators, text, etc
The headerview handles the display of sort indicators, text, etc.
If you do not want a headerview for you table you should call setHeaderView: on your CPTableView instance.
Passing nil here will throw an exception.
In order to customize the text of the column header see - (CPView)headerView;
*/
- (void)setHeaderView:(CPView)aView
{
@@ -312,7 +320,10 @@ CPTableColumnUserResizingMask = 1 << 1;
}
/*!
Returns the headerview for the column
Returns the headerview for the column.
In order to change the text of the headerview for a column you should call setStringValue: on the headerview.
For example: [[myTableColumn headerView] setStringValue:"My Column"];
*/
- (CPView)headerView
{
@@ -542,6 +553,15 @@ CPTableColumnUserResizingMask = 1 << 1;
@end
@implementation CPTableColumn (Bindings)
/*!
Binds the reciever to an object.
@param CPString aBinding - The binding you wish to make. Typically CPValueBinding.
@param id anObject - The object to bind the reciever to.
@param CPString aKeyPath - The key path you wish to bind the reciver to.
@param CPDictionary options - A dictionary of options for the binding. This paramater is optional, pass nil if you do not wish to use it.
*/
- (void)bind:(CPString)aBinding toObject:(id)anObject withKeyPath:(CPString)aKeyPath options:(CPDictionary)options
{
[super bind:aBinding toObject:anObject withKeyPath:aKeyPath options:options];
@@ -550,6 +570,9 @@ CPTableColumnUserResizingMask = 1 << 1;
[[self tableView] _establishBindingsIfUnbound:anObject];
}
/*!
@ignore
*/
- (void)prepareDataView:(CPView)aDataView forRow:(unsigned)aRow
{
var bindingsDictionary = [CPBinder allBindingsForObject:self],
@@ -601,6 +624,9 @@ CPTableColumnUserResizingMask = 1 << 1;
// return nil;
//}
/*!
@ignore
*/
- (void)setValue:(CPArray)content
{
[[self tableView] reloadData];
@@ -621,6 +647,9 @@ var CPTableColumnIdentifierKey = @"CPTableColumnIdentifierKey",
@implementation CPTableColumn (CPCoding)
/*!
@ignore
*/
- (id)initWithCoder:(CPCoder)aCoder
{
self = [super init];
@@ -648,6 +677,9 @@ var CPTableColumnIdentifierKey = @"CPTableColumnIdentifierKey",
return self;
}
/*!
@ignore
*/
- (void)encodeWithCoder:(CPCoder)aCoder
{
[aCoder encodeObject:_identifier forKey:CPTableColumnIdentifierKey];
@@ -669,31 +701,45 @@ var CPTableColumnIdentifierKey = @"CPTableColumnIdentifierKey",
@end
@implementation CPTableColumn (NSInCompatibility)
/*!
@ignore
*/
- (void)setHeaderCell:(CPView)aView
{
[CPException raise:CPUnsupportedMethodException
reason:@"setHeaderCell: is not supported. Use -setHeaderView:aView instead."];
}
/*!
@ignore
*/
- (CPView)headerCell
{
[CPException raise:CPUnsupportedMethodException
reason:@"headCell is not supported. Use -headerView instead."];
}
/*!
@ignore
*/
- (void)setDataCell:(CPView)aView
{
[CPException raise:CPUnsupportedMethodException
reason:@"setDataCell: is not supported. Use -setDataView:aView instead."];
}
/*!
@ignore
*/
- (CPView)dataCell
{
[CPException raise:CPUnsupportedMethodException
reason:@"dataCell is not supported. Use -dataView instead."];
}
/*!
@ignore
*/
- (id)dataCellForRow:(int)row
{
[CPException raise:CPUnsupportedMethodException
+27 -4
View File
@@ -147,7 +147,9 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
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 CPColumn object. More documentation in that class including theme states.
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.
*/
@implementation CPTableView : CPControl
{
@@ -577,6 +579,11 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
_allowsMultipleSelection = !!shouldAllowMultipleSelection;
}
/*!
Returns YES if the tableview is allowed to have multiple selections, otherwise NO.
@return BOOL - YES if the tableview is allowed to have multiple selections otherwise NO.
*/
- (BOOL)allowsMultipleSelection
{
return _allowsMultipleSelection;
@@ -1453,7 +1460,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
}
/*!
Returns the headerview for the receiver. The headerview contains column headerviews for each table column
Returns the headerview for the receiver. The headerview contains column headerviews for each table column.
*/
- (CPView)headerView
{
@@ -1462,8 +1469,11 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
/*!
Sets the headerview for the tableview. This is the container view for the table column header views
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 dont 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.
*/
- (void)setHeaderView:(CPView)aHeaderView
{
@@ -2683,7 +2693,9 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
}
/*!
Computes and returns a view to use for dragging
Computes and returns a view to use for dragging. By default this is a slighly transparent copy of the dataviews which are being dragged.
You can override this in a subclas 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.
@param dragRows an index set with the dragged row indexes
@param theTableColumns an array of the table columns which are being dragged
@@ -2814,6 +2826,8 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
/*!
<pre>
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 reciever of a drag and drop operation.
Can be:
CPTableViewDraggingDestinationFeedbackStyleNone
CPTableViewDraggingDestinationFeedbackStyleRegular
@@ -3391,6 +3405,8 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
/*!
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:
*/
- (void)drawBackgroundInClipRect:(CGRect)aRect
{
@@ -3444,6 +3460,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
/*!
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:
*/
- (void)drawGridInClipRect:(CGRect)aRect
{
@@ -3519,6 +3536,8 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
/*!
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:
*/
- (void)highlightSelectionInClipRect:(CGRect)aRect
{
@@ -4089,6 +4108,9 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
[self _draggingEnded];
}
/*!
@ignore
*/
- (void)_draggingEnded
{
_retargetedDropOperation = nil;
@@ -4096,6 +4118,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
_draggedRowIndexes = [CPIndexSet indexSet];
[_dropOperationFeedbackView removeFromSuperview];
}
/*
@ignore
*/