* Headers/AppKit/NSCell.h

* Source/NSCell.m: Add hitTestForEvent:inRect:ofView:.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37639 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2014-01-26 22:34:56 +00:00
parent db2cf18bfe
commit 37e94abc97
3 changed files with 66 additions and 0 deletions

View file

@ -1780,6 +1780,53 @@ static NSColor *dtxtCol;
return NO; // Otherwise return NO
}
- (NSUInteger) hitTestForEvent: (NSEvent*)event
inRect: (NSRect)cellFrame
ofView: (NSView*)controlView
{
if (_cell.type == NSImageCellType)
{
if ((_cell_image != nil) &&
NSMouseInRect([controlView convertPoint: [event locationInWindow]
fromView: nil],
[self imageRectForBounds: [controlView bounds]],
[controlView isFlipped]))
{
return NSCellHitContentArea;
}
else
{
return NSCellHitNone;
}
}
else if (_cell.type == NSTextCellType)
{
if (_contents == nil)
{
return NSCellHitNone;
}
else if (_cell.is_disabled == NO)
{
return NSCellHitContentArea | NSCellHitEditableTextArea;
}
else
{
return NSCellHitContentArea;
}
}
else
{
if (_cell.is_disabled == NO)
{
return NSCellHitContentArea | NSCellHitTrackableArea;
}
else
{
return NSCellHitContentArea;
}
}
}
/** <p>TODO</p>
*/
- (void) resetCursorRect: (NSRect)cellFrame inView: (NSView*)controlView