The Trunk: ToolBuilder-Morphic-mt.268.mcz

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

The Trunk: ToolBuilder-Morphic-mt.268.mcz

Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:

==================== 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

=============== 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."
+ 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!