Skip to content

Instantly share code, notes, and snippets.

@BlairDuncan
Created February 18, 2010 17:40
Show Gist options
  • Save BlairDuncan/307878 to your computer and use it in GitHub Desktop.
Save BlairDuncan/307878 to your computer and use it in GitHub Desktop.
- (void)_updateResizeCursor:(CPEvent)theEvent
{
if(![_tableView allowsColumnResizing] || ![_tableView columnAutoresizingStyle])
{ [[CPCursor arrowCursor] set];
return
}
var mouseLocation = [self convertPoint:[theEvent locationInWindow] fromView:nil],
mouseOverLocation = CGPointMake(mouseLocation.x - 5, mouseLocation.y),
overColumn = [self columnAtPoint:mouseOverLocation];
if (overColumn >= 0 && CGRectContainsPoint([self _cursorRectForColumn:overColumn], mouseLocation))
{
var tableColumn = [[_tableView tableColumns] objectAtIndex:overColumn],
width = [tableColumn width];
if (width == [tableColumn minWidth])
[[CPCursor resizeRightCursor] set];
else if (width == [tableColumn maxWidth])
[[CPCursor resizeLeftCursor] set];
else
[[CPCursor resizeLeftRightCursor] set];
}
else
[[CPCursor arrowCursor] set];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment