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

commits at source.squeak.org commits at source.squeak.org
Mon May 16 12:47:05 EDT 2011


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

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

Name: Morphic-bf.53
Author: bf
Time: 16 May 2011, 6:46:04 pm
UUID: f2ed04e3-1b64-46c7-950d-ff2928a765ad
Ancestors: Morphic-kfr.52

- rename insertCharactersAtEnd: to appendCharacters:
- make appendCharacters: and insertCharacters: retain the text attributes

=============== Diff against Morphic-kfr.52 ===============

Item was added:
+ ----- Method: TextMorph>>appendCharacters: (in category 'scripting access') -----
+ appendCharacters: aString
+ 	"append the characters from the given player to my end"
+ 
+ 	| end aText attributes |
+ 	end := text size.
+ 	aText := end = 0
+ 		ifTrue: [aString asText]
+ 		ifFalse: [
+ 			attributes := (text attributesAt: end)
+ 				select: [:attr | attr mayBeExtended].
+ 			Text string: aString attributes: attributes].
+ 	paragraph replaceFrom: end + 1 to: end with: aText displaying: true.
+ 	self updateFromParagraph   !

Item was changed:
  ----- Method: TextMorph>>insertCharacters: (in category 'scripting access') -----
+ insertCharacters: aString
- insertCharacters: aSource
  	"Insert the characters from the given source at my current cursor position"
  
+ 	| aLoc aText attributes |
+ 	aLoc := self cursor max: 1.
+ 	aText := aLoc > text size
+ 		ifTrue: [aString asText]
+ 		ifFalse: [
+ 			attributes := (text attributesAt: aLoc)
+ 				select: [:attr | attr mayBeExtended].
+ 			Text string: aString attributes: attributes].
+ 	paragraph replaceFrom: aLoc to: (aLoc - 1) with: aText displaying: true.
- 	| aLoc |
- 	aLoc _ self cursor max: 1.
- 	paragraph replaceFrom: aLoc to: (aLoc - 1) with: aSource asText displaying: true.
  	self updateFromParagraph  !

Item was removed:
- ----- Method: TextMorph>>insertCharactersAtEnd: (in category 'scripting access') -----
- insertCharactersAtEnd: aSource
- 	"Insert the characters from the given player at my current cursor position"
- 
- 	| aLoc |
- 	aLoc _ text string size + 1.
- 	paragraph replaceFrom: aLoc to: (aLoc - 1) with: aSource asText displaying: true.
- 	self updateFromParagraph   !



More information about the etoys-dev mailing list