Guest User

Untitled

a guest
Oct 20th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. - (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:(NSRect)frame ofView:(NSView *)controlView {
  2.  
  3. NSRect checkBoxFrame = [self _checkBoxFrameForInteriorFrame:frame];
  4.  
  5. NSPoint point = [controlView convertPoint:[event locationInWindow] fromView:nil];
  6. // Delegate hit testing to other cells
  7. if (_checkBoxCell) {
  8. if (NSPointInRect(point, checkBoxFrame)) {
  9. return NSCellHitTrackableArea;
  10. }
  11. }
  12.  
  13. return NSCellHitNone;
  14. }
  15.  
  16.  
  17.  
  18. + (BOOL)prefersTrackingUntilMouseUp {
  19. // you want a single, long tracking "session" from mouse down till up
  20. return YES;
  21. }
  22.  
  23. - (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView {
  24.  
  25. [_checkBoxCell setHighlighted:YES];
  26. return YES; // keep tracking
  27. }
  28.  
  29. - (BOOL)continueTracking:(NSPoint)lastPoint at:(NSPoint)currentPoint inView:(NSView *)controlView {
  30. // if |currentPoint| is in the button, highlight it
  31. // otherwise, unhighlight it
  32. return YES; // keep on tracking
  33. }
  34.  
  35. - (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:(NSView *)controlView mouseIsUp:(BOOL)flag {
  36. // if |flag| and mouse in button's rect, then
  37. // and, finally,
  38. }
Add Comment
Please, Sign In to add comment