mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 08:41:23 +00:00
* 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:
parent
db2cf18bfe
commit
37e94abc97
3 changed files with 66 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue