NSTableView and its related classes are probably a few of the most abused in the Cocoa API. We make it put icons and text together, feed it strange new NSCells, change its look, subclass it beyond recognition, and call it funny names.
So here's another NSTableView subclass to add to the pile.
In using the table view like the Finder's file view, I wanted to change how it handled mouse and drag events. I ended up completely overriding at the NSDocument level, so this subclass does two things:
First, it adds the boolean isDragDestination. Changing this boolean forces a redraw of the entire table, to remove or put on the hilight color frame. While isDragDestination is YES, setNeedsDisplayInRect: to the table cause the entire table to redraw, in case of scrolling.
Second, almost all of the NSEvents, selectAll, and deselectAll are overridden to let the delegate decide whether or not the table view should handle the event. For example, returning NO in - [tableView:mouseDown:] will cause the table to ignore mouseDown events and allows the delegate to deal with it instead. They're done as a macro in the .m file, so it should be really easy to add new overrides.
They're free to use however you please. If you like them, let me know, but you're under no obligation. Enjoy.
BTHTweakedTableView.h
BTHTweakedTableView.m
