[etoys-dev] Etoys Inbox: Morphic-Richo.33.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Aug 12 23:17:36 EDT 2010

A new version of Morphic was added to project Etoys Inbox:

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

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.30 ===============

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].
  			["A hand is wanting to send us characters..."
  			self hasFocus ifFalse: [self editor	"Forces install"]]
  			["A hand has clicked elsewhere..."
  			(w := self world) isNil 
  					[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