<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">Very nice! May I suggest that we fall back to traditional #chooseFrom: if
 we have more than, </span><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">let's say, 10 or 15 options? In some scenarios, options
 might be generated dynamically, and in these cases, a scrollable list would still scale better. :-)</span><br>
</p>
<p><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px"><br>
</span></p>
<p><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">Best,</span></p>
<p><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">Christoph</span></p>
<p><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px"><br>
</span></p>
<p><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px"><img size="9948" id="x_img765921" tabindex="0" style="max-width:99.9%" src="cid:07c3b015-332d-4240-bfea-753a512a6b01"><br>
</span></p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Dienstag, 19. April 2022 20:59:20<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Trunk: ToolBuilder-Morphic-tpr.312.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">tim Rowledge uploaded a new version of ToolBuilder-Morphic to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/ToolBuilder-Morphic-tpr.312.mcz">http://source.squeak.org/trunk/ToolBuilder-Morphic-tpr.312.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: ToolBuilder-Morphic-tpr.312<br>
Author: tpr<br>
Time: 19 April 2022, 11:59:19.483381 am<br>
UUID: 3b32b25c-7cdf-4307-85af-84b0dfd08f1d<br>
Ancestors: ToolBuilder-Morphic-mt.311<br>
<br>
Add a ToolBuilder ability to show a list of options - typically a small number, maybe with a cancel button etc - as opposed to an arbitrary list of values. This separates it out from the chooseFrom:... protocol<br>
<br>
=============== Diff against ToolBuilder-Morphic-mt.311 ===============<br>
<br>
Item was changed:<br>
  ----- Method: MorphicUIManager>>chooseFrom:lines:title: (in category 'ui requests') -----<br>
  chooseFrom: aList lines: linesArray title: aString <br>
         "Choose an item from the given list. Answer the index of the selected item. Cancel value is 0.<br>
+        If you are choosing an option from a short list (see for example ZipArchiveMember>>#extractInDirectory:overwrite:) use MorphicUIManager>>#chooseOptionFrom:lines:title: instead."<br>
+        self<br>
+                askForProvidedAnswerTo: aString<br>
+                ifSupplied:<br>
+                        [:answer | <br>
+                        (answer = #cancel or: [answer isNil]) ifTrue: [^ 0].<br>
+                        ^ aList indexOf: answer].<br>
         <br>
-        There are several (historical) reasons for building a button dialog instead of a list chooser for small lists:<br>
-        1) Unfortunately, there is existing code that uses this call to create simple confirmation dialogs with a list of #(yes no cancel).<br>
-        2) Unfortunately, there is existing code that uses this call to mimick a drop-down menu with a (compact) pop-up menu."<br>
-        self askForProvidedAnswerTo: aString ifSupplied: [:answer | <br>
-                (answer = #cancel or: [answer isNil]) ifTrue: [^ 0].<br>
-                ^ aList indexOf: answer].<br>
-        <br>
         aList ifEmpty: [^ 0].<br>
-        aList size <= 7 ifTrue: [<br>
-                | dialog |<br>
-                dialog := DialogWindow new<br>
-                        title: ListChooser defaultTitle;<br>
-                        message: aString;<br>
-                        filterEnabled: true;<br>
-                        autoCancel: true; "Like a pop-up menu, click anywhere to dismiss."<br>
-                        yourself.<br>
-                aList withIndexDo: [:ea :index |<br>
-                        dialog createButton: ea value: index].<br>
-                dialog selectedButtonIndex: 1.<br>
-                ^ dialog getUserResponseAtHand ifNil: [0]].<br>
-        <br>
         ^ ListChooser chooseFrom: aList title: aString!<br>
<br>
Item was changed:<br>
  ----- Method: MorphicUIManager>>chooseFrom:values:lines:title: (in category 'ui requests') -----<br>
  chooseFrom: labelList values: valueList lines: linesArray title: aString <br>
         "Choose an item from the given list. Answer the selected item."<br>
         <br>
         | index |<br>
+        self<br>
+                askForProvidedAnswerTo: aString<br>
+                ifSupplied:<br>
+                        [:answer | <br>
+                        (answer = #cancel or: [answer isNil]) ifTrue: [^ nil].<br>
+                        ^ valueList at: (labelList indexOf: answer) ifAbsent:<br>
+                                        [answer isNumber <br>
+                                                ifTrue: [valueList at: answer ifAbsent: [nil]]<br>
+                                                ifFalse: [nil]]].<br>
-        self askForProvidedAnswerTo: aString ifSupplied: [:answer | <br>
-                (answer = #cancel or: [answer isNil]) ifTrue: [^ nil].<br>
-                ^ valueList at: (labelList indexOf: answer) ifAbsent: [<br>
-                                answer isNumber <br>
-                                        ifTrue: [valueList at: answer ifAbsent: [nil]]<br>
-                                        ifFalse: [nil]]].<br>
         <br>
         index := self chooseFrom: labelList lines: linesArray title: aString.<br>
         ^ index = 0<br>
                 ifTrue: [ nil ]<br>
                 ifFalse: [ valueList at: index ]!<br>
<br>
Item was added:<br>
+ ----- Method: MorphicUIManager>>chooseOptionFrom:lines:title: (in category 'ui requests') -----<br>
+ chooseOptionFrom: aList lines: linesArray title: aString <br>
+        | dialog |<br>
+        "Choose an option from the given list. Answer the index of the selected item. Cancel value is 0.<br>
+        <br>
+        There are several (historical) reasons for needing a button dialog instead of a list chooser for small lists:<br>
+        1) Unfortunately, there is existing code that uses this call to create simple confirmation dialogs with a list of #(yes no cancel).<br>
+        2) Unfortunately, there is existing code that uses this call to mimic a drop-down menu with a (compact) pop-up menu.<br>
+        This method *only*  provides the short list UI"<br>
+        self<br>
+                askForProvidedAnswerTo: aString<br>
+                ifSupplied:<br>
+                        [:answer | <br>
+                        (answer = #cancel or: [answer isNil]) ifTrue: [^ 0].<br>
+                        ^ aList indexOf: answer].<br>
+        <br>
+        aList ifEmpty: [^ 0].<br>
+        dialog := DialogWindow new<br>
+                title: ListChooser defaultTitle;<br>
+                message: aString;<br>
+                filterEnabled: true;<br>
+                autoCancel: true; "Like a pop-up menu, click anywhere to dismiss."<br>
+                yourself.<br>
+        aList withIndexDo: <br>
+                [:ea :index |<br>
+                dialog createButton: ea value: index].<br>
+        dialog selectedButtonIndex: 1.<br>
+        ^ dialog getUserResponseAtHand ifNil: [0]!<br>
<br>
<br>
</div>
</span></font>
</body>
</html>