DataSetView.st
changeset 1187 544b83216038
parent 1066 c588ca20e4b4
child 1200 0d5be0a2bb21
--- a/DataSetView.st	Fri Jan 29 19:03:59 1999 +0100
+++ b/DataSetView.st	Sat Jan 30 18:07:02 1999 +0100
@@ -372,7 +372,7 @@
 !DataSetView class methodsFor:'test'!
 
 test
-    |top scr clDc rows slct list bool spc img|
+    |top scr clDc rows slct list bool spc img model idx size|
 
     top  := StandardSystemView new label:'select'; extent:600@500.
     scr  := DataSetView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0) in:top.
@@ -415,10 +415,31 @@
         el labelActionSelector:#dummy.
     ].
     scr has3Dseparators:true.
-    scr columnDescriptors:clDc.
+    model := ValueHolder new.
+    model value:clDc.
+    scr columnHolder:model.
+    "/ scr columnDescriptors:clDc.
     scr list:rows.
     top open.
+    Delay waitForSeconds:1.
 
+    idx  := 1.
+    size := clDc size.
+
+    [top shown] whileTrue:[|coll|
+"/        coll := OrderedCollection new:size.
+"/        clDc keysAndValuesDo:[:i :c|
+"/            i ~~ idx ifTrue:[coll add:c]
+"/        ].
+"/        idx == size ifTrue:[idx := 1]
+"/                   ifFalse:[idx := idx + 1].
+"/        model value:coll.
+"/        Delay waitForSeconds:0.5.
+        scr showLabels:(scr showLabels not).
+        Delay waitForSeconds:2.
+        
+    ].
+    Transcript showCR:'READY'.
 
 ! !
 
@@ -496,6 +517,39 @@
     ^ scrolledView isVerticalScrollable
 !
 
+showLabels
+    "control the labels view to be visible or unvisible
+    "
+    ^ labelView notNil
+
+!
+
+showLabels:aState
+    "control the labels view to be visible or unvisible
+    "
+    |saveLabel|
+
+    labelView isNil ifTrue:[
+        aState ifTrue:[
+            labelView := DSVLabelView origin:(0.0 @ 0.0) corner:(1.0 @ 0.0) in:self.
+            labelView for:columnView.
+
+            self shown ifTrue:[
+                labelView realize
+            ].
+            columnView columnDescriptors:(columnView columnDescriptors).
+        ]
+    ] ifFalse:[
+        aState ifFalse:[
+            saveLabel := labelView.
+            labelView := nil.
+            saveLabel destroy.
+            scrolledView topInset:0
+        ]
+    ].
+
+!
+
 verticalMini:aBool
     "control the vertical scrollBar to be either a miniScroller,
      or a full scrollBar.
@@ -621,7 +675,7 @@
     "
     |pL pR|
 
-    realized ifFalse:[
+    (realized and:[labelView notNil]) ifFalse:[
         ^ self
     ].
 
@@ -655,7 +709,8 @@
             ].
             ^ self
         ].
-        realized ifTrue:[
+
+        (realized and:[labelView notNil]) ifTrue:[
             what == #sizeOfColumns    ifTrue:[ ^ self columnsSizeChanged ].
             what == #columnsLayout    ifTrue:[ ^ labelView columnsLayoutChanged ].
             what == #originOfContents ifTrue:[ ^ labelView columnsOriginChanged:aPara ].
@@ -788,8 +843,6 @@
     "
     super initialize.
 
-    labelView := DSVLabelView origin:(0.0 @ 0.0) corner:(1.0 @ 0.0) in:self.
-
     scrolledView := HVScrollableView for:DSVColumnView 
                          miniScrollerH:true
                          miniScrollerV:false
@@ -803,9 +856,7 @@
     columnView borderWidth:0.
     columnView addDependent:self.
     columnView dataSetView:self. "/ kludge
-    labelView for:columnView.
-
-    "Modified: / 7.8.1998 / 22:15:37 / cg"
+    self showLabels:true.
 !
 
 realize
@@ -840,5 +891,5 @@
 !DataSetView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/DataSetView.st,v 1.23 1998-08-08 11:47:04 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/DataSetView.st,v 1.24 1999-01-30 17:06:21 cg Exp $'
 ! !