DialogBox.st
changeset 6699 ace7a8baca69
parent 6696 4cc270fac972
child 6700 47dc0c6fb70d
equal deleted inserted replaced
6698:378e50623340 6699:ace7a8baca69
  5765 choose:aString fromList:list lines:maxLines initialSelection:initialSelection
  5765 choose:aString fromList:list lines:maxLines initialSelection:initialSelection
  5766     "launch a Dialog showing the message and list.
  5766     "launch a Dialog showing the message and list.
  5767      The user can select an item and click ok; in this case, the value
  5767      The user can select an item and click ok; in this case, the value
  5768      from list is returned (doubleclick works as well).
  5768      from list is returned (doubleclick works as well).
  5769      If cancel is pressed, the value of cancelBlock is returned.
  5769      If cancel is pressed, the value of cancelBlock is returned.
  5770      Pressing ok without a selection is treated like cancel."
  5770      Pressing ok without a selection is treated like cancel.
       
  5771      Initially, the value given by initialSelection is selected (a value from list, not an index)"
  5771 
  5772 
  5772     ^ self
  5773     ^ self
  5773         choose:aString 
  5774         choose:aString 
  5774         fromList:list values:list initialSelection:initialSelection
  5775         fromList:list values:list initialSelection:initialSelection
  5775         buttons:nil values:nil 
  5776         buttons:nil values:nil 
  5791     "Modified: 27.1.1996 / 14:17:07 / cg"
  5792     "Modified: 27.1.1996 / 14:17:07 / cg"
  5792 !
  5793 !
  5793 
  5794 
  5794 choose:aString fromList:list lines:maxLines initialSelection:initialSelection title:windowTitle
  5795 choose:aString fromList:list lines:maxLines initialSelection:initialSelection title:windowTitle
  5795     "launch a Dialog showing the message and list.
  5796     "launch a Dialog showing the message and list.
  5796      The user can select an item and click ok; in this case, the value
  5797      The user can select an item and click ok; 
  5797      from list is returned (doubleclick works as well).
  5798      in this case, the value from list is returned (doubleclick works as well).
  5798      If cancel is pressed, the value of cancelBlock is returned.
  5799      If cancel is pressed, the value of cancelBlock is returned.
  5799      Pressing ok without a selection is treated like cancel."
  5800      Pressing ok without a selection is treated like cancel.
       
  5801      Initially, the value given by initialSelection is selected (a value from list, not an index)"
  5800 
  5802 
  5801     ^ self
  5803     ^ self
  5802         choose:aString 
  5804         choose:aString 
  5803         fromList:(list collect:[:each| each printString]) values:list
  5805         fromList:(list collect:[:each| each printString]) values:list
  5804         initialSelection:initialSelection
  5806         initialSelection:initialSelection
  5812 
  5814 
  5813     "
  5815     "
  5814      Transcript showCR:(
  5816      Transcript showCR:(
  5815          Dialog 
  5817          Dialog 
  5816             choose:'choose any' 
  5818             choose:'choose any' 
  5817             fromList:#(1 2 3 4 5 6 7) 
  5819             fromList:#(10 20 30 40 50 60 70) 
  5818             lines:4
  5820             lines:4
       
  5821             initialSelection:30
  5819             title:'Choose'    
  5822             title:'Choose'    
  5820      )
  5823      )
  5821     "
  5824     "
  5822 
  5825 
  5823     "Created: / 02-03-2007 / 12:06:39 / cg"
  5826     "Created: / 02-03-2007 / 12:06:39 / cg"