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

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

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

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

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

Name: ToolBuilder-Morphic-mt.176
Author: mt
Time: 1 August 2016, 2:44:38.851063 pm
UUID: 90acc5bd-1f6a-4f48-b1ac-d36a798437d4
Ancestors: ToolBuilder-Morphic-mt.175

For lists smaller than or equal to 7, use button-only dialog but still support keyboard filtering.

Note that people tend to choose between #(yes no) and hence we do need such a button-only version of a list chooser. Still, better than using menus in terms of input modality and visual consistency.

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

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."
 
  aList size <= 7 ifTrue: [
  | dialog |
  dialog := DialogWindow new
  title: 'Please Choose';
  message: aString;
+ filterEnabled: true;
  yourself.
  aList doWithIndex: [:ea :index |
  dialog createButton: ea value: index].
  dialog selectedButtonIndex: 1.
  ^ dialog getUserResponseAtHand ifNil: [0]].
 
  ^ ListChooser chooseFrom: aList title: aString!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: ToolBuilder-Morphic-mt.176.mcz

marcel.taeumel
Here is some explanation:


You can filter all these dialogs by just typing something and then pressing <return> or <enter> or double-clicking some element in the list.

UIManager default chooseFrom: (Smalltalk classNames first: 7).
UIManager default chooseFrom: (Smalltalk classNames first: 8).
UIManager default chooseFrom: (Smalltalk classNames).

We need this button-only dialog because there is much code doing this:

UIManager default chooseFrom: #(yes no cancel).



Instead of asking for a confirmation dialog. I hope this works for everybody. I terms of modality and visual consistency, I am strongly against (mis)using pop-up menus for this choosing task in the future.

Best,
Marcel