multiple selection

36 views
Skip to first unread message

Cameron Westland

unread,
Mar 16, 2009, 9:14:10 PM3/16/09
to Cappuccino & Objective-J
I posted this over on the development list. I didn't realize there
were two separate things:

I've added a couple commits to my fork of Cappuccino that enables
multiple item selection on CPCollectionView. You could always
programatically select multiple things by passing a CPIndexSet into
setSelectionIndexes:.
Here is what I've added:
toggleIndexInSelection:
http://github.com/camwest/cappuccino/commit/04abd8bad1f3ab870e7d01287...
selectRangeFromIndex:toIndex:
http://github.com/camwest/cappuccino/commit/8a471cc838c029fd0c90e1b13...
Minor Code Tweaks:
http://github.com/camwest/cappuccino/commit/e674dbd99629504502f7c3ddf...
http://github.com/camwest/cappuccino/commit/7bc879b20d1e4627a1cc178cc...
Lighthouse Bug:
http://cappuccino.lighthouseapp.com/projects/16499-cappuccino/tickets...
Basically I copied the rules from a Mac OS X NSCollectionView as
follows:
* Clicking an item while holding CPCommandKeyMask will toggle the
selection of the new index on or off.
* Clicking an item while holding CPShiftKeyMask will extend current
CPIndexSet to include a the range from the last selected index to the
current index.
* Single clicking a new item will de-select.
Also these will not work correctly unless the CPCollectionView
setAllowsMultipleSelection: is set to YES.
Also CPCollectionView's setSelectable: is now obeyed correctly.

Reply all
Reply to author
Forward
0 new messages