Status: New Owner: ---- Labels: Type-Defect Priority-Medium
New issue 894 by benjamin...@gmail.com: Roassal revised ROSelection and example http://code.google.com/p/moose-technology/issues/detail?id=894
Initially I contributed ROSelection as part of the rubberbanding feature. The attached changeset generalizes it a bit and provides the folllowing example of its use.
------------- activeSelection := ROSelection new onInclusion: [ :element | ROHighlightElement on: element color: Color red ]; onExclusion: [ :element | ROUnhighlightElement on: element ]. statusBar := (ROElement on: activeSelection) + (ROLabel text: [ :el | el model asString ]) + ROBox white. view stack add: statusBar. statusBar translateTo: 0 @ 480.
view shape label. view interaction on: ROMouseLeftClick do: [ :ann | activeSelection clear. activeSelection add: ann element. ]. view nodes: #(1 2 3 4 5). view gridLayout. ---------------
There are two things I need help with: 1. Deselecting all elements when clicking on the background.** 2. Multiple selection, which if I knew the right way to work with the announcement events, would conceptually be as simple as the following modification...
[ :ann | ann isShiftClicked ifFalse: [ activeSelection clear ]. activeSelection add: ann element. ].
**may also relate to Issue 884 comment #9 .
Attachments: ROSelectionAndExample.1.cs 1.4 KB