SelectionInListView.st
branchdelegated_gc_text-view-selection-refactoring
changeset 5296 588057883532
parent 5221 d036f1df0408
parent 5295 867e53cc61c6
child 5319 ec87dc43aafb
--- a/SelectionInListView.st	Wed Dec 31 11:25:27 2014 +0100
+++ b/SelectionInListView.st	Mon Feb 16 08:12:24 2015 +0000
@@ -11,6 +11,8 @@
 "
 "{ Package: 'stx:libwidg' }"
 
+"{ NameSpace: Smalltalk }"
+
 ListView subclass:#SelectionInListView
 	instanceVariableNames:'selection actionBlock enabled hilightFgColor hilightBgColor
 		hilightFgColorNoFocus hilightBgColorNoFocus halfIntensityFgColor
@@ -3288,24 +3290,28 @@
      however, if a dragObjectConverter is defined, that one gets a chance
      to convert as appropriate."
 
-    |collection converted|
+    |collection indices converted|
 
     collection := OrderedCollection new.
-
-    self selectionDo:[:aNumber| |text|
+    indices := OrderedCollection new.      
+
+    self selectionDo:[:aNumber| 
+        |text|
+
         text := self at:aNumber.
-        collection add:(DropObject newText:text)
+        collection add:(DropObject newText:text).
+        indices add:aNumber.
     ].
     dragObjectConverter notNil ifTrue:[
         converted := OrderedCollection new.
-        collection do:[:o | 
-                                |convertedObject|
-
-                                convertedObject := dragObjectConverter value:o.
-                                convertedObject notNil ifTrue:[
-                                    converted add:convertedObject
-                                ]
-                      ].
+        collection with:indices do:[:o :idx | 
+            |convertedObject|
+
+            convertedObject := dragObjectConverter value:o optionalArgument:idx.
+            convertedObject notNil ifTrue:[
+                converted add:convertedObject
+            ]
+        ].
         collection := converted
     ].
     ^ collection.
@@ -3320,8 +3326,7 @@
      i.e. it can handle some keyboard input,
      isCursorKeyConsumer are potential candidates for getting the keyboard
      focus initially within dialogBoxes, or when the focus-follows-pointer
-     mode is off.
-     Return false here, this is redefined in SelectionInListView."
+     mode is off."
 
     ^ true
 !
@@ -4183,11 +4188,11 @@
 !SelectionInListView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/SelectionInListView.st,v 1.282 2014-12-03 22:54:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/SelectionInListView.st,v 1.284 2015-02-04 23:14:36 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/SelectionInListView.st,v 1.282 2014-12-03 22:54:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/SelectionInListView.st,v 1.284 2015-02-04 23:14:36 cg Exp $'
 !
 
 version_HG