The Trunk: System-topa.378.mcz

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

The Trunk: System-topa.378.mcz

commits-2
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-topa.378.mcz

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

Name: System-topa.378
Author: topa
Time: 27 September 2010, 11:17:30.574 am
UUID: beb6b8d8-c9fb-41ff-b859-731ca8f6b843
Ancestors: System-nice.377

Fix the menu build method that relied on
coverting a collection of strings to a large string just to split it again.

=============== Diff against System-nice.377 ===============

Item was changed:
  ----- Method: SystemNavigation>>showMenuOf:withFirstItem:ifChosenDo:withCaption: (in category 'ui') -----
  showMenuOf: selectorCollection withFirstItem: firstItem ifChosenDo: choiceBlock withCaption: aCaption
  "Show a sorted menu of the given selectors, preceded by firstItem, and all abbreviated to 40 characters.  Use aCaption as the menu title, if it is not nil.  Evaluate choiceBlock if a message is chosen."
 
  | index menuLabels sortedList |
  sortedList := selectorCollection asSortedCollection.
+ menuLabels := Array streamContents:
+ [:strm | strm nextPut: (firstItem contractTo: 40).
+ sortedList do: [:sel | strm nextPut: (sel contractTo: 40)]].
+ index := UIManager default chooseFrom: menuLabels lines: #(1).
- menuLabels := String streamContents:
- [:strm | strm nextPutAll: (firstItem contractTo: 40).
- sortedList do: [:sel | strm cr; nextPutAll: (sel contractTo: 40)]].
- index := UIManager default chooseFrom: (menuLabels substrings) lines: #(1).
  index = 1 ifTrue: [choiceBlock value: firstItem].
  index > 1 ifTrue: [choiceBlock value: (sortedList at: index - 1)]!