35 lines
929 B
Objective-C
35 lines
929 B
Objective-C
#import "TrackingCell.h"
|
|
|
|
@implementation TrackingCell
|
|
|
|
- (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView
|
|
{
|
|
tracking = YES;
|
|
return [super startTrackingAt:startPoint inView:controlView];
|
|
|
|
}
|
|
|
|
|
|
- (BOOL)continueTracking:(NSPoint)lastPoint at:(NSPoint)currentPoint inView:(NSView *)controlView
|
|
{
|
|
NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseDragged location:currentPoint modifierFlags:NSLeftMouseDown timestamp:0 windowNumber:[[controlView window] windowNumber] context:nil eventNumber:0 clickCount:0 pressure:0];
|
|
|
|
[controlView mouseDragged:event];
|
|
|
|
return [super continueTracking:lastPoint at:currentPoint inView:controlView];
|
|
}
|
|
|
|
- (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:(NSView *)controlView mouseIsUp:(BOOL)flag
|
|
{
|
|
tracking = NO;
|
|
|
|
[super stopTracking:lastPoint at:stopPoint inView:controlView mouseIsUp:flag];
|
|
}
|
|
|
|
- (BOOL)isTracking
|
|
{
|
|
return tracking;
|
|
}
|
|
|
|
@end
|