[BUG][FIX] BitEditor>>setColor:

Brian T Rice water at tunes.org
Mon Nov 18 23:07:47 UTC 2002


StrikeFont>>edit: wasn't working because setColor: was not calling
pixelValueForDepth: properly. This fixes a call and adds a note to the
StrikeFont edit: example that it only works in MVC.

-- 
Brian T. Rice
LOGOS Research and Development
mailto:water at tunes.org
http://tunes.org/~water/
-------------- next part --------------
'From Squeak3.2 of 11 July 2002 [latest update: #4956] on 18 November 2002 at 3:03:12 pm'!
"Change Set:		FontEditFix-btr
Date:			18 November 2002
Author:			Brian T. Rice

Fixed BitEditor's initializing method setColor: to grab the right bit-depth, which prevented it from opening, and added a note to StrikeFont>>edit: that it only works in MVC."!


!BitEditor methodsFor: 'menu messages' stamp: 'btr 11/18/2002 14:57'!
setColor: aColor 
	"Set the color that the next edited dots of the model to be the argument,  
	aSymbol. aSymbol can be any color changing message understood by a  
	Form, such as white or black."
	color _ aColor pixelValueForDepth: Display depth.
	squareForm fillColor: aColor!
]style[(10 6 3 177 2 5 3 6 37 10 12 6)f1b,f1cblue;b,f1,f1c152050000,f1,f1cmagenta;,f1,f1cblue;i,f1,f1cmagenta;,f1,f1cblue;i! !


!StrikeFont methodsFor: 'character shapes' stamp: 'btr 11/18/2002 15:00'!
edit: character 
	"(TextStyle default fontAt: 1) edit: $_"
	"Open a Bit Editor on the given character. Note that you must do an accept 
	(in the option menu of the bit editor) if you want this work. 
	Accepted edits will not take effect in the font until you leave or close the bit editor. 
	Also note that unaccepted edits will be lost when you leave or close."
	"Note that BitEditor only works in MVC currently."
	| charForm editRect scaleFactor bitEditor savedForm r |
	charForm _ self characterFormAt: character.
	editRect _ BitEditor locateMagnifiedView: charForm scale: (scaleFactor _ 8 @ 8).
	bitEditor _ BitEditor
				bitEdit: charForm
				at: editRect topLeft
				scale: scaleFactor
				remoteView: nil.
	savedForm _ Form fromDisplay: (r _ bitEditor displayBox
							expandBy: (0 @ 23 corner: 0 @ 0)).
	bitEditor controller startUp.
	bitEditor release.
	savedForm displayOn: Display at: r topLeft.
	self characterFormAt: character put: charForm! !



More information about the Squeak-dev mailing list