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

commits at source.squeak.org commits at source.squeak.org
Fri Aug 5 08:02:07 UTC 2016


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

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

Name: ToolBuilder-Morphic-mt.181
Author: mt
Time: 5 August 2016, 10:01:55.176358 am
UUID: a6c5824c-2256-224a-9920-73aa1cf1ca16
Ancestors: ToolBuilder-Morphic-mt.180

Improve help text for list choosers that allow adding new items such as the dialog for adding a new message category does.

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

Item was changed:
  ----- Method: ListChooser>>addAllowed (in category 'accessing') -----
  addAllowed
  
+ 	^ addAllowed ifNil: [false]!
- 	^ addAllowed!

Item was changed:
  ----- Method: ListChooser>>buildWith: (in category 'building') -----
  buildWith: builder
  
  	| dialogSpec searchBarHeight listSpec fieldSpec |
  	
  	searchBarHeight := Preferences standardDefaultTextFont height * 2.
  	
  	dialogSpec := builder pluggableDialogSpec new
  		model: self;
  		title: #title;
  		closeAction: #closed;
  		extent: self initialExtent;
  		autoCancel: true; "behave like a pop-up menu"
  		children: OrderedCollection new;
  		buttons: OrderedCollection new;
  		yourself.
  	
  	listSpec := builder pluggableListSpec new.
  	listSpec 
  		model: self;
  		list: #items; 
  		getIndex: #selectedIndex; 
  		setIndex: #selectedIndex:; 
  		doubleClick: #accept;
  		"keystrokePreview: #keyStrokeFromList:;"
  		autoDeselect: false;
  		name: #list;
  		frame: (LayoutFrame fractions: (0 at 0 corner: 1 at 1) offsets: (0 at searchBarHeight corner: 0 at 0)).
  	dialogSpec children add: listSpec.
  	
  	fieldSpec := builder pluggableInputFieldSpec new.
  	fieldSpec 
  		model: self;
  		getText: #searchText;
  		editText: #searchText:;
  		setText: #acceptText:;
  		selection: #textSelection;
  		menu: nil;
  		indicateUnacceptedChanges: false;
  		askBeforeDiscardingEdits: false;
+ 		help: (self addAllowed ifTrue: ['Type new or filter existing...' translated] ifFalse: ['Type to filter existing...' translated]);
- 		help: 'Type a string to filter down the listed items';
  		frame: (LayoutFrame fractions: (0 at 0 corner: 1 at 0) offsets: (0 at 0 corner: 0 at searchBarHeight)).
  	dialogSpec children add: fieldSpec.
  	
  	"Buttons"
  	dialogSpec buttons add: (
  		builder pluggableButtonSpec new
  			model: self; 
  			label: #acceptLabel;
  			action: #accept;
  			enabled: #canAcceptOrAdd;
  			color: #acceptColor).
  
  	dialogSpec buttons add: (
  		builder pluggableButtonSpec new
  			model: self; 
  			label: 'Cancel';
  			action: #cancel;
  			color: #cancelColor).
  		
  	dialogMorph := builder build: dialogSpec.
  	dialogMorph addKeyboardCaptureFilter: self.
  	listMorph := builder widgetAt: #list.
  	listMorph allowEmptyFilterResult: true.
  	
  	^ dialogMorph!



More information about the Squeak-dev mailing list