DSVColumnView.st
changeset 2445 df54aa1128b3
parent 2398 bea17c9648e4
child 2458 0411397ef0a2
--- a/DSVColumnView.st	Tue Feb 25 18:10:16 2003 +0100
+++ b/DSVColumnView.st	Tue Feb 25 18:34:27 2003 +0100
@@ -2045,18 +2045,20 @@
     "
     |colNr rowNr lsize found column|
 
-    (rowIfAbsentBlock notNil 
-     or:[x isNil
-     or:[(colNr := self xVisibleToColNr:x) isNil]]) ifTrue:[
-        ^ self
-    ].
+    lsize  := list size.
+
+"/    (rowIfAbsentBlock notNil 
+"/     or:[x isNil
+"/     or:[(colNr := self xVisibleToColNr:x) isNil]]) ifTrue:[
+"/        ^ self
+"/    ].
+    colNr := self findFirstColumnWithStringFrom:1 to:lsize.
     rowNr  := self lastIndexSelected.
-    lsize  := list size.
     column := self columnAt:colNr.
     found  := 0.
 
     lsize > rowNr ifTrue:[
-     "/ search to end
+        "/ search to end
         found := column findRowNrStartingWithChar:aChar start:(rowNr + 1) stop:lsize.
     ].
 
@@ -2109,6 +2111,28 @@
     ]
 !
 
+findFirstColumnWithStringFrom:start to:stop
+    start to:stop do:[:eachNr| 
+        |row lbl|
+        row := self at:eachNr.
+        columnDescriptors keysAndValuesDo:[:colNr :col |    
+            lbl := col shownValueForRow:row rowNr:eachNr.
+
+            (lbl isSequenceable and:[lbl isString not]) ifTrue:[
+                lbl := lbl at:1 ifAbsent:nil
+            ].
+
+            (lbl respondsTo:#string) ifTrue:[
+                lbl := lbl string.
+            ].
+            (lbl size > 0 and:[(lbl at:1) isCharacter]) ifTrue:[
+                ^ colNr
+            ]
+        ]
+    ].
+    ^ nil
+!
+
 findMenuForSelection
     "find the middle button menu for the current selection; returns the menu or nil
     "
@@ -3832,5 +3856,5 @@
 !DSVColumnView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.160 2002-12-05 15:20:16 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.161 2003-02-25 17:34:27 penk Exp $'
 ! !