tabing internal
authorca
Wed, 02 Feb 2000 10:32:16 +0100
changeset 1668 085f5ee84f9b
parent 1667 54c87dace343
child 1669 443680316aac
tabing internal
DSVColumnView.st
--- a/DSVColumnView.st	Tue Feb 01 18:40:59 2000 +0100
+++ b/DSVColumnView.st	Wed Feb 02 10:32:16 2000 +0100
@@ -19,7 +19,7 @@
 		columnDescriptors viewOrigin colorMap rowFontAscent lockRowIndex
 		rowIfAbsentBlock columnHolder registererImages list fgColor
 		separatorSize catchChangeEvents beDependentOfRows bgColor
-		hgLgFgColor hgLgBgColor actionBlock builder
+		hgLgFgColor hgLgBgColor actionBlock builder tabIntern
 		doubleClickActionBlock verticalSpacing horizontalSpacing
 		rowSelectorForm buttonLightColor buttonShadowColor
 		buttonHalfLightColor buttonHalfShadowColor checkToggleExtent
@@ -441,10 +441,6 @@
     ]
 !
 
-handleTab
-    ^ true
-!
-
 multipleSelectOk
     "allow/disallow multiple row selections; the default is false
     "
@@ -472,6 +468,18 @@
     selectRowOnDefault := aBool
 !
 
+tabIntern
+    "returns true if tabing is supported in the widget
+    "
+    ^ tabIntern
+!
+
+tabIntern:aBool
+    "returns true if tabing is supported in the widget
+    "
+    tabIntern := aBool ? true
+!
+
 useIndex
     "specify, if the selected components value or its index in the
      list should be sent to the model. The default is its index.
@@ -1996,7 +2004,7 @@
                           #BeginOfText #EndOfText #ScrollUp #ScrollDown
                           #CursorUp #CursorDown #CursorRight #CursorLeft)>
 
-    |sensor n maxColNr idx selRowNr key column isTab listSize noSel|
+    |sensor n maxColNr idx selRowNr key column isTab listSize noSel hasSelectables|
 
     (sensor := self sensor) isNil ifTrue:[
         ^ self
@@ -2024,6 +2032,18 @@
       ^ self
     ].
 
+    hasSelectables := false.
+
+    columnDescriptors do:[:aCol|
+        (hasSelectables or:[aCol rendererType == #rowSelector]) ifFalse:[
+            hasSelectables := aCol description canSelect
+        ]
+    ].
+
+    hasSelectables ifFalse:[
+        ^ super keyPress:aKey x:x y:y
+    ].
+
     selRowNr := self firstIndexSelected.
     n        := 1 + (sensor compressKeyPressEventsWithKey:aKey).
     (aKey == #CursorUp or:[aKey == #CursorDown]) ifTrue:[
@@ -2042,7 +2062,7 @@
     ].
 
     (aKey == #CursorLeft or:[aKey == #CursorRight]) ifFalse:[
-        self handleTab ifFalse:[
+        tabIntern ifFalse:[
             ^ super keyPress:aKey x:x y:y
         ].
 
@@ -2061,13 +2081,6 @@
         key   := aKey.
     ].
 
-    isTab ifTrue:[
-        selRowNr == 0 ifTrue:[
-            self tabIn ifFalse:[
-                ^ super keyPress:aKey x:x y:y
-            ].
-        ]
-    ].
     maxColNr := self numberOfColumns.
     idx := selectedColIndex.
 
@@ -2145,10 +2158,6 @@
         ^ editView isNil
     ].
     ^ false
-!
-
-tabIn
-    ^ true
 ! !
 
 !DSVColumnView methodsFor:'gc operations'!
@@ -2307,6 +2316,7 @@
     super initialize.
     self lineWidth:0.
 
+    tabIntern          := true.
     useIndex           := true.
     viewOrigin         := 0@0.
     font               := font onDevice:device.
@@ -2324,7 +2334,6 @@
     rowFontAscent      := 1.                            "/ dummy initialization
     separatorSize      := 1.                            "/ separators mode 2D
     selectRowOnDefault := true.
-
 !
 
 mapped
@@ -3312,5 +3321,5 @@
 !DSVColumnView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.98 2000-02-01 13:53:30 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.99 2000-02-02 09:32:16 ca Exp $'
 ! !