[squeak-dev] The Trunk: EToys-ct.479.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Aug 25 12:02:20 UTC 2022


Christoph Thiede uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-ct.479.mcz

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

Name: EToys-ct.479
Author: ct
Time: 25 August 2022, 2:02:14.951239 pm
UUID: 8dffae2e-c439-844d-928f-a07e29343637
Ancestors: EToys-ct.478

Adds and improves high-dpi support for several morphs and games:

* Calendar
* Cipher Panel, Crostic Panel (also converted help messages to regular workspaces using #edit)
* Free Cell
* Objects Tool/Parts Bin (complements MorphicExtras-ct.327)
* Same Game
* Spectrum Analyzer (also fixed slider and removed obsolete construction selectors)
* Tetris

=============== Diff against EToys-ct.478 ===============

Item was changed:
  ----- Method: CalendarMorph>>dayInitialsRow (in category 'building') -----
  dayInitialsRow
  	| newRow |
  	newRow := self newRow.
  	Week dayNames
  		do: [:dayName|
  			newRow addMorphBack: (TextMorph new 
  				contentsWrapped: dayName translated first asString;
  				textColor: self labelsDefaultColor;
  				autoFit: false;
+ 				width: 30 px;
- 				width: 30;
  				centered;
  				lock)]
  		separatedBy: [newRow addMorphBack: AlignmentMorph newVariableTransparentSpacer].
  	^newRow !

Item was changed:
  ----- Method: CalendarMorph>>newButtonWithContents: (in category 'building') -----
+ newButtonWithContents: aString
+  
+ 	^ SimpleButtonMorph new 
+ 		label: aString;
- newButtonWithContents: aByteString 
- 	^SimpleButtonMorph new 
- 		label: aByteString;
  		color: (self color mixed: 0.5 with: Color gray);
+ 		borderStyle: (BorderStyle raised width: 2 px);
+ 		yourself!
- 		borderStyle: (BorderStyle raised width: 2)!

Item was changed:
  ----- Method: CalendarMorph>>newDateButtonWithContents: (in category 'building') -----
+ newDateButtonWithContents: aString
+ 
+ 	^ SimpleButtonMorph new
+ 		label: aString;
- newDateButtonWithContents: aByteString 
- 	^SimpleButtonMorph new
- 		label: aByteString;
  		cornerStyle: #square;
  		color: self color muchLighter;
+ 		borderStyle: (BorderStyle raised width: 2 px);
+ 		width: 30 px;
+ 		yourself!
- 		borderStyle: (BorderStyle raised width: 2);
- 		width: 30!

Item was changed:
  ----- Method: CipherPanel>>buttonRow (in category 'menu') -----
  buttonRow
  	| row aButton |
  	row := AlignmentMorph newRow color: self color;
  				 hResizing: #shrinkWrap;
  				 vResizing: #shrinkWrap.
  	#('show help' 'show hints' 'clear typing' 'enter a new cipher' 'quote from Squeak' ) translatedNoop
  		with: #(#showHelpWindow #showHintsWindow #clearTyping #enterANewCipher #squeakCipher )
  		do: [:label :selector | 
  			aButton := SimpleButtonMorph new target: self.
  			aButton color: Color transparent;
+ 				 borderWidth: 1 px;
- 				 borderWidth: 1;
  				 borderColor: Color black.
  			aButton actionSelector: selector.
  			aButton label: label translated.
  			row addMorphBack: aButton.
+ 			row addTransparentSpacerOfSize: 3 px @ 0].
- 			row addTransparentSpacerOfSize: 3 @ 0].
  	^ row!

Item was changed:
  ----- Method: CipherPanel>>encodedQuote: (in category 'initialization') -----
  encodedQuote: aString 
  	"World addMorph: CipherPanel new"
  	| morph prev |
  	aString isEmpty
  		ifTrue: [^ self].
  	(letterMorphs isNil
  			or: [self isClean])
  		ifFalse: [(self confirm: 'Are you sure you want to discard all typing?' translated)
  				ifFalse: [^ self]].
  	haveTypedHere := false.
  	quote := aString asUppercase.
  	prev := nil.
  	originalMorphs := quote asArray
  				withIndexCollect: [:c :i | WordGameLetterMorph new plain indexInQuote: i id1: nil;
  						
  						setLetter: (quote at: i)].
  	letterMorphs := OrderedCollection new.
  	decodingMorphs := quote asArray
  				withIndexCollect: [:c :i | (quote at: i) isLetter
  						ifTrue: [morph := WordGameLetterMorph new underlined indexInQuote: i id1: nil.
  							morph
  								on: #mouseDown
  								send: #mouseDownEvent:letterMorph:
  								to: self.
  							morph
  								on: #keyStroke
  								send: #keyStrokeEvent:letterMorph:
  								to: self.
  							letterMorphs addLast: morph.
  							morph predecessor: prev.
  							prev
  								ifNotNil: [prev successor: morph].
  							prev := morph]
  						ifFalse: [WordGameLetterMorph new plain indexInQuote: i id1: nil;
  								
  								setLetter: (quote at: i)]].
  	self color: originalMorphs first color.
+ 	self extent: 500 px @ 500 px.!
- 	self extent: 500 @ 500!

Item was changed:
  ----- Method: CipherPanel>>extent: (in category 'geometry') -----
  extent: newExtent 
  	"Lay out with word wrap, alternating bewteen decoded and encoded lines."
  	"Currently not tolerant of narrow (less than a word) margins"
  
  	| w h relLoc topLeft thisWord i m corner row firstWord |
  	self removeAllMorphs.
