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

commits at source.squeak.org commits at source.squeak.org
Mon Mar 30 07:43:28 UTC 2015


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

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

Name: Morphic-mt.789
Author: mt
Time: 30 March 2015, 9:42:48.194 am
UUID: 3a9c98fb-5fca-974f-8b32-e0059e13aeb0
Ancestors: Morphic-mt.788

Refactored interface for getting and setting balloonTexts. Do not modify the given text on setting anymore but only on getting because we do not yet now how balloonTexts will be rendered.

=============== Diff against Morphic-mt.788 ===============

Item was changed:
  ----- Method: ClickExerciser>>initButtons (in category 'initialization') -----
  initButtons
+ 	| aButton positions |
+ 	aButton := ThreePhaseButtonMorph checkBox. 
+ 	positions := ((0 at 0) rect: aButton extent negated) corners + self center .
+ 	buttons := positions collect: [ :p | ThreePhaseButtonMorph checkBox position: p; state: #on ] .
+ 	buttons with: self allSelectors do: [ :b :s | b balloonText:  s asString ] .
+ 	self removeAllMorphs .
+ 	self addAllMorphs:  buttons .
- | aButton positions |
- aButton := ThreePhaseButtonMorph checkBox. 
- positions := ((0 at 0) rect: aButton extent negated) corners + self center .
- buttons := positions collect: [ :p | ThreePhaseButtonMorph checkBox position: p; state: #on ] .
- buttons with: self allSelectors collect: [ :b :s | b setBalloonText:  s asString maxLineLength: s size  ] .
- self removeAllMorphs .
- self addAllMorphs:  buttons .
  !

Item was changed:
  ----- Method: Morph>>balloonText (in category 'accessing') -----
  balloonText
  	"Answer balloon help text or nil, if no help is available.  
  	NB: subclasses may override such that they programatically  
  	construct the text, for economy's sake, such as model phrases in 
  	a Viewer"
  
+ 	| result |
- 	| text balloonSelector aString |
  	extension ifNil: [^nil].
+ 	
+ 	extension balloonText
+ 		ifNotNil: [:balloonText | result := balloonText]
+ 		ifNil: [extension balloonTextSelector
+ 			ifNotNil: [:balloonSelector |
+ 				result := ScriptingSystem helpStringOrNilFor: balloonSelector.
+ 				(result isNil and: [balloonSelector == #methodComment]) 
+ 					ifTrue: [result := self methodCommentAsBalloonHelp].
+ 				((result isNil and: [balloonSelector numArgs = 0]) 
+ 					and: [self respondsTo: balloonSelector]) 
+ 						ifTrue: [result := self perform: balloonSelector]]].
+ 	
+ 	^ result ifNotNil: [:balloonText |
+ 		balloonText asString withNoLineLongerThan: Preferences maxBalloonHelpLineLength]!
- 	(text := extension balloonText) ifNotNil: [^text].
- 	(balloonSelector := extension balloonTextSelector) ifNotNil: 
- 			[aString := ScriptingSystem helpStringOrNilFor: balloonSelector.
- 			(aString isNil and: [balloonSelector == #methodComment]) 
- 				ifTrue: [aString := self methodCommentAsBalloonHelp].
- 			((aString isNil and: [balloonSelector numArgs = 0]) 
- 				and: [self respondsTo: balloonSelector]) 
- 					ifTrue: [aString := self perform: balloonSelector]].
- 	^aString ifNotNil: 
- 			[aString asString 
- 				withNoLineLongerThan: Preferences maxBalloonHelpLineLength]!

Item was added:
+ ----- Method: Morph>>balloonText: (in category 'accessing') -----
+ balloonText: aString
+ 
+ 	self assureExtension balloonText: aString.!

Item was changed:
  ----- Method: Morph>>setBalloonText: (in category 'halos and balloon help') -----
  setBalloonText: stringOrText
  	"Set receiver's balloon help text. Pass nil to remove the help."
  
+ 	self flag: #deprecated. "mt: Use #balloonText:."
  	self setBalloonText: stringOrText maxLineLength: Preferences maxBalloonHelpLineLength!

Item was changed:
  ----- Method: Morph>>setBalloonText:maxLineLength: (in category 'halos and balloon help') -----
  setBalloonText: stringOrText maxLineLength: aLength 
  	"Set receiver's balloon help text. Pass nil to remove the help."
+ 	
+ 	self flag: #deprecated. "mt: Use #balloonText:."
  	(extension isNil and: [stringOrText isNil]) ifTrue: [^ self].
  	self assureExtension balloonText: 
  		(stringOrText ifNotNil: [stringOrText asString withNoLineLongerThan: aLength])!



More information about the Squeak-dev mailing list