mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-12-04 11:54:59 +00:00
New: toolTips for CPTableView and CPOutlineView
This commit is contained in:
1 parent
14a4b04d9b
commit
f34cbbdf29
2 files changed
+37
-1
No files matched your search
@@ -1512,6 +1512,21 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
|
||||
return [super frameOfDataViewAtColumn:aColumn row:aRow];
|
||||
}
|
||||
|
||||
- (void)_applyToolTipToDataView:(CPView)aDataView forTableColumn:(CPTableColumn)aTableColumn row:(CPInteger)aRow
|
||||
{
|
||||
if (_implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_toolTipForView_rect_tableColumn_item_mouseLocation_)
|
||||
{
|
||||
var item = [self itemAtRow:aRow],
|
||||
tooltip = [self _sendDelegateToolTipForView:aDataView rect:[aDataView frame] tableColumn:aTableColumn item:item mouseLocation:CGPointMakeZero()];
|
||||
|
||||
[aDataView setToolTip:tooltip];
|
||||
}
|
||||
else
|
||||
{
|
||||
[super _applyToolTipToDataView:aDataView forTableColumn:aTableColumn row:aRow];
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
Retargets the drop item for the outlineview.
|
||||
|
||||
@@ -2118,6 +2133,17 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
|
||||
|
||||
/*** CPTableViewDelegate methods ***/
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
*/
|
||||
- (CPString)_sendDelegateToolTipForView:(id)aView rect:(CGRect)aRect tableColumn:(CPTableColumn)aTableColumn item:(id)anItem mouseLocation:(CGPoint)aPoint
|
||||
{
|
||||
if (!(_implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_toolTipForView_rect_tableColumn_item_mouseLocation_))
|
||||
return nil;
|
||||
|
||||
return [_outlineViewDelegate outlineView:self toolTipForView:aView rect:aRect tableColumn:aTableColumn item:anItem mouseLocation:aPoint];
|
||||
}
|
||||
|
||||
- (BOOL)tableView:(CPTableView)theTableView shouldSelectRow:(CPInteger)theRow
|
||||
{
|
||||
return SHOULD_SELECT_ITEM(self, [self itemAtRow:theRow]);
|
||||
|
||||
+11
-1
@@ -3616,10 +3616,21 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
[self _setEditingState:NO forView:dataView];
|
||||
|
||||
[self _sendDelegateWillDisplayView:dataView forTableColumn:tableColumn row:row];
|
||||
[self _applyToolTipToDataView:dataView forTableColumn:tableColumn row:row];
|
||||
|
||||
return dataView;
|
||||
}
|
||||
|
||||
- (void)_applyToolTipToDataView:(CPView)aDataView forTableColumn:(CPTableColumn)aTableColumn row:(CPInteger)aRow
|
||||
{
|
||||
var tooltip = nil;
|
||||
|
||||
if (_implementedDelegateMethods & CPTableViewDelegate_tableView_toolTipForView_rect_tableColumn_row_mouseLocation_)
|
||||
tooltip = [self _sendDelegateToolTipForView:aDataView rect:[aDataView frame] tableColumn:aTableColumn row:aRow mouseLocation:CGPointMakeZero()];
|
||||
|
||||
[aDataView setToolTip:tooltip];
|
||||
}
|
||||
|
||||
- (void)_setObjectValueForTableColumn:(CPTableColumn)aTableColumn row:(CPInteger)aRow forView:(CPView)aDataView
|
||||
{
|
||||
[self _setObjectValueForTableColumn:aTableColumn row:aRow forView:aDataView useCache:!_invalidateObjectValuesCache];
|
||||
@@ -5969,7 +5980,6 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
Not yet implemented
|
||||
*/
|
||||
- (CPString)_sendDelegateToolTipForView:(id)aView rect:(CGRect)aRect tableColumn:(CPTableColumn)aTableColumn row:(CPInteger)aRowIndex mouseLocation:(CGPoint)aPoint
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user