CHOOSER.CLS

This is a Smallltalk/V Windows 1.1 class that prompts the user with a collection of items in
a listbox, and answers a collection of indexes of items selected.  There are only two public
methods - the class methods #chooseFrom: default: label: and #chooseFrom: default.  The only
difference between these being that the former label allows the titlebar text to be specified
otherwise 'Smalltalk/V Chooser' is used.

The dialog contains a listbox, some static text, and OK and Cancel pushbuttons.  The caller
specifies the initial selection in the form of an integer (which produces a single selection
listbox and returns an integer which is the index of the item selected) or a collection (which
produces a multiple selection listbox and returns a collection of items being indexes of the
selected items).  In the case of a multiple selection listbox, the size of the answered collection
may be zero.

The user may dismiss the dialog by selecting OK, Cancel (nil is answered), or double clicking on
a listbox item.

Examples of code use are:

Chooser chooseFrom: #(12 34 'Hello') default: 2 - single selection listbox
Chooser chooseFrom: #(12 334 'Hello' 'Wow!') default: #(3 4) multiple selection listbox
Chooser chooseFrom: #(12 34 324) default: 1 label: 'Pick A Number'

For items to be inserted into the listbox that are not of class String, the item's #printString
method is used to get the text to insert.

This was a quick and dirty effort.  If you have any problems then mail me.

Adrian Cho
16 March 1992
CompuServe:  100032,102