Overview
It's hard to implement all the necessary logic to make sure object selections behave as users expect. Even the built-in AppKit views differ in the nuances of selection and dragging behaviour. Wouldn't it be great if this came "for free" instead? TLSelectionManager is an attempt to offer just that.
TLSelectionManager is intended to make it easy for applications to follow the Human Interface Guidelines and best practices for object selection. This class maintains selection state, updating based on mouse/modifier events. It is intended to be used in conjunction with a custom view, and makes very few assumptions about the contents of the view.
Known issues
- Our goal is to contain all the fussy selection logic inside this class, so that custom views can get proper selection behaviour "for free". The current focus is on mouse+modifier events, since that was the focus of the original project. Support needs to be added for keyboard-based selection. Patches welcome.
- This is used in shipping code, but in a limited number of circumstances. There may be assumptions we overlooked that make it trickier to use in other projects than it should be.
- The selection behaviours are certainly up for debate. Even the built-in AppKit views differ in their behaviour. Please file bugs/patches if you strongly disagree with a choice that TLSelectionManager makes.
- While there are some stub code examples in UsingSelectionManager, we really should make a sample project to demonstrate the selection manager in action.
- No unit tests. We are bad, bad persons.
Contributions
In the spirit of open source, we welcome (and even expect!) bug reports, feature requests, and patches. However, as the goal of this project is to be a standard, widely useful helper class for selection management, we want to make sure the code stays as simple and generic as possible. You're welcome to share app-specific patches, but we may not include every feature or patch in the main branch.
NOTE: We are planning to transition this project to Mercurial as soon as we can, for all your DVCS needs. In the meantime, contributions are still welcome. Please use the Issues tab for feedback at this time, or drop us an email at the Calf Trail support address.