[squeak-dev] The Inbox: ToolBuilder-Kernel-dtl.50.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Sep 24 19:51:59 UTC 2011


A new version of ToolBuilder-Kernel was added to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Kernel-dtl.50.mcz

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

Name: ToolBuilder-Kernel-dtl.50
Author: dtl
Time: 24 September 2011, 3:51:55.97 pm
UUID: 5104256f-7297-4cb1-a751-e23959330813
Ancestors: ToolBuilder-Kernel-cmm.49

Provide updating button for "what to show" button on CodeHolder, similar to Squeak 3.8 behavior. This button activates a menu, and displays the resulting menu selection. For the default look, normal buttons are rounded and the menu activation button is square (vice versa if the "Rounded Button Corners" preference is disabled). When menu selection is changed, the button label displays the selected mode ('source', 'decompile', 'bytecodes' etc).

Changes are in three packages.

ToolBuilder-Kernel:
- Add PluggableButtonSpec>>style to provide style hint. Used to suggest that a button should be rendered differently, in this case rounded versus square corners.
- Add changeLableWhen: to connect pluggable button with change notification, in this case to allow update: #contents to result in a label update in the dependent button.

ToolBuilder-Morphic:
- Add #whenChanged:update: as a mechanism for hooking change events to button updates, allowing an individual button to respond to e.g. self changed: #contents in the model.
- Update MorphicToolBuilder>>buildPluggableButton to make use of style and changeLabelWhen in the widget spec.

Tools:
 - Update CodeHolder>>buildCodeProvenanceButtonWith: to add style hint for round/ square corners and changeLableWhen: for change notification to the widget spec.

Note: ToolBuilder has PluggableDropDownListSpec which is presumably intended to describe a drop-down list widget. This is currently unused in the image, but in future might provide a better approach than the current action button with menu approach.

=============== Diff against ToolBuilder-Kernel-cmm.49 ===============

Item was changed:
  PluggableButtonSpec subclass: #PluggableActionButtonSpec
  	instanceVariableNames: ''
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'ToolBuilder-Kernel'!
  
+ !PluggableActionButtonSpec commentStamp: 'dtl 9/19/2011 07:51' prior: 0!
+ PluggableActionButtonSpec is intended as a HINT for the builder that this widget will be used as push (action) button. Unless explicitly supported it will be automatically substituted by PluggableButton.!
- !PluggableActionButtonSpec commentStamp: 'ar 2/12/2005 23:12' prior: 0!
- PluggableActionButtonSpec is intentded as a HINT for the builder that this widget will be used as push (action) button. Unless explicitly supported it will be automatically substituted by PluggableButton.!

Item was changed:
  PluggableWidgetSpec subclass: #PluggableButtonSpec
+ 	instanceVariableNames: 'action label state enabled style changeLabelWhen'
- 	instanceVariableNames: 'action label state enabled'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'ToolBuilder-Kernel'!
  
  !PluggableButtonSpec commentStamp: 'ar 2/11/2005 21:57' prior: 0!
  A button, both for firing as well as used in radio-button style (e.g., carrying a selection).
  
  Instance variables:
  	action	<Symbol>	The action to perform when the button is fired.
  	label	<Symbol|String>	The selector for retrieving the button's label or label directly.
  	state	<Symbol>	The selector for retrieving the button's selection state.
  	enabled	<Symbo>		The selector for retrieving the button's enabled state.
  	color	<Symbo>		The selector for retrieving the button color.
  	help	<String>		The balloon help for the button.!

Item was added:
+ ----- Method: PluggableButtonSpec>>changeLabelWhen (in category 'accessing') -----
+ changeLabelWhen
+ 	"When handled in in an update: handler, treat this symbol as notification
+ 	that the button label should be updated."
+ 	^changeLabelWhen!

Item was added:
+ ----- Method: PluggableButtonSpec>>changeLabelWhen: (in category 'accessing') -----
+ changeLabelWhen: aSymbol
+ 	"When the button handles aSymbol in its update: handler, treat it
+ 	as notification that the button label should be updated."
+ 	changeLabelWhen := aSymbol!

Item was added:
+ ----- Method: PluggableButtonSpec>>style (in category 'accessing') -----
+ style
+ 	"Treat aSymbol as a hint to modify the button appearance."
+ 	^style
+ 
+ !

Item was added:
+ ----- Method: PluggableButtonSpec>>style: (in category 'accessing') -----
+ style: aSymbol
+ 	"Use aSymbol as a hint to modify the button appearance."
+ 	style := aSymbol
+ !




More information about the Squeak-dev mailing list