DSVColumnView.st
changeset 886 57bd1eddba23
parent 874 b590c1dd6a42
child 892 1cc1d52d1176
--- a/DSVColumnView.st	Mon May 11 10:40:28 1998 +0200
+++ b/DSVColumnView.st	Mon May 11 10:43:49 1998 +0200
@@ -179,6 +179,12 @@
         constantNamed:#'DSVColumnView dragIconSingle'
         ifAbsentPut:[(Depth8Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@A@PDA@PDA@PDA@PDA@PDA@PDA@P@@@@@@@@@@@@@@@@DA@PDA@PDA@PDA@PDA@PDA@PDA@@@@@@@@@@@@@@@@@PDB@ HB@ HB@ HB@ HB@ DA@ HA@P@@@@@@@@@@@@@A@PHB@ HB@ HB@ HB@ HB@PDB@ DA@@@@@@@@@@@@@@DA@ HB@ HB@ HB@ HB@ HA@PHB@ HA@P@@@@@@@@@@@PDB@ HB@ HB@ HB@ HB@ DA@ HB@ DA@@@@@@@@@@@A@PHB@ HB@ HB@ HB@ HB@PDA@PDA@PDA@P@@@@@@@@DA@ HB@ HB@ HB@ HB@ HA@PDA@PDA@PDA@@@@@@@@@PDB@ HB@ HB@ HB@ HB@ HB@ HB@ HB@PD@@@@@@@@A@PHB@ HB@ HB@ HB@ HB@ HB@ HB@ HA@P@@@@@@@@DA@ HB@ HB@ HB@ HB@ HB@ HB@ HB@ DA@@@@@@@@@PDB@ HB@ HB@ HB@ HB@ HB@ HB@ HB@PD@@@@@@@@A@PHB@ HB@ HB@ HB@ HB@ HB@ HB@ HA@P@@@@@@@@DA@ HB@ HB@ HB@ HB@ HB@ HB@ HB@ DA@@@@@@@@@PDB@ HB@ HB@ HB@ HB@ HB@ HB@ HB@PD@@@@@@@@A@PHB@ HB@ HB@ HB@ HB@ HB@ HB@ HA@P@@@@@@@@DA@ HB@ HB@ HB@ HB@ HB@ HB@ HB@ DA@@@@@@@@@PDB@ HB@ HB@ HB@ HB@ HB@ HB@ HB@PD@@@@@@@@A@PHB@ HB@ HB@ HB@ HB@ HB@ HB@ HA@P@@@@@@@@DA@ HB@ HB@ HB@ HB@ HB@ HB@ HB@ DA@@@@@@@@@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PD@@@@@@@@A@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 0 0 0 255 255 255]; mask:((ImageMask new) width: 32; height: 32; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@O??<@C???@@???<@O???@C???<@????@O???<C????@????0O???<C????@????0O???<C????@????0O???<C????@????0O???<C????@????0O???<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself]! !
 
+!DSVColumnView methodsFor:'accessing'!
+
+columnView
+    ^ self
+! !
+
 !DSVColumnView methodsFor:'accessing actions'!
 
 action:aOneArgAction
@@ -336,28 +342,33 @@
     ^ columnDescriptors at:anIndex
 !
 
-columnDescriptors:colDesc
+columnDescriptors
+    "returns list of column descriptors
+    "
+    ^ columnDescriptors collect:[:aCol| aCol description ]
+!
+
+columnDescriptors:aColumnDescriptionList
     "set the columnDescriptors
     "
     |id sz|
 
-    sz := colDesc size.
-
-    (sz == 0 or:[selectedColIndex ~~ 0]) ifTrue:[       "/ cell selected
-        self deselect                                   "/ remove selection
-    ].
-    catchChangeEvents := true.
-
-    sz ~~ 0 ifTrue:[
+    self deselect.
+
+    (sz := aColumnDescriptionList size) ~~ 0 ifTrue:[
         id := 0.
 
-        columnDescriptors := colDesc collect:[:aCol|
+        columnDescriptors := aColumnDescriptionList collect:[:aCol||column|
+            (column := aCol) isSequenceable ifTrue:[
+                column := DataSetColumnSpec new fromLiteralArrayEncoding:aCol
+            ].
             id := id + 1.
-            DataSetColumn new on:self description:aCol columnNumber:id.
+            DataSetColumn new on:self description:column columnNumber:id
         ]
     ] ifFalse:[
         columnDescriptors := #()
     ].
+    catchChangeEvents := true.
     canFit := (columnDescriptors findFirst:[:aCol|aCol canResize]) ~~ 0.
     preferredExtent := nil.
 
@@ -1087,6 +1098,10 @@
     "
     |x y h w|
 
+    aRowNr isNil ifTrue:[
+        ^ self
+    ].
+
     (shown and:[aRowNr between:1 and:self size]) ifTrue:[
         h := rowHeight - 1.
 
@@ -2633,5 +2648,5 @@
 !DSVColumnView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.36 1998-04-22 15:27:39 tz Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.37 1998-05-11 08:43:49 ca Exp $'
 ! !