mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 08:30:59 +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
|
@ -1,3 +1,8 @@
|
|||
2014-01-26 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSCell.h
|
||||
* Source/NSCell.m: Add hitTestForEvent:inRect:ofView:.
|
||||
|
||||
2014-01-26 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/GSThemeDrawing.m (-drawTableViewRow:clipRect:inView:):
|
||||
|
|
|
@ -146,6 +146,15 @@ enum {
|
|||
};
|
||||
typedef NSUInteger NSImageScaling;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
|
||||
enum {
|
||||
NSCellHitNone = 0,
|
||||
NSCellHitContentArea = 1,
|
||||
NSCellHitEditableTextArea = 2,
|
||||
NSCellHitTrackableArea = 4
|
||||
};
|
||||
#endif
|
||||
|
||||
@interface NSCell : NSObject <NSCopying, NSCoding>
|
||||
{
|
||||
// Attributes
|
||||
|
@ -429,6 +438,11 @@ typedef NSUInteger NSImageScaling;
|
|||
inRect:(NSRect)cellFrame
|
||||
ofView:(NSView *)controlView
|
||||
untilMouseUp:(BOOL)flag;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
|
||||
- (NSUInteger)hitTestForEvent:(NSEvent *)event
|
||||
inRect:(NSRect)cellFrame
|
||||
ofView:(NSView *)controlView;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Managing the Cursor
|
||||
|
|
|
@ -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…
Reference in a new issue