[BUG][FIX] Squeak 3.8 TextMorph does not implement selectFrom:to: sent from TextMorphEditor

Ken Causey ken at kencausey.com
Wed Jun 1 15:22:45 UTC 2005


David,

There is an existing report about this issue in the Mantis Database with
ID 589

http://bugs.impara.de/view.php?id=589

If you don't mind please update this report with your information
including your fix.  Note however that fixes are usually submitted as
gzipped changesets.

A couple of notes:

First of all you might want to clarify that this bug results from trying
to change the 'style' using the sort of peach colored 'Change Style'
halo button.  There is no error when you use the 'Change Font' halo
button.

I filed your fix into a 3.8-6665 image where I was able to reproduce the
error and it did seem to fix the problem.

However I get this same error in 3.9-6648 but when I file in your fix
the error goes away but when the style is changed the text does not
reflect the change.

If you would when you update Mantis report 589 please close this report
or let me know and I will close it for you.

Thanks,

Ken

On Wed, 2005-06-01 at 10:55 -0400, David Shaffer wrote:
> Bring up a text morph in 3.8 and try to change the font.  You should get
> attached walkback.  I fixed this by changing receiver of selectFrom:to:
> (in TextMorphEditor>>changeStyle) from the TextMorph to the
> TextMorphEditor itself.  I have no idea if this is consistent with the
> intent of the morph/editor design but it works.
> 
> David
> 
> plain text document attachment (TextMorphEditor-changeStyle.st)
> 'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 1 June 2005 at 10:52:07 am'!
> 
> !TextMorphEditor methodsFor: 'attributes' stamp: 'cds 6/1/2005 10:51'!
> changeStyle
> 	"Let user change styles for the current text pane."
> 	| aList reply style theStyle menuList startIndex stopIndex |
> 	self flag: #arNote. "Move this up once we get rid of MVC"
> 	startIndex := self startIndex.
> 	stopIndex := self stopIndex-1 min: paragraph text size.
> 	aList := StrikeFont actualFamilyNames.
> 	theStyle := paragraph textStyle.
> 	menuList := aList collect:[:styleName|
> 		"Hack!! use defaultFont for comparison - we have no name that we could use for compare and the style changes with alignment so they're no longer equal."
> 		(TextConstants at: styleName) defaultFont == theStyle defaultFont
> 			ifTrue:['<on>', styleName]
> 			ifFalse:['<off>',styleName]].
> 	theStyle = TextStyle default
> 		ifTrue:[menuList addFirst: '<on>DefaultTextStyle']
> 		ifFalse:[menuList addFirst: '<off>DefaultTextStyle'].
> 	aList addFirst: 'DefaultTextStyle'.
> 	reply := (SelectionMenu labelList: menuList lines: #(1) selections: aList) startUpWithCaption: nil at: ActiveHand position allowKeyboard: false.
> 	reply ifNotNil:
> 		[(style := TextStyle named: reply) ifNil: [Beeper beep. ^ true].
> 		paragraph textStyle: style copy.
> 		paragraph composeAll.
> 		self recomputeSelection.
> 		self mvcRedisplay].
> 	self selectFrom: startIndex to: stopIndex.
> 	^ true! !
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20050601/dc3cc522/attachment.pgp


More information about the Squeak-dev mailing list