+ 	w := originalMorphs first width - 1 px.  h := originalMorphs first height * 2 + 10 px.
+ 	topLeft := self position + self borderWidth + (0 @ 10 px).
- 	w := originalMorphs first width - 1.  h := originalMorphs first height * 2 + 10.
- 	topLeft := self position + self borderWidth + (0 at 10).
  	thisWord := OrderedCollection new.
  	i := 1.  firstWord := true.  relLoc := 0 at 0.  corner := topLeft.
  	[i <= originalMorphs size] whileTrue:
  		[m := originalMorphs at: i.
  		thisWord addLast: ((decodingMorphs at: i) position: topLeft + relLoc).
  		thisWord addLast: (m position: topLeft + relLoc + (0 at m height)).
  		(m letter = Character space or: [i = originalMorphs size])
  			ifTrue: [self addAllMorphs: thisWord.
  					corner := corner max: thisWord last bounds bottomRight.
  					thisWord reset.  firstWord := false].
  		relLoc := relLoc + (w at 0).
  		(relLoc x + w) > newExtent x
  			ifTrue: [firstWord
  						ifTrue: ["No spaces -- force a line break"
  								thisWord removeLast; removeLast.
  								self addAllMorphs: thisWord.
  								corner := corner max: thisWord last bounds bottomRight]
  						ifFalse: [i := i - (thisWord size//2) + 1].
  					thisWord reset.  firstWord := true.
  					relLoc := 0@(relLoc y + h)]
  			ifFalse: [i := i + 1]].
  	row := self buttonRow. row fullBounds.
  	self addMorph: row.
+ 	super extent: (corner - topLeft) + (self borderWidth * 2) + (0 @ row height + 10 px).
+ 	row align: row bounds bottomCenter with: self bounds bottomCenter - (0 @ 2 px).!
- 	super extent: (corner - topLeft) + (self borderWidth * 2) + (0 at row height+10).
- 	row align: row bounds bottomCenter with: self bounds bottomCenter - (0 at 2).!

Item was changed:
  ----- Method: CipherPanel>>showHelpWindow (in category 'menu') -----
  showHelpWindow
- 	((PluggableTextMorph new setText: 'The Cipher Panel displays an encrypted message.  The encryption is a simple substitution code;  each letter of the alphabet has been changed to a different one.
  
+ 	'The Cipher Panel displays an encrypted message.  The encryption is a simple substitution code;  each letter of the alphabet has been changed to a different one.
+ 
  You can solve the cipher by clicking above any letter in the message, and typing the letter you think it should be.  The Cipher Panel automatically makes the same substitution anywhere else that letter occurs in the encoded message.
  
+ If you are having trouble, you can use the command menu to ''show cipher hints''.  That will display how many of each letter occurs, which is often a help in solving ciphers.' translated
+ 	editWithLabel: 'About the Cipher Panel' translated.!
- If you are having trouble, you can use the command menu to ''show cipher hints''.  That will display how many of each letter occurs, which is often a help in solving ciphers.' translated )
- 		embeddedInMorphicWindowLabeled: 'About the Cipher Panel' translated)
- 		setWindowColor: (Color
- 				r: 1.0
- 				g: 0.6
- 				b: 0.0);
- 		 openInWorld: self world extent: 389 @ 209!

Item was changed:
  ----- Method: CipherPanel>>showHintsWindow (in category 'menu') -----
  showHintsWindow
+ 
+ 	('Most bodies of english text follow a general pattern of letter usage.  The following are the most common letters, in approximate order of frequency:
- 	((PluggableTextMorph new setText: 'Most bodies of english text follow a general pattern of letter usage.  The following are the most common letters, in approximate order of frequency:
  	E  T  A  O  N  I  R  S  H
  The following are the most common digraphs:
  	EN  ER  RE  NT  TH  ON  IN
  
+ The message you are trying to decode has the following specific statistics: {1}
- The message you are trying to decode has the following specific statistics:' translated , self cipherStats , '
  
+ Good luck!!' translated format: {self cipherStats})
+ 		editWithLabel: 'Some Useful Statistics' translated.!
- Good luck!!' translated)
- 		embeddedInMorphicWindowLabeled: 'Some Useful Statistics' translated)
- 		setWindowColor: (Color
- 				r: 1.0
- 				g: 0.6
- 				b: 0.0);
- 		 openInWorld: self world extent: 318 @ 326!

Item was changed:
  ----- Method: CrosticPanel>>buttonRow (in category 'menu') -----
  buttonRow
  	| row aButton |
  	row := AlignmentMorph newRow color: self color;
  				 hResizing: #shrinkWrap;
  				 vResizing: #shrinkWrap.
  	#('show help' 'show errors' 'show hints' 'clear' 'open...' ) translatedNoop
  		with: #(#showHelpWindow #showErrors #showHintsWindow #clearTyping #openFile )
  		do: [:label :selector | 
  			aButton := SimpleButtonMorph new target: self.
  			aButton color: Color transparent;
+ 				 borderWidth: 1 px;
- 				 borderWidth: 1;
  				 borderColor: Color black.
  			aButton actionSelector: selector.
  			aButton label: label translated.
  			row addMorphBack: aButton.
+ 			row addTransparentSpacerOfSize: 3 px @ 0].
- 			row addTransparentSpacerOfSize: 3 @ 0].
  	^ row!

Item was changed:
  ----- Method: CrosticPanel>>quote:clues:answers:quotePanel: (in category 'initialization') -----
  quote: indexableQuote clues: clueStrings answers: answerIndices quotePanel: panel
  
  	| row clue answer answerMorph letterMorph prev clueText clueStyle |
  	quote := indexableQuote.
  	quotePanel := panel.
  	clues := clueStrings.
  	answers := answerIndices.
  	cluesPanel := AlignmentMorph newColumn color: self color;
  		hResizing: #shrinkWrap; vResizing: #shrinkWrap;
+ 		cellPositioning: #topLeft; layoutInset: 1 px.
- 		cellPositioning: #topLeft; layoutInset: 1.
  	letterMorphs := Array new: quotePanel letterMorphs size.
  	clueStyle := nil.
  	1 to: clues size do:
  		[:i |  clue := clues at: i.  answer := answers at: i.
  		row := AlignmentMorph newRow cellPositioning: #bottomLeft.
+ 		clueText := (TextMorph newBounds: (0 @ 0 extent: 120 px @ 20 px) color: Color black)
- 		clueText := (TextMorph newBounds: (0 at 0 extent: 120 at 20) color: Color black)
  				string: (CrosticPanel oldStyle
  							ifTrue: [(($A to: $Z) at: i) asString , '.  ' , clue]
  							ifFalse: [clue])
+ 				fontName: 'ComicPlain' size: 13 px.
- 				fontName: 'ComicPlain' size: 13.
  		clueStyle ifNil: ["Make up a special style with decreased leading"
  						clueStyle := clueText textStyle copy.
  						clueStyle gridForFont: 1 withLead: -2].
  		clueText text: clueText asText textStyle: clueStyle.  "All clues share same style"
  		clueText composeToBounds.
  		row addMorphBack: clueText.
  		answerMorph := AlignmentMorph newRow layoutInset: 0.
  		prev := nil.
  		answer do:
  			[:n | letterMorph := WordGameLetterMorph new underlined
  						indexInQuote: n
  						id1: (CrosticPanel oldStyle ifTrue: [n printString] ifFalse: [nil]);
  						setLetter: Character space.
  			letterMorph on: #mouseDown send: #mouseDownEvent:letterMorph: to: self.
  			letterMorph on: #keyStroke send: #keyStrokeEvent:letterMorph: to: self.
  			letterMorph predecessor: prev.
  			prev ifNotNil: [prev successor: letterMorph].
  			prev := letterMorph.
  			letterMorphs at: n put: letterMorph.
  			answerMorph addMorphBack: letterMorph].
  		answerMorph color: answerMorph firstSubmorph color.
  		row addMorphBack: answerMorph.
  row fullBounds.
  		row color: answerMorph firstSubmorph color.
  		cluesPanel addMorphBack: row].
  	self addMorph: cluesPanel.
+ 	self bounds: cluesPanel fullBounds.!
- 	self bounds: cluesPanel fullBounds.
- !

Item was changed:
  ----- Method: CrosticPanel>>showHelpWindow (in category 'menu') -----
  showHelpWindow
- 	((PluggableTextMorph new setText: 'The Crostic Panel presents an acrostic puzzle for solution.  As you type in answers for the clues, the letters also get entered in the text of the hidden quote.  Conversely, as you guess words in the quote, those letters will fill in missing places in your answers.  In addition, the first letters of all the answers together form the author''s name and title of the work from which the quote is taken.
  
+ 	'The Crostic Panel presents an acrostic puzzle for solution.  As you type in answers for the clues, the letters also get entered in the text of the hidden quote.  Conversely, as you guess words in the quote, those letters will fill in missing places in your answers.  In addition, the first letters of all the answers together form the author''s name and title of the work from which the quote is taken.
+ 
  If you wish to make up other acrostic puzzles, follow the obvious file format in the sampleFile method.  If you wish to print an acrostic to work it on paper, then change the oldStyle method to return true, and it will properly cross-index all the cells.
  
+ Have fun!!' translated
+ 		editWithLabel: 'About the Crostic Panel' translated.!
- Have fun.' translated)
- 		embeddedInMorphicWindowLabeled: 'About the Crostic Panel' translated)
- 		setWindowColor: (Color
- 				r: 1.0
- 				g: 0.6
- 				b: 0.0);
- 		 openInWorld: self world extent: 409 @ 207!

Item was changed:
  ----- Method: CrosticPanel>>showHintsWindow (in category 'menu') -----
  showHintsWindow
  	| hints |
  	(self confirm: 'As hints, you will be given the five longest answers.
  Do you really want to do this?' translated)
  		ifFalse: [^ self].
  	hints := (answers sorted: [:x :y | x size > y size]) first: 5.
+ 	(('The five longest answers are...
- 	((PluggableTextMorph new setText: 'The five longest answers are...
  ' translated
  			, (String
  					streamContents: [:strm | 
  						hints
  							do: [:hint | strm cr;
  									nextPutAll: (hint
  											collect: [:i | quote at: i])].
+ 						strm cr; cr]) , 'Good luck!!' translated))
+ 			editWithLabel: 'Crostic Hints' translated.!
- 						strm cr; cr]) , 'Good luck!!' translated)
- 		embeddedInMorphicWindowLabeled: 'Crostic Hints' translated)
- 		setWindowColor: (Color
- 				r: 1.0
- 				g: 0.6
- 				b: 0.0);
- 		 openInWorld: self world extent: 198 @ 154!

Item was changed:
  ----- Method: CrosticQuotePanel>>extent: (in category 'geometry') -----
  extent: newExtent
  
  	| w h nAcross relLoc topLeft |
+ 	w := self firstSubmorph width - 1 px.  h := self firstSubmorph height - 1 px.
+ 	nAcross := newExtent x - (self borderWidth - 1 px * 2) - 1 px // w.
+ 	topLeft := self position + self borderWidth - 1 px.
- 	w := self firstSubmorph width - 1.  h := self firstSubmorph height - 1.
- 	nAcross := newExtent x - (self borderWidth-1*2)-1 // w.
- 	topLeft := self position + self borderWidth - 1.
  	submorphs withIndexDo:
  		[:m :i | 
  		relLoc := (i-1 \\ nAcross * w) @ (i-1 // nAcross * h).
  		m position: topLeft + relLoc].
  	super extent: ((w * nAcross + 1) @ (submorphs size - 1 // nAcross + 1 * h+1))
+ 					+ (self borderWidth - 1 px * 2).!
- 					+ (self borderWidth - 1 * 2).
- !

Item was changed:
  ----- Method: CrosticQuotePanel>>quote:answers:cluesPanel: (in category 'initialization') -----
  quote: quoteWithBlanks answers: theAnswers cluesPanel: panel
  
  	| n morph prev clueIxs |
  	cluesPanel := panel.
  	self color: Color gray.
  	clueIxs := Array new: quoteWithBlanks size.
  	theAnswers withIndexDo: [:a :i | a do: [:j | clueIxs at: j put: i]].
  	letterMorphs := OrderedCollection new.
  	prev := nil.
  	self addAllMorphs: (quoteWithBlanks asArray collect:
  		[:c |
  		c isLetter
  			ifTrue: [n := letterMorphs size + 1.
  					morph := WordGameLetterMorph new boxed.
  					CrosticPanel oldStyle
  						ifTrue: [morph indexInQuote: n id1: n printString.
  								morph id2: (($A to: $Z) at: (clueIxs at: n)) asString]
  						ifFalse: [morph indexInQuote: n id1: nil].
  					morph setLetter: Character space.
  					morph on: #mouseDown send: #mouseDownEvent:letterMorph: to: self.
  					morph on: #keyStroke send: #keyStrokeEvent:letterMorph: to: self.
  					letterMorphs addLast: morph]
  			ifFalse: [morph := WordGameLetterMorph new boxed indexInQuote: nil id1: nil.
+ 					CrosticPanel oldStyle ifTrue: [morph extent: 26 px @ 24 px  "Oops"]].
- 					CrosticPanel oldStyle ifTrue: [morph extent: 26 at 24  "Oops"]].
  		morph predecessor: prev.
  		prev ifNotNil: [prev successor: morph].
+ 		prev := morph]).!
- 		prev := morph]).
- !

Item was changed:
  ----- Method: FreeCell>>buildButton:target:label:selector: (in category 'private') -----
  buildButton: aButton target: aTarget label: aLabel selector: aSelector
  	"wrap a button or switch in an alignmentMorph to provide some space around the button"
  
  	| a |
  	aButton 
  		target: aTarget;
  		label: aLabel;
  		actionSelector: aSelector;
+ 		borderStyle: (BorderStyle raised width: 2 px);
- 		borderStyle: (BorderStyle raised width: 2);
  		color: Color gray.
  	a := AlignmentMorph newColumn
  		wrapCentering: #center; cellPositioning: #topCenter;
  		hResizing: #shrinkWrap;
  		vResizing: #shrinkWrap;
  		color: Color transparent;
+ 		layoutInset: 1 px.
- 		layoutInset: 1.
  	a addMorph: aButton.
+ 	^ a!
- 	^ a
- 
- !

Item was changed:
  ----- Method: FreeCell>>defaultBorderWidth (in category 'initialization') -----
  defaultBorderWidth
  	"answer the default border width for the receiver"
+ 	^ 2 px!
- 	^ 2!

Item was changed:
  ----- Method: FreeCell>>makeCardsRemainingDisplay (in category 'initialization') -----
  makeCardsRemainingDisplay
  	cardsRemainingDisplay := LedMorph new digits: 2;
+ 				 extent: 10 px * 2 @ 15 px.
- 				 extent: 2 * 10 @ 15.
  	^ self wrapPanel: cardsRemainingDisplay label: 'Cards Left: ' translated!

Item was changed:
  ----- Method: FreeCell>>makeControlBar (in category 'initialization') -----
  makeControlBar
  
  	^AlignmentMorph newRow
  		color: self colorNearBottom;
+ 		borderStyle: (BorderStyle inset width: 2 px);
- 		borderStyle: (BorderStyle inset width: 2);
  		layoutInset: 0;
  		hResizing: #spaceFill; vResizing: #shrinkWrap; wrapCentering: #center; cellPositioning: #leftCenter;
  		yourself.!

Item was changed:
  ----- Method: FreeCell>>makeElapsedTimeDisplay (in category 'initialization') -----
  makeElapsedTimeDisplay
  	elapsedTimeDisplay := LedTimerMorph new digits: 3;
+ 				 extent: 10 px * 3 @ 15 px.
- 				 extent: 3 * 10 @ 15.
  	^ self wrapPanel: elapsedTimeDisplay label: 'Elapsed Time: ' translated!

Item was changed:
  ----- Method: FreeCell>>makeGameNumberDisplay (in category 'initialization') -----
  makeGameNumberDisplay
  	gameNumberDisplay := LedMorph new digits: 5;
+ 				 extent: 10 px * 5 @ 15 px.
- 				 extent: 5 * 10 @ 15.
  	^ self wrapPanel: gameNumberDisplay label: 'Game #: ' translated!

Item was changed:
  ----- Method: FreeCell>>wrapPanel:label: (in category 'private') -----
  wrapPanel: anLedPanel label: aLabel
  	"wrap an LED panel in an alignmentMorph with a label to its left"
  
  	| a |
  	a := AlignmentMorph newRow
  		wrapCentering: #center; cellPositioning: #leftCenter;
  		hResizing: #shrinkWrap;
  		vResizing: #shrinkWrap;
  		borderWidth: 0;
+ 		layoutInset: 5 px;
- 		layoutInset: 5;
  		color: Color transparent.
  	a addMorph: anLedPanel.
  	a addMorph: (StringMorph contents: aLabel). 
+ 	^ a!
- 	^ a
- !

Item was changed:
  ----- Method: FreeCellBoard>>cardCell (in category 'layout') -----
  cardCell
  
  	^PlayingCardDeck new
  		layout: #pile; 
  		listDirection: #topToBottom;
  		enableDragNDrop;
  		color: Color transparent;
  		borderColor: (Color gray alpha: 0.5);
+ 		borderWidth: 2 px;
- 		borderWidth: 2;
  		layoutBounds: (0 at 0 extent: PlayingCardMorph width @ PlayingCardMorph height);
  		yourself!

Item was changed:
  ----- Method: FreeCellBoard>>initialize (in category 'initialization') -----
  initialize
  	"initialize the state of the receiver"
  	super initialize.
  	""
  	self listDirection: #topToBottom;
  	  hResizing: #shrinkWrap;
  	  vResizing: #rigid;
+ 	  height: 500 px;
- 	  height: 500;
  	  layout!

Item was changed:
  ----- Method: FreeCellStatistics>>buildButton:target:label:selector: (in category 'user interface') -----
  buildButton: aButton target: aTarget label: aLabel selector: aSelector
  	"wrap a button or switch in an alignmentMorph to provide some space around the button"
  
  	| a |
  	aButton 
  		target: aTarget;
  		label: aLabel;
  		actionSelector: aSelector;
+ 		borderStyle: (BorderStyle raised width: 2 px);
- 		borderStyle: (BorderStyle raised width: 2);
  		color: Color gray.
  	a := AlignmentMorph newColumn
  		wrapCentering: #center; cellPositioning: #topCenter;
  		hResizing: #spaceFill;
  		vResizing: #shrinkWrap;
  		color: Color transparent;
+ 		layoutInset: 1 px.
- 		layoutInset: 1.
  	a addMorph: aButton.
+ 	^ a!
- 	^ a
- 
- !

Item was changed:
  ----- Method: FreeCellStatistics>>display (in category 'user interface') -----
  display
  	| panel |
  
  	(window notNil and: [window owner notNil]) ifTrue: [window activate. ^nil].
  	panel := AlignmentMorph newColumn.
  	panel
  		wrapCentering: #center; cellPositioning: #topCenter;
  		hResizing: #rigid;
  		vResizing: #rigid;
+ 		extent: 250 px @ 150 px;
- 		extent: 250 at 150;
  		color: self color;
  		addMorphBack: self makeStatistics;
  		addMorphBack: self makeControls.
  	window := panel openInWindowLabeled: 'FreeCell Statistics' translated.!

Item was changed:
  ----- Method: FreeCellStatistics>>makeControls (in category 'user interface') -----
  makeControls
  	| row |
  
  	row := AlignmentMorph newRow.
  	row
  		wrapCentering: #center; cellPositioning: #leftCenter;
  		hResizing: #spaceFill;
  		vResizing: #shrinkWrap;
  		color: self color;
+ 		borderStyle: (BorderStyle inset width: 2 px);
- 		borderStyle: (BorderStyle inset width: 2);
  		addMorphBack: self makeOkButton;
  		addMorphBack: self makeResetButton.
  	^row.!

Item was changed:
  ----- Method: FreeCellStatistics>>makeStatistics (in category 'user interface') -----
  makeStatistics
  	| row |
  
  	row := AlignmentMorph newRow.
  	row
  		wrapCentering: #center; cellPositioning: #leftCenter;
  		hResizing: #spaceFill;
  		vResizing: #spaceFill;
  		color: self color;
+ 		borderStyle: (BorderStyle inset width: 2 px);
- 		borderStyle: (BorderStyle inset width: 2);
  		addMorphBack: (AlignmentMorph newColumn
  			wrapCentering: #center; cellPositioning: #topCenter;
  			color: self color;
  			addMorph: (statsMorph := TextMorph new contents: self statsText)).
  	^row.!

Item was changed:
  ----- Method: ObjectsTool>>initializeForFlap: (in category '*Etoys-Squeakland-initialization') -----
  initializeForFlap: forStartup
  	| buttonPane aBin aColor heights tabsPane |
  
  	forStartup ifTrue: [
  		self basicInitialize.
  
  		self layoutInset: 0;
  			layoutPolicy: ProportionalLayout new;
  			hResizing: #shrinkWrap;
  			vResizing: #rigid;
+ 			borderWidth: 2 px; borderColor: Color darkGray;
- 			borderWidth: 2; borderColor: Color darkGray;
  			extent: (self minimumWidth @ self minimumHeight).
  	].
  
  	"mode buttons"
  	buttonPane := self paneForTabs: self modeTabs.
  	buttonPane
  		vResizing: #shrinkWrap;
  		setNameTo: 'ButtonPane';
  		color: (aColor := buttonPane color) darker;
+ 		layoutInset: 6 px;
- 		layoutInset: 6;
  		wrapDirection: nil;
  		width: self width;
  		layoutChanged; fullBounds.
  
  	"Place holder for a tabs or text pane"
  	tabsPane := Morph new
  		setNameTo: 'TabPane';
  		hResizing: #spaceFill;
  		yourself.
  
+ 	heights := { buttonPane height. 40 px }.
- 	heights := { buttonPane height. 40 }.
  
  	buttonPane vResizing: #spaceFill.
  	self
  		addMorph: buttonPane
  		fullFrame: (LayoutFrame
  				fractions: (0 @ 0 corner: 1 @ 0)
  				offsets: (0 @ 0 corner: 0 @ heights first)).
  
  	self
  		addMorph: tabsPane
  		fullFrame: (LayoutFrame
  				fractions: (0 @ 0 corner: 1 @ 0)
  				offsets: (0 @ heights first corner: 0 @ (heights first + heights second))).
  
  	aBin := (PartsBin newPartsBinWithOrientation: #leftToRight from: #())
  		listDirection: #leftToRight;
  		wrapDirection: #topToBottom;
  		color: aColor lighter lighter;
  		setNameTo: 'Parts';
  		dropEnabled: false;
  		vResizing: #spaceFill;
  		yourself.
  
  	self
  		addMorph: aBin
  		fullFrame: (LayoutFrame
  				fractions: (0 @ 0 corner: 1 @ 1)
  				offsets: (0 @ (heights first + heights second) corner: 0 @ 0)).
  
  	aBin color: (Color orange muchLighter);
  		setNameTo: 'Objects' translated.
  
  	self color: (Color orange muchLighter);
+ 		setNameTo: 'Objects' translated.!
- 		setNameTo: 'Objects' translated.
- !

Item was changed:
  ----- Method: ObjectsTool>>initializeToStandAlone: (in category '*Etoys-Squeakland-initialization') -----
  initializeToStandAlone: forStartup
  	| buttonPane aBin aColor heights tabsPane |
  
  	forStartup ifTrue: [
  		self basicInitialize.
  
+ 		self layoutInset: 6 px;
- 		self layoutInset: 6;
  			layoutPolicy: ProportionalLayout new;
  			useRoundedCorners;
  			hResizing: #rigid;
  			vResizing: #rigid;
  			extent: (self minimumWidth @ self minimumHeight).
  	].
  
  	"mode buttons"
  	buttonPane := self paneForTabs: self modeTabs.
  	buttonPane
  		vResizing: #shrinkWrap;
  		setNameTo: 'ButtonPane';
  		addMorphFront: self dismissButton;
  		addMorphBack: self helpButton;
  		color: (aColor := buttonPane color) darker;
+ 		layoutInset: 6 px;
- 		layoutInset: 6;
  		wrapDirection: nil;
  		width: self width;
  		layoutChanged; fullBounds.
  
  	"Place holder for a tabs or text pane"
  	tabsPane := Morph new
  		setNameTo: 'TabPane';
  		hResizing: #spaceFill;
  		yourself.
  
+ 	heights := { buttonPane height. 40 px }.
- 	heights := { buttonPane height. 40 }.
  
  	buttonPane vResizing: #spaceFill.
  	self
  		addMorph: buttonPane
  		fullFrame: (LayoutFrame
  				fractions: (0 @ 0 corner: 1 @ 0)
  				offsets: (0 @ 0 corner: 0 @ heights first)).
  
  	self
  		addMorph: tabsPane
  		fullFrame: (LayoutFrame
  				fractions: (0 @ 0 corner: 1 @ 0)
  				offsets: (0 @ heights first corner: 0 @ (heights first + heights second))).
  
  	aBin := (PartsBin newPartsBinWithOrientation: #leftToRight from: #())
  		listDirection: #leftToRight;
  		wrapDirection: #topToBottom;
  		color: aColor lighter lighter;
  		setNameTo: 'Parts';
  		dropEnabled: false;
  		vResizing: #spaceFill;
  		yourself.
  
  	self
  		addMorph: aBin
  		fullFrame: (LayoutFrame
  				fractions: (0 @ 0 corner: 1 @ 1)
  				offsets: (0 @ (heights first + heights second) corner: 0 @ 0)).
  
  	self color: (Color r: 0.0 g: 0.839 b: 0.226);
  		setNameTo: 'Objects' translated.
  
  	forStartup ifTrue: [
  		self showCategories.
  	]!

Item was changed:
  ----- Method: PartsBin>>listDirection:quadList:withPreviousEntries: (in category '*Etoys-Squeakland-initialization') -----
  listDirection: aListDirection quadList: quadList withPreviousEntries: aCollection
  	"Initialize the receiver to run horizontally or vertically, obtaining its elements from the list of tuples of the form:
  		(<receiver> <selector> <label> <balloonHelp>)"
  
  	| aButton aClass oldDict |
  	self layoutPolicy: TableLayout new.
  	self listDirection: aListDirection.
  	self wrapCentering: #topLeft.
+ 	self layoutInset: 2 px.
- 	self layoutInset: 2.
  	self cellPositioning: #bottomCenter.
  
  	oldDict := Dictionary new.
  	aCollection ifNotNil: [
  		aCollection do: [:e | oldDict at: e target put: e]
  	].
  	aListDirection == #leftToRight
  		ifTrue:
  			[self vResizing: #rigid.
  			self hResizing: #spaceFill.
  			self wrapDirection: #topToBottom]
  		ifFalse:
  			[self hResizing: #rigid.
  			self vResizing: #spaceFill.
  			self wrapDirection: #leftToRight].
  	quadList do:
  		[:tuple |
  			aClass := Smalltalk at: tuple first.
  			aButton := oldDict at: aClass ifAbsent: [].
  			(aButton isNil or: [#(TextMorph ScriptableButton) includes: aClass name]) ifTrue: [
  				aButton := IconicButtonWithLabel new initializeWithThumbnail: (self class thumbnailForQuad: tuple color: self color) withLabel: tuple third andColor: self color andSend: tuple second to: aClass.
  				(tuple size > 3 and: [tuple fourth isEmptyOrNil not]) ifTrue:
  					[aButton setBalloonText: tuple fourth].
  			] ifFalse: [
  				aButton labelString: tuple third.
  				aButton arguments: {aButton arguments first. tuple third}.
  				(tuple size > 3 and: [tuple fourth isEmptyOrNil not]) ifTrue:
  					[aButton setBalloonText: tuple fourth].
  			].
   			self addMorphBack: aButton]!

Item was changed:
  ----- Method: PlayingCardDeck>>staggerOffset (in category 'layout') -----
  staggerOffset
+ 	^18 px!
- 	^18!

Item was changed:
  ----- Method: PlayingCardMorph class>>cardSize (in category 'access') -----
  cardSize
  	" a real hack, but I don't want to muck with Dan's class "
+ 	^71 px @ 96 px!
- 	^71 at 96.!

Item was changed:
  ----- Method: PlayingCardMorph class>>the:of: (in category 'initialize-release') -----
  the: cardNumber of: suit
  
+ 	| image |
+ 	image := (PlayingCard the: cardNumber of: suit) cardForm.
+ 	image := image scaledToSize: image extent * RealEstateAgent scaleFactor.
  	^ self new 
+ 		image: image;
- 		image: (PlayingCard the: cardNumber of: suit) cardForm;
  		cardNumber: cardNumber suitNumber: (self suits indexOf: suit)!

Item was changed:
  ----- Method: SameGame>>buildButton:target:label:selector: (in category 'initialization') -----
  buildButton: aButton target: aTarget label: aLabel selector: aSelector
  	"wrap a button or switch in an alignmentMorph to allow a row of buttons to fill space"
  
  	| a |
  	aButton 
  		target: aTarget;
  		label: aLabel;
  		actionSelector: aSelector;
+ 		borderStyle: (BorderStyle raised width: 2 px);
- 		borderStyle: (BorderStyle raised width: 2);
  		color: color.
  	a := AlignmentMorph newColumn
  		wrapCentering: #center; cellPositioning: #topCenter;
  		hResizing: #spaceFill;
  		vResizing: #shrinkWrap;
  		color: color.
  	a addMorph: aButton.
+ 	^ a!
- 	^ a
- 
- !

Item was changed:
  ----- Method: SameGame>>initialize (in category 'initialization') -----
  initialize
  	"initialize the state of the receiver"
  	super initialize.
  	""
  	self listDirection: #topToBottom;
  	  wrapCentering: #center;
  		 cellPositioning: #topCenter;
  	  vResizing: #shrinkWrap;
  	  hResizing: #shrinkWrap;
+ 	  layoutInset: 3 px;
- 	  layoutInset: 3;
  	  addMorph: self makeControls;
  	  addMorph: self board.
  	helpText := nil.
  	self newGame!

Item was changed:
  ----- Method: SameGame>>makeControls (in category 'initialization') -----
  makeControls
  
  	| row |
  	row := AlignmentMorph newRow
  		color: color;
  		borderWidth: 0;
+ 		layoutInset: 3 px.
+ 	row hResizing: #spaceFill; vResizing: #shrinkWrap; wrapCentering: #center; cellPositioning: #leftCenter; extent: 5 px @ 5 px.
- 		layoutInset: 3.
- 	row hResizing: #spaceFill; vResizing: #shrinkWrap; wrapCentering: #center; cellPositioning: #leftCenter; extent: 5 at 5.
  	row addMorph:
  		(self
  			buildButton: SimpleSwitchMorph new
  			target: self
  			label: 'Help' translated
  			selector: #help:).
  	row addMorph:
  		(self
  			buildButton: SimpleButtonMorph new
  			target: self
  			label: 'Quit' translated
  			selector: #delete).
  	row addMorph:
  		(self
  			buildButton: SimpleButtonMorph new
  			target: self board
  			label: 'Hint' translated
  			selector: #hint).
  	row addMorph:
  		(self
  			buildButton: SimpleButtonMorph new
  			target: self
  			label: 'New game' translated
  			selector: #newGame).
  	selectionDisplay := LedMorph new
  		digits: 2;
+ 		extent: (10 px * 2 @ 15 px).
- 		extent: (2*10 at 15).
  	row addMorph: (self wrapPanel: selectionDisplay label: 'Selection:' translated).
  	scoreDisplay := LedMorph new
  		digits: 4;
+ 		extent: (10 px * 4 @ 15 px).
- 		extent: (4*10 at 15).
  	row addMorph: (self wrapPanel: scoreDisplay label: 'Score:' translated).
  	^ row!

Item was changed:
  ----- Method: SameGameBoard>>defaultBorderWidth (in category 'initialization') -----
  defaultBorderWidth
  	"answer the default border width for the receiver"
+ 	^ 2 px!
- 	^ 2!

Item was changed:
  ----- Method: SameGameTile>>initialize (in category 'initialization') -----
  initialize
  
  	super initialize.
  	self label: ''.
+ 	self borderWidth: 2 px.
+ 	bounds := 0 @ 0 corner: 16 px @ 16 px.
- 	self borderWidth: 2.
- 	bounds := 0 at 0 corner: 16 at 16.
  	offColor := Color gray.
  	onColor := Color gray.
  	switchState := false.
  	oldSwitchState := false.
  	disabled := false.
+ 	self useSquareCorners.!
- 	self useSquareCorners
- 	!

Item was removed:
- ----- Method: SpectrumAnalyzerMorph>>addLevelSlider (in category 'private') -----
- addLevelSlider
- 
- 	| levelSlider r |
- 	levelSlider := SimpleSliderMorph new
- 		color: color;
- 		extent: 100 at 2;
- 		target: soundInput;
- 		actionSelector: #recordLevel:;
- 		adjustToValue: soundInput recordLevel.
- 	r := AlignmentMorph newRow
- 		color: color;
- 		layoutInset: 0;
- 		wrapCentering: #center; cellPositioning: #leftCenter;
- 		hResizing: #shrinkWrap;
- 		vResizing: #rigid;
- 		height: 24.
- 	r addMorphBack: (StringMorph contents: '0 ').
- 	r addMorphBack: levelSlider.
- 	r addMorphBack: (StringMorph contents: ' 10').
- 	self addMorphBack: r.
- !

Item was changed:
  ----- Method: SpectrumAnalyzerMorph>>addLevelSliderIn: (in category 'private') -----
  addLevelSliderIn: aPoint
  
  	| levelSlider r |
+ 	(levelSlider := SimpleSliderMorph new)
- 	levelSlider := SimpleSliderMorph new
  		color: color;
+ 		sliderColor: Color gray;
+ 		extent: (aPoint x * 0.75) asInteger @ (aPoint y * 0.6) asInteger;
+ 		minimumExtent: levelSlider extent;
- 		extent: (aPoint x * 0.75) asInteger@(aPoint y*0.6) asInteger;
  		target: soundInput;
  		actionSelector: #recordLevel:;
+ 		orientation: #horizontal;
  		adjustToValue: soundInput recordLevel.
  	r := AlignmentMorph newRow
  		color: color;
  		layoutInset: 0;
  		wrapCentering: #center; cellPositioning: #leftCenter;
  		hResizing: #shrinkWrap;
  		vResizing: #rigid;
+ 		height: aPoint y + 2 px.
- 		height: aPoint y + 2.
  	r addMorphBack: (StringMorph contents: '0 ' font: Preferences standardEToysButtonFont).
  	r addMorphBack: levelSlider.
  	r addMorphBack: (StringMorph contents: ' 10' font: Preferences standardEToysButtonFont).
+ 	self addMorphBack: r.!
- 	self addMorphBack: r.
- !

Item was changed:
  ----- Method: SpectrumAnalyzerMorph>>defaultBorderWidth (in category 'initialization') -----
  defaultBorderWidth
  "answer the default border width for the receiver"
+ 	^ 2 px!
- 	^ 2!

Item was changed:
  ----- Method: SpectrumAnalyzerMorph>>initialize (in category 'initialization') -----
  initialize
  "initialize the state of the receiver"
  	| full |
  	super initialize.
  ""
  	self listDirection: #topToBottom.
  	soundInput := SoundInputStream new samplingRate: 22050.
  	fft := FFT new: 512.
  	displayType := 'sonogram'.
  	self hResizing: #shrinkWrap.
  	self vResizing: #shrinkWrap.
  	full := self addButtonRow.
  	submorphs last addMorphBack: (self makeStatusLightIn: full extent).
  
  	self addLevelSliderIn: full extent.
  	self addMorphBack: (self makeLevelMeterIn: full extent).
+ 	self addMorphBack: (Morph new extent: 10 px @ 10 px;
- 	self addMorphBack: (Morph new extent: 10 @ 10;
  			 color: Color transparent).
  	"spacer"
  	self resetDisplay!

Item was removed:
- ----- Method: SpectrumAnalyzerMorph>>makeLevelMeter (in category 'private') -----
- makeLevelMeter
- 
- 	| outerBox |
- 	outerBox := RectangleMorph new extent: 125 at 14; color: Color lightGray.
- 	levelMeter := Morph new extent: 2 at 10; color: Color yellow.
- 	levelMeter position: outerBox topLeft + (2 at 2).
- 	outerBox addMorph: levelMeter.
- 	^ outerBox
- !

Item was changed:
  ----- Method: SpectrumAnalyzerMorph>>makeLevelMeterIn: (in category 'private') -----
  makeLevelMeterIn: aPoint
  
  	| outerBox h |
  	h := (aPoint y * 0.6) asInteger.
+ 	outerBox := Morph new extent: aPoint x asInteger @ h; color: Color gray.
+ 	levelMeter := Morph new extent: 1 px @ h; color: Color yellow.
+ 	levelMeter position: outerBox topLeft + (1 px @ 1 px).
- 	outerBox := Morph new extent: (aPoint x) asInteger at h; color: Color gray.
- 	levelMeter := Morph new extent: 1 at h; color: Color yellow.
- 	levelMeter position: outerBox topLeft + (1 at 1).
  	outerBox addMorph: levelMeter.
+ 	^ outerBox!
- 	^ outerBox
- !

Item was removed:
- ----- Method: SpectrumAnalyzerMorph>>makeStatusLight (in category 'private') -----
- makeStatusLight
- 
- 	| s |
- 	statusLight := RectangleMorph new extent: 24 at 19.
- 	statusLight color: Color gray.
- 	s := StringMorph contents: 'On' translated.
- 	s position: statusLight center - (s extent // 2).
- 	statusLight addMorph: s.
- 	^ statusLight
- !

Item was changed:
  ----- Method: SpectrumAnalyzerMorph>>makeStatusLightIn: (in category 'private') -----
  makeStatusLightIn: aPoint
  
  	| s p |
  	p := (aPoint x min: aPoint y) asPoint.
  	statusLight := RectangleMorph new extent: p.
  	statusLight color: Color gray.
+ 	s := StringMorph contents: '' font: Preferences standardButtonFont.
- 	s := StringMorph contents: 'On' translated font: Preferences standardEToysFont.
- 	s position: statusLight center - (s extent // 2).
  	statusLight addMorph: s.
+ 	^ statusLight!
- 	^ statusLight
- !

Item was changed:
  ----- Method: SpectrumAnalyzerMorph>>showSignal (in category 'private') -----
  showSignal
  	"Display the actual signal waveform."
  
  	displayType := 'signal'.
  	self removeAllDisplays.
  	graphMorph := GraphMorph new.
+ 	graphMorph extent: (400 px + (graphMorph borderWidth * 2)) @ 128 px.
- 	graphMorph extent: (400 + (2 * graphMorph borderWidth))@128.
  	graphMorph data: (Array new: 100 withAll: 0).
  	graphMorph color: (Color r: 0.8 g: 1.0 b: 1.0).
  	self addMorphBack: graphMorph.
+ 	self extent: 10 px @ 10 px.  "shrink to minimum size"!
- 	self extent: 10 at 10.  "shrink to minimum size"
- !

Item was changed:
  ----- Method: SpectrumAnalyzerMorph>>showSonogram (in category 'private') -----
  showSonogram
  	"Display a sonogram showing the frequency spectrum versus time."
  
  	| zeros h w |
  	displayType := 'sonogram'.
  	self removeAllDisplays.
  	h := fft n // 2.
+ 	h := h min: 512 px max: 64 px.
+ 	w := 400 px.
- 	h := h min: 512 max: 64.
- 	w := 400.
  	sonogramMorph :=
  		Sonogram new
  			extent: w at h
  			minVal: 0.0
  			maxVal: 1.0
  			scrollDelta: w.
  	zeros := Array new: sonogramMorph height withAll: 0.
  	sonogramMorph width timesRepeat: [sonogramMorph plotColumn: zeros].
  	self addMorphBack: sonogramMorph.
+ 	self extent: 10 px @ 10 px.  "shrink to minimum size"!
- 	self extent: 10 at 10.  "shrink to minimum size"
- !

Item was changed:
  ----- Method: SpectrumAnalyzerMorph>>showSpectrum (in category 'private') -----
  showSpectrum
  	"Display the frequency spectrum."
  
  	displayType := 'spectrum'.
  	self removeAllDisplays.
  	graphMorph := GraphMorph new.
+ 	graphMorph extent: ((fft n // 2) + (graphMorph borderWidth * 2)) @ 128 px.
- 	graphMorph extent: ((fft n // 2) + (2 * graphMorph borderWidth))@128.
  	graphMorph data: (Array new: fft n // 2 withAll: 0).
  	self addMorphBack: graphMorph.
+ 	self extent: 10 px @ 10 px.  "shrink to minimum size"!
- 	self extent: 10 at 10.  "shrink to minimum size"
- !

Item was changed:
  ----- Method: SpectrumAnalyzerMorph>>step (in category 'stepping and presenter') -----
  step
  	"Update the record light, level meter, and display."
  
  	| w |
  	"update the record light and level meter"
  	statusLight color:
  		(soundInput isRecording ifTrue: [Color yellow] ifFalse: [Color gray]).
  	statusLight firstSubmorph in: [:stringMorph |
  		stringMorph contents:
  			(soundInput isRecording ifTrue: ['On' translated] ifFalse: ['Off' translated]).
  		stringMorph position: statusLight center - (stringMorph extent // 2)].
  	
+ 	w := ((121 px * soundInput meterLevel) // 100) max: 1.
- 	w := ((121 * soundInput meterLevel) // 100) max: 1.
  	levelMeter width: w.
  	
  	"update the display if any data is available"
  	self updateDisplay.!

Item was changed:
  ----- Method: Tetris>>buildButtonTarget:label:selector:help: (in category 'initialization') -----
  buildButtonTarget: aTarget label: aLabel selector: aSelector help: aString
  
  	^self rowForButtons
  		addMorph: (
  			SimpleButtonMorph new 
  				target: aTarget;
  				label: aLabel;
  				actionSelector: aSelector;
+ 				borderStyle: (BorderStyle raised width: 2 px);
- 				borderStyle: (BorderStyle raised width: 2);
  				color: color
+ 		)!
- 		)
- 
- !

Item was changed:
  ----- Method: Tetris>>initialize (in category 'initialization') -----
  initialize
  	"initialize the state of the receiver"
  	super initialize.
  	""
  	board := TetrisBoard new game: self.
  	self listDirection: #topToBottom;
  	  wrapCentering: #center;
  	  vResizing: #shrinkWrap;
  	  hResizing: #shrinkWrap;
+ 	  layoutInset: 3 px;
- 	  layoutInset: 3;
  	  addMorphBack: self makeGameControls;
  		 addMorphBack: self makeMovementControls;
  		 addMorphBack: self showScoreDisplay;
  		 addMorphBack: board.
  	board newGame!

Item was changed:
  ----- Method: Tetris>>rowForButtons (in category 'initialization') -----
  rowForButtons
  
  	^AlignmentMorph newRow
  		color: color;
  		borderWidth: 0;
+ 		layoutInset: 3 px;
- 		layoutInset: 3;
  		vResizing: #shrinkWrap;
  		wrapCentering: #center
  !

Item was changed:
  ----- Method: Tetris>>showScoreDisplay (in category 'initialization') -----
  showScoreDisplay
  	^ self rowForButtons hResizing: #shrinkWrap;
  		
  		addMorph: (self wrapPanel: ((scoreDisplay := LedMorph new) digits: 5;
+ 					 extent: 10 px * 4 @ 15 px) label: 'Score:' translated)!
- 					 extent: 4 * 10 @ 15) label: 'Score:' translated)!

Item was changed:
  ----- Method: TetrisBlock>>defaultBounds (in category 'initialization') -----
  defaultBounds
  "answer the default bounds for the receiver"
+ 	^ (2 px @ 2 px) negated extent: 1 px @ 1 px!
- 	^ (2 @ 2) negated extent: 1 @ 1!

Item was changed:
  ----- Method: TetrisBoard>>cellSize (in category 'accessing') -----
  cellSize
  
+ 	^12 px @ 12 px!
- 	^12 at 12!

Item was changed:
  ----- Method: TetrisBoard>>defaultBounds (in category 'initialization') -----
  defaultBounds
  "answer the default bounds for the receiver"
+ 	^ 0 @ 0 extent: self numColumns @ self numRows * self cellSize + (1 px @ 1 px)!
- 	^ 0 @ 0 extent: self numColumns @ self numRows * self cellSize + (1 @ 1)!

Item was changed:
  ----- Method: WordGameLetterMorph>>id2: (in category 'initialization') -----
  id2: idString
  	"Add further clue id for acrostic puzzles."
  
  	| idMorph |
  	idString ifNotNil:
  		[idMorph := StringMorph contents: idString font: IDFont.
+ 		idMorph align: idMorph bounds topRight with: self bounds topRight + (-1 px @ -1 px).
- 		idMorph align: idMorph bounds topRight with: self bounds topRight + (-1@ -1).
  		self addMorph: idMorph].
  
  !

Item was changed:
  ----- Method: WordGameLetterMorph>>indexInQuote:id1: (in category 'initialization') -----
  indexInQuote: qi id1: aString 
  	"Initialize me with the given index and an optional aString"
  	| idMorph y |
  	style = #boxed
  		ifTrue: [aString isNil
+ 				ifTrue: [self extent: 18 px @ 16 px;
+ 						 borderWidth: 1 px]
+ 				ifFalse: [self extent: 26 px @ 24 px;
+ 						 borderWidth: 1 px]]
- 				ifTrue: [self extent: 18 @ 16;
- 						 borderWidth: 1]
- 				ifFalse: [self extent: 26 @ 24;
- 						 borderWidth: 1]]
  		ifFalse: [aString isNil
+ 				ifTrue: [self extent: 18 px @ 16 px;
- 				ifTrue: [self extent: 18 @ 16;
  						 borderWidth: 0]
+ 				ifFalse: [self extent: 18 px @ 26 px;
- 				ifFalse: [self extent: 18 @ 26;
  						 borderWidth: 0]].
  	qi
  		ifNil: [^ self color: Color gray].
  	"blank"
  	self color: self normalColor.
  	indexInQuote := qi.
  	style == #underlined
+ 		ifTrue: [y := self bottom - 2 px.
- 		ifTrue: [y := self bottom - 2.
  			aString
+ 				ifNotNil: [y := y - IDFont ascent + 2 px].
- 				ifNotNil: [y := y - IDFont ascent + 2].
  			lineMorph := PolygonMorph
+ 						vertices: {self left + 2 px @ y. self right - 3 px @ y}
- 						vertices: {self left + 2 @ y. self right - 3 @ y}
  						color: Color gray
+ 						borderWidth: 1 px
- 						borderWidth: 1
  						borderColor: Color gray.
  			self addMorph: lineMorph.
  			aString
  				ifNil: [^ self].
  			idMorph := StringMorph contents: aString font: IDFont.
+ 			idMorph align: idMorph bounds bottomCenter with: self bounds bottomCenter + (0 @ (IDFont descent - 1 px)).
- 			idMorph align: idMorph bounds bottomCenter with: self bounds bottomCenter + (0 @ (IDFont descent - 1)).
  			self addMorphBack: idMorph]
  		ifFalse: [aString
  				ifNil: [^ self].
  			idMorph := StringMorph contents: aString font: IDFont.
+ 			idMorph align: idMorph bounds topLeft with: self bounds topLeft + (2 px @ -1 px).
- 			idMorph align: idMorph bounds topLeft with: self bounds topLeft + (2 @ -1).
  			self addMorph: idMorph
  			" 
  			World addMorph: (WordGameLetterMorph new boxed  
  			indexInQuote: 123 id1: '123';  
  			id2: 'H'; setLetter: $W).  
  			World addMorph: (WordGameLetterMorph new underlined  
  			indexInQuote: 123 id1: '123';  
  			setLetter: $W).  
  			World addMorph: (WordGameLetterMorph new underlined  
  			indexInQuote: 123 id1: nil;  
  			setLetter: $W). 
  			"]!

Item was changed:
  ----- Method: WordGameLetterMorph>>setLetter:color: (in category 'initialization') -----
  setLetter: aLetter color: aColor 
  	letterMorph ifNotNil: [letterMorph delete].
  	letter := aLetter.
  	letter ifNil: [^letterMorph := nil].
  	letterMorph := StringMorph contents: aLetter asString font: LetterFont.
  	letterMorph color: aColor.
  	style == #boxed 
  		ifTrue: 
  			[letterMorph align: letterMorph bounds bottomCenter
+ 				with: self bounds bottomCenter + (0 @ (LetterFont descent - 2 px))]
- 				with: self bounds bottomCenter + (0 @ (LetterFont descent - 2))]
  		ifFalse: 
  			[lineMorph isNil 
  				ifTrue: 
  					[letterMorph align: letterMorph bounds bottomCenter
+ 						with: self bounds bottomCenter + (0 @ (LetterFont descent - 4 px))]
- 						with: self bounds bottomCenter + (0 @ (LetterFont descent - 4))]
  				ifFalse: 
  					[letterMorph align: letterMorph bounds bottomCenter
  						with: self center x @ (lineMorph top + LetterFont descent)]].
  	self addMorphBack: letterMorph!




More information about the Squeak-dev mailing list