ListSelectionBox.st
changeset 166 ad76f0f28698
parent 155 d6f3836d2b51
child 174 d80a6cc3f9b2
--- a/ListSelectionBox.st	Tue Oct 24 18:22:41 1995 +0100
+++ b/ListSelectionBox.st	Fri Oct 27 15:44:54 1995 +0100
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1990 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libwidg/ListSelectionBox.st,v 1.17 1995-09-07 12:45:09 claus Exp $
+$Header: /cvs/stx/stx/libwidg/ListSelectionBox.st,v 1.18 1995-10-27 14:44:44 cg Exp $
 '!
 
 !ListSelectionBox class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libwidg/ListSelectionBox.st,v 1.17 1995-09-07 12:45:09 claus Exp $
+$Header: /cvs/stx/stx/libwidg/ListSelectionBox.st,v 1.18 1995-10-27 14:44:44 cg Exp $
 "
 !
 
@@ -128,7 +128,7 @@
 !ListSelectionBox methodsFor:'initialization'!
 
 initialize
-    |space2 halfSpace v vbw|
+    |space2 halfSpace v vbw eH|
 
     super initialize.
 
@@ -157,7 +157,12 @@
 "/             ].
 
 "/ new:
-    v origin:[0.0 @ (enterField origin y + enterField height + ViewSpacing)]
+    v origin:[enterField notNil ifTrue:[
+		0.0 @ (enterField origin y + enterField height + ViewSpacing)
+	      ] ifFalse:[
+		0.0 @ (labelField origin y + labelField height + ViewSpacing)
+	      ]
+	     ]
       corner:(1.0 @ 1.0).
     v bottomInset:(buttonPanel preferredExtent y + ViewSpacing).
 
@@ -180,7 +185,9 @@
      mhm: the lists keyboard functions are disabled,
      and input passed to the enterfield
     "
-    selectionList delegate:(KeyboardForwarder toView:enterField condition:#noFocus) 
+    selectionList delegate:(KeyboardForwarder toView:enterField condition:#noFocus)
+
+    "Modified: 26.10.1995 / 17:18:23 / cg"
 !
 
 updateList
@@ -204,16 +211,20 @@
     "return my preferred extent - thats the minimum size 
      I like to have, to make everything visible"
 
-    |wWanted hWanted|
-
+    |wWanted hWanted eH|
 
     wWanted := labelField width + ViewSpacing + ViewSpacing.
     (wWanted > width) ifFalse:[
 	wWanted := width
     ].
 
+    enterField notNil ifTrue:[
+	eH := enterField height + ViewSpacing
+    ] ifFalse:[
+	eH := 0
+    ].
     hWanted := ViewSpacing + labelField height +
-	       ViewSpacing + enterField height +
+	       eH +
 	       ViewSpacing + selectionList height +
 	       ViewSpacing + buttonPanel preferredExtent y +
 	       ViewSpacing - (ViewSpacing * 2).
@@ -222,6 +233,8 @@
 	hWanted := height
     ].
     ^ (wWanted @ hWanted)
+
+    "Modified: 26.10.1995 / 17:13:53 / cg"
 ! !
 
 !ListSelectionBox methodsFor:'user actions'!
@@ -229,7 +242,11 @@
 selectionChanged
     "selections in list get forwarded to enterfield"
 
-    enterField contents:(selectionList selectionValue)
+    enterField notNil ifTrue:[
+	enterField contents:(selectionList selectionValue)
+    ]
+
+    "Modified: 26.10.1995 / 17:20:06 / cg"
 !
 
 doubleClick
@@ -239,6 +256,25 @@
     self okPressed
 ! !
 
+!ListSelectionBox methodsFor:'accessing-components'!
+
+listView
+    "return the listView component"
+
+    ^ selectionList
+
+    "Created: 26.10.1995 / 17:08:32 / cg"
+! !
+
+!ListSelectionBox methodsFor:'accessing-look'!
+
+noEnterField
+    enterField destroy.
+    enterField := nil
+
+    "Created: 26.10.1995 / 17:12:38 / cg"
+! !
+
 !ListSelectionBox methodsFor:'accessing'!
 
 initialText:someString