[squeak-dev] The Inbox: ToolBuilder-Morphic-nice.80.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jun 30 19:07:01 UTC 2011


A new version of ToolBuilder-Morphic was added to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Morphic-nice.80.mcz

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

Name: ToolBuilder-Morphic-nice.80
Author: nice
Time: 30 June 2011, 9:06:57.179 pm
UUID: 769ffad1-759b-415b-abce-0a8ab66d10fd
Ancestors: ToolBuilder-Morphic-ul.79

Builde richer menus (require PluggableMenuItemSpec changes from ToolBuilder-Kernel)

=============== Diff against ToolBuilder-Morphic-ul.79 ===============

Item was changed:
  ----- Method: MorphicToolBuilder>>buildPluggableMenuItem: (in category 'building') -----
  buildPluggableMenuItem: itemSpec
+ 	| item label |
+ 	item := itemSpec isUpdating
+ 		ifTrue: [self updatingMenuItemClass new]
+ 		ifFalse: [self menuItemClass new].
+ 	label := itemSpec label ifNil: [''].
+ 	itemSpec hasCheckBox
+ 		ifTrue: [ itemSpec checked
+  			ifTrue: [label := '<on>', label]
+ 			ifFalse: [label := '<off>', label]].
- 	| item action label menu |
- 	item := self menuItemClass new.
- 	label := itemSpec label.
- 	itemSpec checked ifTrue:[label := '<on>', label] ifFalse:[label := '<off>', label].
  	item contents: label.
+ 	item icon: itemSpec icon.
  	item isEnabled: itemSpec enabled.
+ 	itemSpec isUpdating ifTrue: [
+ 		itemSpec enablementSelector ifNotNil: [:sel | item enablementSelector: sel].
+ 		item wordingProvider: itemSpec wordingProvider wordingSelector: itemSpec wordingSelector.
+ 		itemSpec wordingArgument ifNotNil: [:arg | item wordingArgument: arg]].
+ 	itemSpec action ifNotNil: [:action |
- 	(action := itemSpec action) ifNotNil:[
  		item 
  			target: action receiver;
  			selector: action selector;
  			arguments: action arguments.
  	].
+ 	itemSpec subMenu ifNotNil: [:menu |
- 	(menu := itemSpec subMenu) ifNotNil:[
  		item subMenu: (menu buildWith: self).
  	].
+ 	parentMenu ifNotNil: [parentMenu addMorphBack: item].
+ 	itemSpec separator ifTrue: [parentMenu addLine].
- 	parentMenu ifNotNil:[parentMenu addMorphBack: item].
- 	itemSpec separator ifTrue:[parentMenu addLine].
  	^item!

Item was changed:
  ----- Method: MorphicToolBuilder>>buildPluggablePanel: (in category 'pluggable widgets') -----
  buildPluggablePanel: aSpec
+ 	| widget children |
- 	| widget children frame |
  	widget := self panelClass new.
  	self register: widget id: aSpec name.
  	widget model: aSpec model.
  	widget color: Color transparent.
  	widget clipSubmorphs: true.
  	children := aSpec children.
  	children isSymbol ifTrue:[
  		widget getChildrenSelector: children.
  		widget update: children.
  		children := #().
  	].
  	self buildAll: children in: widget.
  	self buildHelpFor: widget spec: aSpec. 
  	self setFrame: aSpec frame in: widget.
  	parent ifNotNil:[self add: widget to: parent].
  	self setLayout: aSpec layout in: widget.
  	widget layoutInset: 0.
  	widget borderWidth: 0.
+ 	widget submorphsDo:[:sm| | frame |
- 	widget submorphsDo:[:sm|
  		(frame := sm layoutFrame) ifNotNil:[
  			(frame rightFraction = 0 or:[frame rightFraction = 1]) 
  				ifFalse:[frame rightOffset:1].
  			(frame bottomFraction = 0 or:[frame bottomFraction = 1]) 
  				ifFalse:[frame bottomOffset: 1]]].
  	widget color: Color transparent.
  	^widget!

Item was added:
+ ----- Method: MorphicToolBuilder>>updatingMenuItemClass (in category 'widget classes') -----
+ updatingMenuItemClass
+ 	^ UpdatingMenuItemMorph!




More information about the Squeak-dev mailing list