[squeak-dev] The Trunk: ToolBuilder-Morphic-mt.268.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Oct 14 12:08:21 UTC 2020


Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.268.mcz

==================== Summary ====================

Name: ToolBuilder-Morphic-mt.268
Author: mt
Time: 14 October 2020, 2:08:19.881569 pm
UUID: 512035a4-7ed9-4149-adce-ec5c6bb12d4b
Ancestors: ToolBuilder-Morphic-mt.267

Rename #doWithIndex: to #withIndexDo:. See http://forum.world.st/The-Inbox-60Deprecated-ct-80-mcz-td5120706.html

=============== Diff against ToolBuilder-Morphic-mt.267 ===============

Item was changed:
  ----- Method: MorphicUIManager>>chooseFrom:lines:title: (in category 'ui requests') -----
  chooseFrom: aList lines: linesArray title: aString 
  	"Choose an item from the given list. Answer the index of the selected item. Cancel value is 0.
  	
  	There are several (historical) reasons for building a button dialog instead of a list chooser for small lists:
  	1) Unfortunately, there is existing code that uses this call to create simple confirmation dialogs with a list of #(yes no cancel).
  	2) Unfortunately, there is existing code that uses this call to mimick a drop-down menu with a (compact) pop-up menu."
  	self askForProvidedAnswerTo: aString ifSupplied: [:answer | 
  		(answer = #cancel or: [answer isNil]) ifTrue: [^ 0].
  		^ aList indexOf: answer].
  	
  	aList ifEmpty: [^ 0].
  	aList size <= 7 ifTrue: [
  		| dialog |
  		dialog := DialogWindow new
  			title: 'Please Choose';
  			message: aString;
  			filterEnabled: true;
  			autoCancel: true; "Like a pop-up menu, click anywhere to dismiss."
  			yourself.
+ 		aList withIndexDo: [:ea :index |
- 		aList doWithIndex: [:ea :index |
  			dialog createButton: ea value: index].
  		dialog selectedButtonIndex: 1.
  		^ dialog getUserResponseAtHand ifNil: [0]].
  	
  	^ ListChooser chooseFrom: aList title: aString!



More information about the Squeak-dev mailing list