--- a/LSelBox.st Mon Feb 06 01:52:01 1995 +0100
+++ b/LSelBox.st Mon Feb 06 01:53:30 1995 +0100
@@ -21,7 +21,7 @@
COPYRIGHT (c) 1990 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libwidg/Attic/LSelBox.st,v 1.6 1994-10-10 03:01:54 claus Exp $
+$Header: /cvs/stx/stx/libwidg/Attic/LSelBox.st,v 1.7 1995-02-06 00:52:32 claus Exp $
'!
!ListSelectionBox class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
version
"
-$Header: /cvs/stx/stx/libwidg/Attic/LSelBox.st,v 1.6 1994-10-10 03:01:54 claus Exp $
+$Header: /cvs/stx/stx/libwidg/Attic/LSelBox.st,v 1.7 1995-02-06 00:52:32 claus Exp $
"
!
@@ -51,7 +51,16 @@
this class implements boxes for selection from a list. It offers
both an ok- and abort-buttons. The ok-button, if pressed will
evaluate the okAction (see EnterBox>>action).
- typical use is:
+ see examples for typical uses.
+
+ Notice, for file selections there is a specialized FileSelectionBox,
+ which supports matchPatterns, changing directory etc.
+"
+!
+
+examples
+"
+ simple:
|box|
@@ -60,6 +69,17 @@
box list:#('foo' 'bar' 'baz').
box okAction:[:sel | Transcript showCr:'the selection was:' , sel].
box showAtPointer
+
+ with a default:
+
+ |box|
+
+ box := ListSelectionBox new.
+ box title:'select something:'.
+ box list:#('foo' 'bar' 'baz').
+ box okAction:[:sel | Transcript showCr:'the selection was:' , sel].
+ box initialText:'foo'.
+ box showAtPointer
"
! !
@@ -95,6 +115,8 @@
super initialize.
+ label := 'Select or enter'.
+
"need more space than an enterBox"
"self height:(height + (font height * 5)). "
@@ -154,6 +176,10 @@
realize
self updateList.
super realize
+!
+
+focusSequence
+ ^ Array with:enterField with:selectionList with:okButton with:abortButton
! !
!ListSelectionBox methodsFor:'queries'!
@@ -171,7 +197,7 @@
hWanted := ViewSpacing + labelField height +
ViewSpacing + enterField height +
ViewSpacing + selectionList height +
- ViewSpacing + buttonPanel height +
+ ViewSpacing + buttonPanel preferedExtent y +
ViewSpacing.
(hWanted < height) ifTrue:[