[etoys-dev] Etoys: Morphic-bf.36.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Aug 14 14:11:50 EDT 2010


Bert Freudenberg uploaded a new version of Morphic to project Etoys:
http://source.squeak.org/etoys/Morphic-bf.36.mcz

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

Name: Morphic-bf.36
Author: bf
Time: 14 August 2010, 8:10:39 pm
UUID: 129f3783-acb0-4478-89ab-d96dc668b758
Ancestors: Morphic-bf.35, Morphic-Richo.33

merge from inbox
--------------------------
Name: Morphic-Richo.33
Author: Richo
Time: 13 August 2010, 12:16:05 am
UUID: 948f0511-353a-354f-afd3-573552bd7fbb
Ancestors: Morphic-bf.30

* Added some useful methods for the Graphing tools:

ScrollPane now defers halo to its interior.

TextMorph adds the following behavior:
- If a property called #crPassesFocus is true it passes the focus to the next morph when the enter key is pressed.
- If a property called #highlightsOnFocus is true it changes its border color to red when it gets the focus.

=============== Diff against Morphic-bf.35 ===============

Item was added:
+ ----- Method: TextMorph>>highlightsOnFocus: (in category 'accessing') -----
+ highlightsOnFocus: aBoolean
+ "See #highlightsOnFocus comment"
+ ^self setProperty: #highlightsOnFocus toValue: aBoolean
+ !

Item was changed:
  ----- Method: TextMorph>>handleKeystroke: (in category 'events-processing') -----
  handleKeystroke: anEvent
  	"System level event handling."
  
  	| pasteUp |
  	anEvent wasHandled ifTrue:[^self].
  	(self handlesKeyboard: anEvent) ifFalse:	[^ self].
  	anEvent wasHandled: true.
+ 	((anEvent keyCharacter = Character tab) or: [self crPassesFocus and: [anEvent keyCharacter = Character cr]]) ifTrue:
- 	anEvent keyCharacter = Character tab ifTrue:
  		["Allow passing through text morph inside pasteups"
  		(self wouldAcceptKeyboardFocusUponTab and:
  				[(pasteUp _ self pasteUpMorphHandlingTabAmongFields) notNil])
  			ifTrue:[^ pasteUp tabHitWithEvent: anEvent]].
  	self keyStroke: anEvent!

Item was changed:
  ----- Method: TextMorph>>keyboardFocusChange: (in category 'event handling') -----
  keyboardFocusChange: aBoolean 
  	| w |
  	paragraph isNil ifFalse:[paragraph focused: aBoolean].
  	aBoolean 
  		ifTrue: 
  			["A hand is wanting to send us characters..."
  
  			self hasFocus ifFalse: [self editor	"Forces install"]]
  		ifFalse: 
  			["A hand has clicked elsewhere..."
  
  			(w := self world) isNil 
  				ifFalse: 
  					[w handsDo: [:h | h keyboardFocus == self ifTrue: [^self]].
  					"Release control unless some hand is still holding on"
+ 					self releaseEditor]].
+ 	self highlightsOnFocus ifTrue: [
+ 		aBoolean ifTrue: [self borderColor: Color red]  ifFalse: [self borderColor: Color black]]!
- 					self releaseEditor]]!

Item was added:
+ ----- Method: TextMorph>>crPassesFocus (in category 'accessing') -----
+ crPassesFocus
+ ^self valueOfProperty: #crPassesFocus ifAbsent: [false]!

Item was added:
+ ----- Method: ScrollPane>>defersHaloToInteriorMorph: (in category 'halo') -----
+ defersHaloToInteriorMorph: aMorph
+ ^true
+ !

Item was added:
+ ----- Method: TextMorph>>highlightsOnFocus (in category 'accessing') -----
+ highlightsOnFocus
+ "If this property is true, whenever the user clicks on the text it will show the focus change by changing its border color to red"
+ ^self valueOfProperty: #highlightsOnFocus ifAbsent: [false]
+ !

Item was added:
+ ----- Method: TextMorph>>crPassesFocus: (in category 'accessing') -----
+ crPassesFocus: aBoolean
+ ^self setProperty: #crPassesFocus toValue: aBoolean
+ !



More information about the etoys-dev mailing list