lists.squeakfoundation.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Packages
December 2010
----- 2024 -----
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
packages@lists.squeakfoundation.org
2 participants
359 discussions
Start a n
N
ew thread
The Trunk: Morphic-nice.502.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-nice.502.mcz
==================== Summary ==================== Name: Morphic-nice.502 Author: nice Time: 29 December 2010, 4:12:44.089 pm UUID: 46f308ec-bfaf-4cca-abeb-ccda9b2c6f4f Ancestors: Morphic-mtf.501 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. =============== Diff against Morphic-mtf.501 =============== Item was changed: ----- Method: BalloonCanvas>>makeRoundRectShape:radius: (in category 'private') ----- makeRoundRectShape: aRectangle radius: radius "decompose a rounded rectangle into bezier form" | ovalDiameter rectExtent segments points endPoint seg idx offset rectOffset | ovalDiameter := (radius * 2) asPoint min: aRectangle extent. + (ovalDiameter x <= 0 or: [ovalDiameter y <= 0]) ifTrue: [ - (ovalDiameter x <= 0 or:[ovalDiameter y <= 0]) ifTrue:[ "degenerates into rectangle - just hand back four lines" | topLeft topRight bottomLeft bottomRight | topLeft := aRectangle topLeft. topRight := aRectangle topRight. bottomLeft := aRectangle bottomLeft. bottomRight := aRectangle bottomRight. + points := Array new: 4 * 3. - points := Array new: 4*3. points at: 1 put: topLeft. points at: 2 put: topLeft. points at: 3 put: topRight. points at: 4 put: topRight. points at: 5 put: topRight. points at: 6 put: bottomRight. points at: 7 put: bottomRight. points at: 8 put: bottomRight. points at: 9 put: bottomLeft. points at: 10 put: bottomLeft. points at: 11 put: bottomLeft. points at: 12 put: topLeft. ^points ]. rectExtent := aRectangle extent - ovalDiameter. rectOffset := aRectangle origin. + segments := Bezier2Segment makeEllipseSegments: (0 @ 0 extent: ovalDiameter). - segments := Bezier2Segment makeEllipseSegments: (0@0 extent: ovalDiameter). "patch up the segments to include lines connecting the oval parts. we need: 8*3 points for the oval parts + 4*3 points for the connecting lines" + points := Array new: 12 * 3. - points := Array new: 12*3. idx := 0. "Tweaked offsets to clean up curves. MAD" + endPoint := segments last end + rectOffset + (0 @ -1). + 1 to: 8 by: 2 do: [:i | + i = 1 ifTrue: [offset := rectOffset + (rectExtent x @ 0) + (1 @ -1)]. "top, tr" + i = 3 ifTrue: [offset := rectOffset + rectExtent + (1 @ 1)]. "right, br" + i = 5 ifTrue: [offset := rectOffset + (0 @ rectExtent y) + (0 @ 1)]. "bottom, bl" + i = 7 ifTrue: [offset := rectOffset + (0 @ -1)]."left, tl" - endPoint := segments last end + rectOffset + (0@-1). - 1 to: 8 by: 2 do:[:i| - i = 1 ifTrue:[offset := rectOffset + (rectExtent x @ 0) + (1@-1)]. "top, tr" - i = 3 ifTrue:[offset := rectOffset + rectExtent + (1@1)]. "right, br" - i = 5 ifTrue:[offset := rectOffset + (0 @ rectExtent y) + (0@1)]. "bottom, bl" - i = 7 ifTrue:[offset := rectOffset + (0@-1)]."left, tl" seg := segments at: i. "insert a line segment for the horizontal part of the round rect" + points at: (idx := idx + 1) put: endPoint. + points at: (idx := idx + 1) put: endPoint. + points at: (idx := idx + 1) put: seg start + offset. - points at: (idx := idx+1) put: endPoint. - points at: (idx := idx+1) put: endPoint. - points at: (idx := idx+1) put: seg start + offset. "now the first half-arc" + points at: (idx := idx + 1) put: seg start + offset. + points at: (idx := idx + 1) put: seg via + offset. + points at: (idx := idx + 1) put: seg end + offset. - points at: (idx := idx+1) put: seg start + offset. - points at: (idx := idx+1) put: seg via + offset. - points at: (idx := idx+1) put: seg end + offset. "the second half-arc" + seg := segments at: i + 1. + points at: (idx := idx + 1) put: seg start + offset. + points at: (idx := idx + 1) put: seg via + offset. + points at: (idx := idx + 1) put: seg end + offset. - seg := segments at: i+1. - points at: (idx := idx+1) put: seg start + offset. - points at: (idx := idx+1) put: seg via + offset. - points at: (idx := idx+1) put: seg end + offset. endPoint := seg end + offset. ]. ^points! Item was changed: ----- Method: MorphicProject>>setAsBackground: (in category 'utilities') ----- setAsBackground: aForm "Set aForm as a background image." + | thisWorld newColor | + thisWorld := self currentWorld. - | world newColor | - world := self currentWorld. newColor := InfiniteForm with: aForm. aForm rememberCommand: (Command new cmdWording: 'set background to a picture' translated; + undoTarget: thisWorld selector: #color: argument: thisWorld color; + redoTarget: thisWorld selector: #color: argument: newColor). + thisWorld color: newColor - undoTarget: world selector: #color: argument: world color; - redoTarget: world selector: #color: argument: newColor). - world color: newColor ! Item was changed: ----- Method: PolygonMorph>>nudgeForLabel: (in category 'attachments') ----- nudgeForLabel: aRectangle "Try to move the label off me. Prefer labels on the top and right." | i flags nudge | + (self bounds intersects: aRectangle) ifFalse: [^ 0 @ 0 ]. - (self bounds intersects: aRectangle) ifFalse: [^ 0@0 ]. flags := 0. + nudge := 0 @ 0. - nudge := 0@0. i := 1. aRectangle lineSegmentsDo: [ :rp1 :rp2 | | rectSeg | rectSeg := LineSegment from: rp1 to: rp2. self straightLineSegmentsDo: [ :lp1 :lp2 | | polySeg int | polySeg := LineSegment from: lp1 to: lp2. int := polySeg intersectionWith: rectSeg. int ifNotNil: [ flags := flags bitOr: i ]. ]. i := i * 2. ]. "Now flags has bitflags for which sides" nudge := flags caseOf: { "no intersection" + [ 0 ] -> [ 0 @ 0 ]. - [ 0 ] -> [ 0@0 ]. "2 adjacent sides only" + [ 9 ] -> [ 1 @ 1 ]. + [ 3 ] -> [ -1 @ 1 ]. + [ 12 ] -> [ 1 @ -1 ]. + [ 6 ] -> [ -1 @ -1 ]. - [ 9 ] -> [ 1@1 ]. - [ 3 ] -> [ -1@1 ]. - [ 12 ] -> [ 1@-1 ]. - [ 6 ] -> [ -1@-1 ]. "2 opposite sides only" + [ 10 ] -> [ 0 @ -1 ]. + [ 5 ] -> [ 1 @ 0 ]. - [ 10 ] -> [ 0@-1 ]. - [ 5 ] -> [ 1@0 ]. "only 1 side" + [ 8 ] -> [ -1 @ 0 ]. + [ 1 ] -> [ 0 @ -1 ]. + [ 2 ] -> [ 1 @ 0 ]. + [ 4 ] -> [ 0 @ 1 ]. - [ 8 ] -> [ -1@0 ]. - [ 1 ] -> [ 0@-1 ]. - [ 2 ] -> [ 1@0 ]. - [ 4 ] -> [ 0@1 ]. "3 sides" + [ 11 ] -> [ 0 @ 1 ]. + [ 13 ] -> [ 1 @ 0 ]. + [ 14 ] -> [ 0 @ -1 ]. + [ 7 ] -> [ -1 @ 0 ]. - [ 11 ] -> [ 0@1 ]. - [ 13 ] -> [ 1@0 ]. - [ 14 ] -> [ 0@-1 ]. - [ 7 ] -> [ -1@0 ]. "all sides" + [ 15 ] -> [ 1 @ -1 "move up and to the right" ]. - [ 15 ] -> [ 1@-1 "move up and to the right" ]. }. ^nudge! Item was changed: ----- Method: PreDebugWindow>>adjustBookControls (in category 'as yet unclassified') ----- adjustBookControls | inner | proceedButton ifNil: [^ self]. + proceedButton align: proceedButton topLeft with: (inner := self innerBounds) topLeft + (35 @ -4). + debugButton align: debugButton topRight with: inner topRight - (16 @ 4).! - proceedButton align: proceedButton topLeft with: (inner := self innerBounds) topLeft + (35@-4). - debugButton align: debugButton topRight with: inner topRight - (16@4).! Item was changed: ----- Method: ScrollPane>>vResizeScrollBar (in category 'geometry') ----- vResizeScrollBar | w topLeft borderHeight innerWidth | w := self scrollBarThickness. innerWidth := self flatColoredScrollBarLook ifTrue: [borderHeight := borderWidth. 0] ifFalse: [borderHeight := 0. 1]. topLeft := scrollBarOnLeft ifTrue: [retractableScrollBar ifTrue: [bounds topLeft - ((w - borderWidth) @ (0 - borderHeight))] ifFalse: [bounds topLeft + ((borderWidth - innerWidth) @ borderHeight)]] ifFalse: [retractableScrollBar ifTrue: [bounds topRight - (borderWidth @ (0 - borderHeight))] ifFalse: [bounds topRight - ((w + borderWidth - innerWidth) @ (0 - borderHeight))]]. scrollBar + bounds: (topLeft + ((scrollBarOnLeft ifTrue: [-1] ifFalse: [1]) @ -1) extent: w @ self vScrollBarHeight) - bounds: (topLeft + ((scrollBarOnLeft ifTrue: [-1] ifFalse: [1]) @-1) extent: w @ self vScrollBarHeight) ! Item was changed: ----- Method: TTSampleFontMorph>>drawCharactersOn: (in category 'drawing') ----- drawCharactersOn: aCanvas | glyph origin r offset cy m | + 0 to: 255 do: [:i | - 0 to: 255 do:[:i| glyph := font at: i. origin := font bounds extent * ((i \\ 16) @ (i // 16)). r := origin extent: font bounds extent. offset := r center - glyph bounds center. cy := glyph bounds center y. m := MatrixTransform2x3 withOffset: 0@cy. + m := m composedWithLocal: (MatrixTransform2x3 withScale: 1 @ -1). + m := m composedWithLocal: (MatrixTransform2x3 withOffset: 0 @ cy negated). - m := m composedWithLocal: (MatrixTransform2x3 withScale: 1@-1). - m := m composedWithLocal: (MatrixTransform2x3 withOffset: 0@cy negated). m := m composedWithGlobal: (MatrixTransform2x3 withOffset: offset). + aCanvas asBalloonCanvas preserveStateDuring: [:balloonCanvas | - aCanvas asBalloonCanvas preserveStateDuring:[:balloonCanvas| balloonCanvas transformBy: m. balloonCanvas drawGeneralBezierShape: glyph contours color: color borderWidth: 0 borderColor: Color black. ]. ].! Item was changed: ----- Method: TTSampleStringMorph>>computeTransform (in category 'private') ----- computeTransform | cy | cy := bounds origin y + bounds corner y * 0.5. transform := MatrixTransform2x3 transformFromLocal: (ttBounds insetBy: borderWidth negated) toGlobal: bounds. + transform := transform composedWithGlobal:(MatrixTransform2x3 withOffset: 0 @ cy negated). + transform := transform composedWithGlobal:(MatrixTransform2x3 withScale: 1.0 @ -1.0). + transform := transform composedWithGlobal:(MatrixTransform2x3 withOffset: 0 @ cy). - transform := transform composedWithGlobal:(MatrixTransform2x3 withOffset: 0@cy negated). - transform := transform composedWithGlobal:(MatrixTransform2x3 withScale: 1.0(a)-1.0). - transform := transform composedWithGlobal:(MatrixTransform2x3 withOffset: 0@cy). ^transform!
1
0
0
0
The Trunk: Kernel-nice.537.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.537.mcz
==================== Summary ==================== Name: Kernel-nice.537 Author: nice Time: 29 December 2010, 4:08:14.914 pm UUID: e06ac3d0-0ae3-433e-9530-8663459c4a15 Ancestors: Kernel-nice.536 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. =============== Diff against Kernel-nice.536 =============== Item was changed: ----- Method: MethodFinder>>testFromTuple: (in category 'initialize') ----- testFromTuple: nth "verify that the methods allowed don't crash the system. Try N of each of the fundamental types. up to 4 of each kind." | objects nonRepeating even other aa cnt | objects := #((1 4 17 42) ($a $b $c $d) ('one' 'two' 'three' 'four') (x + rect: new) ((a b 1 4) (c 1 5) ($a 3 d) ()) (4.5 0.0 3.2 100.3) ). objects := objects, {{true. false. true. false}. {Point. SmallInteger. Association. Array}. {Point class. SmallInteger class. Association class. Array class}. "{ 4 blocks }." {Date today. '1 Jan 1950' asDate. '25 Aug 1987' asDate. '1 Jan 2000' asDate}. {'15:16' asTime. '1:56' asTime. '4:01' asTime. '6:23' asTime}. {Dictionary new. Dictionary new. Dictionary new. Dictionary new}. {#(a b 1 4) asOrderedCollection. #(c 1 5) asOrderedCollection. #($a 3 d) asOrderedCollection. #() asOrderedCollection}. + {3 -> true. 5.6 -> $a. #x -> 2. 'abcd' -> false}. + {9 @ 3 extent: 5 @ 4. 0 @ 0 extent: 45 @ 9. -3 @ -7 extent: 2 @ 2. 4 @ 4 extent: 16 @ 16}. - {3->true. 5.6->$a. #x->2. 'abcd'->false}. - {9@3 extent: 5@4. 0@0 extent: 45@9. -3@-7 extent: 2@2. 4@4 extent: 16@16}. {Color red. Color blue. Color black. Color gray}}. self test2: objects. "rec+0, rec+1, rec+2, rec+3 need to be tested. " cnt := 0. nth to: 4 do: [:take | nonRepeating := OrderedCollection new. objects do: [:each | nonRepeating addAll: (each copyFrom: 1 to: take)]. "all combinations of take, from nonRepeating" even := true. nonRepeating combinations: take atATimeDo: [:tuple | even ifTrue: [other := tuple clone] ifFalse: [self load: (aa := Array with: tuple with: 1 with: other with: 7). + (cnt := cnt + 1) \\ 50 = 0 ifTrue: [ - (cnt := cnt+1) \\ 50 = 0 ifTrue: [ Transcript cr; show: aa first printString]. self search: true. self test2: aa. self test2: nonRepeating. "self test2: objects"]. even := even not]. ].! Item was changed: ----- Method: MethodFinder>>testRandom (in category 'initialize') ----- testRandom "verify that the methods allowed don't crash the system. Pick 3 or 4 from a mixed list of the fundamental types." | objects other aa cnt take tuple fName sss | objects := #((1 4 17 42) ($a $b $c $d) ('one' 'two' 'three' 'four') (x + rect: new) ((a b 1 4) (c 1 5) ($a 3 d) ()) (4.5 0.0 3.2 100.3) ). objects := objects, {{true. false. true. false}. {Point. SmallInteger. Association. Array}. {Point class. SmallInteger class. Association class. Array class}. "{ 4 blocks }." {Date today. '1 Jan 1950' asDate. '25 Aug 1987' asDate. '1 Jan 2000' asDate}. {'15:16' asTime. '1:56' asTime. '4:01' asTime. '6:23' asTime}. {Dictionary new. Dictionary new. Dictionary new. Dictionary new}. {#(a b 1 4) asOrderedCollection. #(c 1 5) asOrderedCollection. #($a 3 d) asOrderedCollection. #() asOrderedCollection}. + {3 -> true. 5.6 -> $a. #x -> 2. 'abcd' -> false}. + {9 @ 3 extent: 5 @ 4. 0 @ 0 extent: 45 @ 9. -3 @ -7 extent: 2 @ 2. 4 @ 4 extent: 16 @ 16}. - {3->true. 5.6->$a. #x->2. 'abcd'->false}. - {9@3 extent: 5@4. 0@0 extent: 45@9. -3@-7 extent: 2@2. 4@4 extent: 16@16}. {Color red. Color blue. Color black. Color gray}}. self test2: objects. "rec+0, rec+1, rec+2, rec+3 need to be tested. " fName := (FileDirectory default fileNamesMatching: '*.ran') first. sss := fName splitInteger first. (Collection classPool at: #RandomForPicking) seed: sss. cnt := 0. [take := #(3 4) atRandom. tuple := (1 to: take) collect: [:ind | (objects atRandom) atRandom]. other := (1 to: take) collect: [:ind | (objects atRandom) atRandom]. self load: (aa := Array with: tuple with: 1 with: other with: 7). + ((cnt := cnt + 1) \\ 10 = 0) " | (cnt > Skip)" ifTrue: [ - ((cnt := cnt+1) \\ 10 = 0) " | (cnt > Skip)" ifTrue: [ Transcript cr; show: cnt printString; tab; tab; show: aa first printString]. cnt > (Smalltalk at: #StopHere) ifTrue: [self halt]. "stop just before crash" cnt > (Smalltalk at: #Skip) ifTrue: ["skip this many at start" self search: true. self test2: aa first. self test2: (aa at: 3). "self test2: objects" ]. true] whileTrue. !
1
0
0
0
The Trunk: Kernel-nice.537.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.537.mcz
==================== Summary ==================== Name: Kernel-nice.537 Author: nice Time: 29 December 2010, 4:08:14.914 pm UUID: e06ac3d0-0ae3-433e-9530-8663459c4a15 Ancestors: Kernel-nice.536 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. =============== Diff against Kernel-nice.536 =============== Item was changed: ----- Method: MethodFinder>>testFromTuple: (in category 'initialize') ----- testFromTuple: nth "verify that the methods allowed don't crash the system. Try N of each of the fundamental types. up to 4 of each kind." | objects nonRepeating even other aa cnt | objects := #((1 4 17 42) ($a $b $c $d) ('one' 'two' 'three' 'four') (x + rect: new) ((a b 1 4) (c 1 5) ($a 3 d) ()) (4.5 0.0 3.2 100.3) ). objects := objects, {{true. false. true. false}. {Point. SmallInteger. Association. Array}. {Point class. SmallInteger class. Association class. Array class}. "{ 4 blocks }." {Date today. '1 Jan 1950' asDate. '25 Aug 1987' asDate. '1 Jan 2000' asDate}. {'15:16' asTime. '1:56' asTime. '4:01' asTime. '6:23' asTime}. {Dictionary new. Dictionary new. Dictionary new. Dictionary new}. {#(a b 1 4) asOrderedCollection. #(c 1 5) asOrderedCollection. #($a 3 d) asOrderedCollection. #() asOrderedCollection}. + {3 -> true. 5.6 -> $a. #x -> 2. 'abcd' -> false}. + {9 @ 3 extent: 5 @ 4. 0 @ 0 extent: 45 @ 9. -3 @ -7 extent: 2 @ 2. 4 @ 4 extent: 16 @ 16}. - {3->true. 5.6->$a. #x->2. 'abcd'->false}. - {9@3 extent: 5@4. 0@0 extent: 45@9. -3@-7 extent: 2@2. 4@4 extent: 16@16}. {Color red. Color blue. Color black. Color gray}}. self test2: objects. "rec+0, rec+1, rec+2, rec+3 need to be tested. " cnt := 0. nth to: 4 do: [:take | nonRepeating := OrderedCollection new. objects do: [:each | nonRepeating addAll: (each copyFrom: 1 to: take)]. "all combinations of take, from nonRepeating" even := true. nonRepeating combinations: take atATimeDo: [:tuple | even ifTrue: [other := tuple clone] ifFalse: [self load: (aa := Array with: tuple with: 1 with: other with: 7). + (cnt := cnt + 1) \\ 50 = 0 ifTrue: [ - (cnt := cnt+1) \\ 50 = 0 ifTrue: [ Transcript cr; show: aa first printString]. self search: true. self test2: aa. self test2: nonRepeating. "self test2: objects"]. even := even not]. ].! Item was changed: ----- Method: MethodFinder>>testRandom (in category 'initialize') ----- testRandom "verify that the methods allowed don't crash the system. Pick 3 or 4 from a mixed list of the fundamental types." | objects other aa cnt take tuple fName sss | objects := #((1 4 17 42) ($a $b $c $d) ('one' 'two' 'three' 'four') (x + rect: new) ((a b 1 4) (c 1 5) ($a 3 d) ()) (4.5 0.0 3.2 100.3) ). objects := objects, {{true. false. true. false}. {Point. SmallInteger. Association. Array}. {Point class. SmallInteger class. Association class. Array class}. "{ 4 blocks }." {Date today. '1 Jan 1950' asDate. '25 Aug 1987' asDate. '1 Jan 2000' asDate}. {'15:16' asTime. '1:56' asTime. '4:01' asTime. '6:23' asTime}. {Dictionary new. Dictionary new. Dictionary new. Dictionary new}. {#(a b 1 4) asOrderedCollection. #(c 1 5) asOrderedCollection. #($a 3 d) asOrderedCollection. #() asOrderedCollection}. + {3 -> true. 5.6 -> $a. #x -> 2. 'abcd' -> false}. + {9 @ 3 extent: 5 @ 4. 0 @ 0 extent: 45 @ 9. -3 @ -7 extent: 2 @ 2. 4 @ 4 extent: 16 @ 16}. - {3->true. 5.6->$a. #x->2. 'abcd'->false}. - {9@3 extent: 5@4. 0@0 extent: 45@9. -3@-7 extent: 2@2. 4@4 extent: 16@16}. {Color red. Color blue. Color black. Color gray}}. self test2: objects. "rec+0, rec+1, rec+2, rec+3 need to be tested. " fName := (FileDirectory default fileNamesMatching: '*.ran') first. sss := fName splitInteger first. (Collection classPool at: #RandomForPicking) seed: sss. cnt := 0. [take := #(3 4) atRandom. tuple := (1 to: take) collect: [:ind | (objects atRandom) atRandom]. other := (1 to: take) collect: [:ind | (objects atRandom) atRandom]. self load: (aa := Array with: tuple with: 1 with: other with: 7). + ((cnt := cnt + 1) \\ 10 = 0) " | (cnt > Skip)" ifTrue: [ - ((cnt := cnt+1) \\ 10 = 0) " | (cnt > Skip)" ifTrue: [ Transcript cr; show: cnt printString; tab; tab; show: aa first printString]. cnt > (Smalltalk at: #StopHere) ifTrue: [self halt]. "stop just before crash" cnt > (Smalltalk at: #Skip) ifTrue: ["skip this many at start" self search: true. self test2: aa first. self test2: (aa at: 3). "self test2: objects" ]. true] whileTrue. !
1
0
0
0
The Trunk: Kernel-nice.537.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.537.mcz
==================== Summary ==================== Name: Kernel-nice.537 Author: nice Time: 29 December 2010, 4:08:14.914 pm UUID: e06ac3d0-0ae3-433e-9530-8663459c4a15 Ancestors: Kernel-nice.536 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. =============== Diff against Kernel-nice.536 =============== Item was changed: ----- Method: MethodFinder>>testFromTuple: (in category 'initialize') ----- testFromTuple: nth "verify that the methods allowed don't crash the system. Try N of each of the fundamental types. up to 4 of each kind." | objects nonRepeating even other aa cnt | objects := #((1 4 17 42) ($a $b $c $d) ('one' 'two' 'three' 'four') (x + rect: new) ((a b 1 4) (c 1 5) ($a 3 d) ()) (4.5 0.0 3.2 100.3) ). objects := objects, {{true. false. true. false}. {Point. SmallInteger. Association. Array}. {Point class. SmallInteger class. Association class. Array class}. "{ 4 blocks }." {Date today. '1 Jan 1950' asDate. '25 Aug 1987' asDate. '1 Jan 2000' asDate}. {'15:16' asTime. '1:56' asTime. '4:01' asTime. '6:23' asTime}. {Dictionary new. Dictionary new. Dictionary new. Dictionary new}. {#(a b 1 4) asOrderedCollection. #(c 1 5) asOrderedCollection. #($a 3 d) asOrderedCollection. #() asOrderedCollection}. + {3 -> true. 5.6 -> $a. #x -> 2. 'abcd' -> false}. + {9 @ 3 extent: 5 @ 4. 0 @ 0 extent: 45 @ 9. -3 @ -7 extent: 2 @ 2. 4 @ 4 extent: 16 @ 16}. - {3->true. 5.6->$a. #x->2. 'abcd'->false}. - {9@3 extent: 5@4. 0@0 extent: 45@9. -3@-7 extent: 2@2. 4@4 extent: 16@16}. {Color red. Color blue. Color black. Color gray}}. self test2: objects. "rec+0, rec+1, rec+2, rec+3 need to be tested. " cnt := 0. nth to: 4 do: [:take | nonRepeating := OrderedCollection new. objects do: [:each | nonRepeating addAll: (each copyFrom: 1 to: take)]. "all combinations of take, from nonRepeating" even := true. nonRepeating combinations: take atATimeDo: [:tuple | even ifTrue: [other := tuple clone] ifFalse: [self load: (aa := Array with: tuple with: 1 with: other with: 7). + (cnt := cnt + 1) \\ 50 = 0 ifTrue: [ - (cnt := cnt+1) \\ 50 = 0 ifTrue: [ Transcript cr; show: aa first printString]. self search: true. self test2: aa. self test2: nonRepeating. "self test2: objects"]. even := even not]. ].! Item was changed: ----- Method: MethodFinder>>testRandom (in category 'initialize') ----- testRandom "verify that the methods allowed don't crash the system. Pick 3 or 4 from a mixed list of the fundamental types." | objects other aa cnt take tuple fName sss | objects := #((1 4 17 42) ($a $b $c $d) ('one' 'two' 'three' 'four') (x + rect: new) ((a b 1 4) (c 1 5) ($a 3 d) ()) (4.5 0.0 3.2 100.3) ). objects := objects, {{true. false. true. false}. {Point. SmallInteger. Association. Array}. {Point class. SmallInteger class. Association class. Array class}. "{ 4 blocks }." {Date today. '1 Jan 1950' asDate. '25 Aug 1987' asDate. '1 Jan 2000' asDate}. {'15:16' asTime. '1:56' asTime. '4:01' asTime. '6:23' asTime}. {Dictionary new. Dictionary new. Dictionary new. Dictionary new}. {#(a b 1 4) asOrderedCollection. #(c 1 5) asOrderedCollection. #($a 3 d) asOrderedCollection. #() asOrderedCollection}. + {3 -> true. 5.6 -> $a. #x -> 2. 'abcd' -> false}. + {9 @ 3 extent: 5 @ 4. 0 @ 0 extent: 45 @ 9. -3 @ -7 extent: 2 @ 2. 4 @ 4 extent: 16 @ 16}. - {3->true. 5.6->$a. #x->2. 'abcd'->false}. - {9@3 extent: 5@4. 0@0 extent: 45@9. -3@-7 extent: 2@2. 4@4 extent: 16@16}. {Color red. Color blue. Color black. Color gray}}. self test2: objects. "rec+0, rec+1, rec+2, rec+3 need to be tested. " fName := (FileDirectory default fileNamesMatching: '*.ran') first. sss := fName splitInteger first. (Collection classPool at: #RandomForPicking) seed: sss. cnt := 0. [take := #(3 4) atRandom. tuple := (1 to: take) collect: [:ind | (objects atRandom) atRandom]. other := (1 to: take) collect: [:ind | (objects atRandom) atRandom]. self load: (aa := Array with: tuple with: 1 with: other with: 7). + ((cnt := cnt + 1) \\ 10 = 0) " | (cnt > Skip)" ifTrue: [ - ((cnt := cnt+1) \\ 10 = 0) " | (cnt > Skip)" ifTrue: [ Transcript cr; show: cnt printString; tab; tab; show: aa first printString]. cnt > (Smalltalk at: #StopHere) ifTrue: [self halt]. "stop just before crash" cnt > (Smalltalk at: #Skip) ifTrue: ["skip this many at start" self search: true. self test2: aa first. self test2: (aa at: 3). "self test2: objects" ]. true] whileTrue. !
1
0
0
0
The Trunk: Graphics-nice.170.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-nice.170.mcz
==================== Summary ==================== Name: Graphics-nice.170 Author: nice Time: 29 December 2010, 4:04:55.524 pm UUID: 872a3907-7951-40b8-991b-0b15318c5c32 Ancestors: Graphics-mtf.169 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. Remove unused charIndex instance variable from StrikeFont. =============== Diff against Graphics-mtf.169 =============== Item was changed: ----- Method: Form>>findShapeAroundSeedBlock: (in category 'filling') ----- findShapeAroundSeedBlock: seedBlock "Build a shape that is black in any region marked by seedBlock. SeedBlock will be supplied a form, in which to blacken various pixels as 'seeds'. Then the seeds are smeared until there is no change in the smear when it fills the region, ie, when smearing hits a black border and thus goes no further." | smearForm previousSmear all count smearPort | self depth > 1 ifTrue: [self halt]. "Only meaningful for B/W forms." all := self boundingBox. smearForm := Form extent: self extent. smearPort := BitBlt current toForm: smearForm. seedBlock value: smearForm. "Blacken seeds to be smeared" + smearPort copyForm: self to: 0 @ 0 rule: Form erase. "Clear any in black" - smearPort copyForm: self to: 0@0 rule: Form erase. "Clear any in black" previousSmear := smearForm deepCopy. count := 1. [count = 10 and: "check for no change every 10 smears" [count := 1. + previousSmear copy: all from: 0 @ 0 in: smearForm rule: Form reverse. - previousSmear copy: all from: 0@0 in: smearForm rule: Form reverse. previousSmear isAllWhite]] whileFalse: + [smearPort copyForm: smearForm to: 1 @ 0 rule: Form under. + smearPort copyForm: smearForm to: -1 @ 0 rule: Form under. - [smearPort copyForm: smearForm to: 1@0 rule: Form under. - smearPort copyForm: smearForm to: -1@0 rule: Form under. "After horiz smear, trim around the region border" + smearPort copyForm: self to: 0 @ 0 rule: Form erase. + smearPort copyForm: smearForm to: 0 @ 1 rule: Form under. + smearPort copyForm: smearForm to: 0 @ -1 rule: Form under. - smearPort copyForm: self to: 0@0 rule: Form erase. - smearPort copyForm: smearForm to: 0@1 rule: Form under. - smearPort copyForm: smearForm to: 0@-1 rule: Form under. "After vert smear, trim around the region border" + smearPort copyForm: self to: 0 @ 0 rule: Form erase. + count := count + 1. - smearPort copyForm: self to: 0@0 rule: Form erase. - count := count+1. count = 9 ifTrue: "Save penultimate smear for comparison" + [previousSmear copy: all from: 0 @ 0 in: smearForm rule: Form over]]. - [previousSmear copy: all from: 0@0 in: smearForm rule: Form over]]. "Now paint the filled region in me with aHalftone" ^ smearForm! Item was changed: ----- Method: Form>>pageImage:at:corner: (in category 'transitions') ----- pageImage: otherImage at: topLeft corner: corner "Produce a page-turning illusion that gradually reveals otherImage located at topLeft in this form. Corner specifies which corner, as 1=topLeft, 2=topRight, 3=bottomRight, 4=bottomLeft." | bb maskForm resultForm delta maskLoc maskRect stepSize cornerSel smallRect | stepSize := 10. bb := otherImage boundingBox. resultForm := self copy: (topLeft extent: bb extent). maskForm := Form extent: ((otherImage width min: otherImage height) + stepSize) asPoint. "maskLoc := starting loc rel to topLeft" otherImage width > otherImage height ifTrue: ["wide image; motion is horizontal." (corner between: 2 and: 3) not ifTrue: ["motion is to the right" + delta := 1 @ 0. - delta := 1@0. maskLoc := bb topLeft - (corner = 1 + ifTrue: [maskForm width @ 0] + ifFalse: [maskForm width @ stepSize])] - ifTrue: [maskForm width@0] - ifFalse: [maskForm width@stepSize])] ifFalse: ["motion is to the left" + delta := -1 @ 0. - delta := -1@0. maskLoc := bb topRight - (corner = 2 + ifTrue: [0 @ 0] + ifFalse: [0 @ stepSize])]] - ifTrue: [0@0] - ifFalse: [0@stepSize])]] ifFalse: ["tall image; motion is vertical." corner <= 2 ifTrue: ["motion is downward" + delta := 0 @ 1. - delta := 0@1. maskLoc := bb topLeft - (corner = 1 + ifTrue: [0 @ maskForm height] + ifFalse: [stepSize @ maskForm height])] - ifTrue: [0@maskForm height] - ifFalse: [stepSize@maskForm height])] ifFalse: ["motion is upward" + delta := 0 @ -1. - delta := 0@-1. maskLoc := bb bottomLeft - (corner = 3 + ifTrue: [stepSize @ 0] + ifFalse: [0 @ 0])]]. - ifTrue: [stepSize@0] - ifFalse: [0@0])]]. "Build a solid triangle in the mask form" (Pen newOnForm: maskForm) in: [:p | corner even "Draw 45-degree line" + ifTrue: [p place: 0 @ 0; turn: 135; go: maskForm width * 3 // 2] + ifFalse: [p place: 0 @ (maskForm height - 1); turn: 45; go: maskForm width * 3 // 2]]. - ifTrue: [p place: 0@0; turn: 135; go: maskForm width*3//2] - ifFalse: [p place: 0@(maskForm height-1); turn: 45; go: maskForm width*3//2]]. maskForm smear: delta negated distance: maskForm width. "Copy the mask to full resolution for speed. Make it be the reversed so that it can be used for ORing in the page-corner color" maskForm := (Form extent: maskForm extent depth: otherImage depth) + copyBits: maskForm boundingBox from: maskForm at: 0 @ 0 - copyBits: maskForm boundingBox from: maskForm at: 0@0 colorMap: (Bitmap with: 16rFFFFFFFF with: 0). "Now move the triangle maskForm across the resultForm selecting the triangular part of otherImage to display, and across the resultForm, selecting the part of the original image to erase." cornerSel := #(topLeft topRight bottomRight bottomLeft) at: corner. + 1 to: (otherImage width + otherImage height // stepSize) + 1 do: - 1 to: (otherImage width + otherImage height // stepSize)+1 do: [:i | "Determine the affected square" maskRect := (maskLoc extent: maskForm extent) intersect: bb. + ((maskLoc x * delta x) + (maskLoc y * delta y)) < 0 ifTrue: + [smallRect := 0 @ 0 extent: (maskRect width min: maskRect height) asPoint. - ((maskLoc x*delta x) + (maskLoc y*delta y)) < 0 ifTrue: - [smallRect := 0@0 extent: (maskRect width min: maskRect height) asPoint. maskRect := smallRect align: (smallRect perform: cornerSel) with: (maskRect perform: cornerSel)]. "AND otherForm with triangle mask, and OR into result" + resultForm copyBits: bb from: otherImage at: 0 @ 0 - resultForm copyBits: bb from: otherImage at: 0@0 clippingBox: maskRect rule: Form over fillColor: nil. resultForm copyBits: maskForm boundingBox from: maskForm at: maskLoc clippingBox: maskRect rule: Form erase fillColor: nil. resultForm copyBits: maskForm boundingBox from: maskForm at: maskLoc clippingBox: maskRect rule: Form under fillColor: Color lightBrown. "Now update Display in a single BLT." self copyBits: maskRect from: resultForm at: topLeft + maskRect topLeft clippingBox: self boundingBox rule: Form over fillColor: nil. Display forceDisplayUpdate. + maskLoc := maskLoc + (delta * stepSize)] - maskLoc := maskLoc + (delta*stepSize)] " 1 to: 4 do: [:corner | Display pageImage: (Form fromDisplay: (10@10 extent: 200@300)) reverse at: 10@10 corner: corner] " ! Item was changed: ----- Method: Point>>eightNeighbors (in category 'point functions') ----- eightNeighbors + ^ (Array with: self + (1 @ 0) + with: self + (1 @ 1) + with: self + (0 @ 1) + with: self + (-1 @ 1)) , + (Array with: self + (-1 @ 0) + with: self + (-1 @ -1) + with: self + (0 @ -1) + with: self + (1 @ -1)) - ^ (Array with: self + (1@0) - with: self + (1@1) - with: self + (0@1) - with: self + (-1@1)) , - (Array with: self + (-1@0) - with: self + (-1@-1) - with: self + (0@-1) - with: self + (1@-1)) ! Item was changed: ----- Method: Point>>fourNeighbors (in category 'point functions') ----- fourNeighbors + ^ Array with: self + (1 @ 0) + with: self + (0 @ 1) + with: self + (-1 @ 0) + with: self + (0 @ -1) - ^ Array with: self + (1@0) - with: self + (0@1) - with: self + (-1@0) - with: self + (0@-1) ! Item was changed: AbstractFont subclass: #StrikeFont + instanceVariableNames: 'characterToGlyphMap xTable glyphs name type minAscii maxAscii maxWidth strikeLength ascent descent xOffset raster subscript superscript emphasis derivativeFonts pointSize fallbackFont' - instanceVariableNames: 'characterToGlyphMap xTable glyphs name type minAscii maxAscii maxWidth strikeLength ascent descent xOffset raster subscript superscript emphasis derivativeFonts pointSize fallbackFont charIndex' classVariableNames: 'DefaultStringScanner' poolDictionaries: 'TextConstants' category: 'Graphics-Fonts'! !StrikeFont commentStamp: '<historical>' prior: 0! I represent a compact encoding of a set of Forms corresponding to characters in the ASCII character set. All the forms are placed side by side in a large form whose height is the font height, and whose width is the sum of all the character widths. The xTable variable gives the left-x coordinates of the subforms corresponding to the glyphs. Characters are mapped to glyphs by using the characterToGyphMap. Subclasses can have non-trivial mapping rules as well as different representations for glyphs sizes (e.g., not using an xTable). If so, these classes should return nil when queried for xTable and/or the characterToGlyphMap. This will cause the CharacterScanner primitive to fail and query the font for the width of a character (so that a more programatical approach can be implemented). For display, fonts need to implement two messages: #installOn: aDisplayContext foregroundColor: foregroundColor backgroundColor: backgroundColor This method installs the receiver (a font) on the given DisplayContext (which may be an instance of BitBlt or Canvas (or any of it's subclasses). The font should take the appropriate action to initialize the display context so that further display operations can be optimized. #displayString: aString on: aDisplayContext from: startIndex to: stopIndex at: aPoint kern: kernDelta This method is called for each subsequent run of characters in aString which is to be displayed with the (previously installed) settings. ! Item was changed: ----- Method: StrikeFont>>displayMultiString:on:from:to:at:kern:baselineY: (in category 'displaying') ----- displayMultiString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta baselineY: baselineY | leftX rightX glyphInfo char destY form gfont destX destPt | destX := aPoint x. - charIndex := startIndex. glyphInfo := Array new: 5. startIndex to: stopIndex do:[:charIndex| char := aString at: charIndex. (self hasGlyphOf: char) ifTrue: [ self glyphInfoOf: char into: glyphInfo. form := glyphInfo at: 1. leftX := glyphInfo at: 2. rightX := glyphInfo at: 3. destY := glyphInfo at: 4. gfont := glyphInfo at: 5. (gfont == aBitBlt lastFont) ifFalse: [gfont installOn: aBitBlt]. destY := baselineY - destY. aBitBlt displayGlyph: form at: destX @ destY left: leftX right: rightX font: self. destX := destX + (rightX - leftX + kernDelta). ] ifFalse:[ destPt := self fallbackFont displayString: aString on: aBitBlt from: charIndex to: charIndex at: destX @ aPoint y kern: kernDelta from: self baselineY: baselineY. destPt x = destX ifTrue:[ "In some situations BitBlt doesn't return the advance width from the primitive. Work around the situation" destX := destX + (self widthOfString: aString from: charIndex to: charIndex) + kernDelta. ] ifFalse:[destX := destPt x]. ]. ]. ^destX @ aPoint y !
1
0
0
0
The Trunk: Graphics-nice.170.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-nice.170.mcz
==================== Summary ==================== Name: Graphics-nice.170 Author: nice Time: 29 December 2010, 4:04:55.524 pm UUID: 872a3907-7951-40b8-991b-0b15318c5c32 Ancestors: Graphics-mtf.169 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. Remove unused charIndex instance variable from StrikeFont. =============== Diff against Graphics-mtf.169 =============== Item was changed: ----- Method: Form>>findShapeAroundSeedBlock: (in category 'filling') ----- findShapeAroundSeedBlock: seedBlock "Build a shape that is black in any region marked by seedBlock. SeedBlock will be supplied a form, in which to blacken various pixels as 'seeds'. Then the seeds are smeared until there is no change in the smear when it fills the region, ie, when smearing hits a black border and thus goes no further." | smearForm previousSmear all count smearPort | self depth > 1 ifTrue: [self halt]. "Only meaningful for B/W forms." all := self boundingBox. smearForm := Form extent: self extent. smearPort := BitBlt current toForm: smearForm. seedBlock value: smearForm. "Blacken seeds to be smeared" + smearPort copyForm: self to: 0 @ 0 rule: Form erase. "Clear any in black" - smearPort copyForm: self to: 0@0 rule: Form erase. "Clear any in black" previousSmear := smearForm deepCopy. count := 1. [count = 10 and: "check for no change every 10 smears" [count := 1. + previousSmear copy: all from: 0 @ 0 in: smearForm rule: Form reverse. - previousSmear copy: all from: 0@0 in: smearForm rule: Form reverse. previousSmear isAllWhite]] whileFalse: + [smearPort copyForm: smearForm to: 1 @ 0 rule: Form under. + smearPort copyForm: smearForm to: -1 @ 0 rule: Form under. - [smearPort copyForm: smearForm to: 1@0 rule: Form under. - smearPort copyForm: smearForm to: -1@0 rule: Form under. "After horiz smear, trim around the region border" + smearPort copyForm: self to: 0 @ 0 rule: Form erase. + smearPort copyForm: smearForm to: 0 @ 1 rule: Form under. + smearPort copyForm: smearForm to: 0 @ -1 rule: Form under. - smearPort copyForm: self to: 0@0 rule: Form erase. - smearPort copyForm: smearForm to: 0@1 rule: Form under. - smearPort copyForm: smearForm to: 0@-1 rule: Form under. "After vert smear, trim around the region border" + smearPort copyForm: self to: 0 @ 0 rule: Form erase. + count := count + 1. - smearPort copyForm: self to: 0@0 rule: Form erase. - count := count+1. count = 9 ifTrue: "Save penultimate smear for comparison" + [previousSmear copy: all from: 0 @ 0 in: smearForm rule: Form over]]. - [previousSmear copy: all from: 0@0 in: smearForm rule: Form over]]. "Now paint the filled region in me with aHalftone" ^ smearForm! Item was changed: ----- Method: Form>>pageImage:at:corner: (in category 'transitions') ----- pageImage: otherImage at: topLeft corner: corner "Produce a page-turning illusion that gradually reveals otherImage located at topLeft in this form. Corner specifies which corner, as 1=topLeft, 2=topRight, 3=bottomRight, 4=bottomLeft." | bb maskForm resultForm delta maskLoc maskRect stepSize cornerSel smallRect | stepSize := 10. bb := otherImage boundingBox. resultForm := self copy: (topLeft extent: bb extent). maskForm := Form extent: ((otherImage width min: otherImage height) + stepSize) asPoint. "maskLoc := starting loc rel to topLeft" otherImage width > otherImage height ifTrue: ["wide image; motion is horizontal." (corner between: 2 and: 3) not ifTrue: ["motion is to the right" + delta := 1 @ 0. - delta := 1@0. maskLoc := bb topLeft - (corner = 1 + ifTrue: [maskForm width @ 0] + ifFalse: [maskForm width @ stepSize])] - ifTrue: [maskForm width@0] - ifFalse: [maskForm width@stepSize])] ifFalse: ["motion is to the left" + delta := -1 @ 0. - delta := -1@0. maskLoc := bb topRight - (corner = 2 + ifTrue: [0 @ 0] + ifFalse: [0 @ stepSize])]] - ifTrue: [0@0] - ifFalse: [0@stepSize])]] ifFalse: ["tall image; motion is vertical." corner <= 2 ifTrue: ["motion is downward" + delta := 0 @ 1. - delta := 0@1. maskLoc := bb topLeft - (corner = 1 + ifTrue: [0 @ maskForm height] + ifFalse: [stepSize @ maskForm height])] - ifTrue: [0@maskForm height] - ifFalse: [stepSize@maskForm height])] ifFalse: ["motion is upward" + delta := 0 @ -1. - delta := 0@-1. maskLoc := bb bottomLeft - (corner = 3 + ifTrue: [stepSize @ 0] + ifFalse: [0 @ 0])]]. - ifTrue: [stepSize@0] - ifFalse: [0@0])]]. "Build a solid triangle in the mask form" (Pen newOnForm: maskForm) in: [:p | corner even "Draw 45-degree line" + ifTrue: [p place: 0 @ 0; turn: 135; go: maskForm width * 3 // 2] + ifFalse: [p place: 0 @ (maskForm height - 1); turn: 45; go: maskForm width * 3 // 2]]. - ifTrue: [p place: 0@0; turn: 135; go: maskForm width*3//2] - ifFalse: [p place: 0@(maskForm height-1); turn: 45; go: maskForm width*3//2]]. maskForm smear: delta negated distance: maskForm width. "Copy the mask to full resolution for speed. Make it be the reversed so that it can be used for ORing in the page-corner color" maskForm := (Form extent: maskForm extent depth: otherImage depth) + copyBits: maskForm boundingBox from: maskForm at: 0 @ 0 - copyBits: maskForm boundingBox from: maskForm at: 0@0 colorMap: (Bitmap with: 16rFFFFFFFF with: 0). "Now move the triangle maskForm across the resultForm selecting the triangular part of otherImage to display, and across the resultForm, selecting the part of the original image to erase." cornerSel := #(topLeft topRight bottomRight bottomLeft) at: corner. + 1 to: (otherImage width + otherImage height // stepSize) + 1 do: - 1 to: (otherImage width + otherImage height // stepSize)+1 do: [:i | "Determine the affected square" maskRect := (maskLoc extent: maskForm extent) intersect: bb. + ((maskLoc x * delta x) + (maskLoc y * delta y)) < 0 ifTrue: + [smallRect := 0 @ 0 extent: (maskRect width min: maskRect height) asPoint. - ((maskLoc x*delta x) + (maskLoc y*delta y)) < 0 ifTrue: - [smallRect := 0@0 extent: (maskRect width min: maskRect height) asPoint. maskRect := smallRect align: (smallRect perform: cornerSel) with: (maskRect perform: cornerSel)]. "AND otherForm with triangle mask, and OR into result" + resultForm copyBits: bb from: otherImage at: 0 @ 0 - resultForm copyBits: bb from: otherImage at: 0@0 clippingBox: maskRect rule: Form over fillColor: nil. resultForm copyBits: maskForm boundingBox from: maskForm at: maskLoc clippingBox: maskRect rule: Form erase fillColor: nil. resultForm copyBits: maskForm boundingBox from: maskForm at: maskLoc clippingBox: maskRect rule: Form under fillColor: Color lightBrown. "Now update Display in a single BLT." self copyBits: maskRect from: resultForm at: topLeft + maskRect topLeft clippingBox: self boundingBox rule: Form over fillColor: nil. Display forceDisplayUpdate. + maskLoc := maskLoc + (delta * stepSize)] - maskLoc := maskLoc + (delta*stepSize)] " 1 to: 4 do: [:corner | Display pageImage: (Form fromDisplay: (10@10 extent: 200@300)) reverse at: 10@10 corner: corner] " ! Item was changed: ----- Method: Point>>eightNeighbors (in category 'point functions') ----- eightNeighbors + ^ (Array with: self + (1 @ 0) + with: self + (1 @ 1) + with: self + (0 @ 1) + with: self + (-1 @ 1)) , + (Array with: self + (-1 @ 0) + with: self + (-1 @ -1) + with: self + (0 @ -1) + with: self + (1 @ -1)) - ^ (Array with: self + (1@0) - with: self + (1@1) - with: self + (0@1) - with: self + (-1@1)) , - (Array with: self + (-1@0) - with: self + (-1@-1) - with: self + (0@-1) - with: self + (1@-1)) ! Item was changed: ----- Method: Point>>fourNeighbors (in category 'point functions') ----- fourNeighbors + ^ Array with: self + (1 @ 0) + with: self + (0 @ 1) + with: self + (-1 @ 0) + with: self + (0 @ -1) - ^ Array with: self + (1@0) - with: self + (0@1) - with: self + (-1@0) - with: self + (0@-1) ! Item was changed: AbstractFont subclass: #StrikeFont + instanceVariableNames: 'characterToGlyphMap xTable glyphs name type minAscii maxAscii maxWidth strikeLength ascent descent xOffset raster subscript superscript emphasis derivativeFonts pointSize fallbackFont' - instanceVariableNames: 'characterToGlyphMap xTable glyphs name type minAscii maxAscii maxWidth strikeLength ascent descent xOffset raster subscript superscript emphasis derivativeFonts pointSize fallbackFont charIndex' classVariableNames: 'DefaultStringScanner' poolDictionaries: 'TextConstants' category: 'Graphics-Fonts'! !StrikeFont commentStamp: '<historical>' prior: 0! I represent a compact encoding of a set of Forms corresponding to characters in the ASCII character set. All the forms are placed side by side in a large form whose height is the font height, and whose width is the sum of all the character widths. The xTable variable gives the left-x coordinates of the subforms corresponding to the glyphs. Characters are mapped to glyphs by using the characterToGyphMap. Subclasses can have non-trivial mapping rules as well as different representations for glyphs sizes (e.g., not using an xTable). If so, these classes should return nil when queried for xTable and/or the characterToGlyphMap. This will cause the CharacterScanner primitive to fail and query the font for the width of a character (so that a more programatical approach can be implemented). For display, fonts need to implement two messages: #installOn: aDisplayContext foregroundColor: foregroundColor backgroundColor: backgroundColor This method installs the receiver (a font) on the given DisplayContext (which may be an instance of BitBlt or Canvas (or any of it's subclasses). The font should take the appropriate action to initialize the display context so that further display operations can be optimized. #displayString: aString on: aDisplayContext from: startIndex to: stopIndex at: aPoint kern: kernDelta This method is called for each subsequent run of characters in aString which is to be displayed with the (previously installed) settings. ! Item was changed: ----- Method: StrikeFont>>displayMultiString:on:from:to:at:kern:baselineY: (in category 'displaying') ----- displayMultiString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta baselineY: baselineY | leftX rightX glyphInfo char destY form gfont destX destPt | destX := aPoint x. - charIndex := startIndex. glyphInfo := Array new: 5. startIndex to: stopIndex do:[:charIndex| char := aString at: charIndex. (self hasGlyphOf: char) ifTrue: [ self glyphInfoOf: char into: glyphInfo. form := glyphInfo at: 1. leftX := glyphInfo at: 2. rightX := glyphInfo at: 3. destY := glyphInfo at: 4. gfont := glyphInfo at: 5. (gfont == aBitBlt lastFont) ifFalse: [gfont installOn: aBitBlt]. destY := baselineY - destY. aBitBlt displayGlyph: form at: destX @ destY left: leftX right: rightX font: self. destX := destX + (rightX - leftX + kernDelta). ] ifFalse:[ destPt := self fallbackFont displayString: aString on: aBitBlt from: charIndex to: charIndex at: destX @ aPoint y kern: kernDelta from: self baselineY: baselineY. destPt x = destX ifTrue:[ "In some situations BitBlt doesn't return the advance width from the primitive. Work around the situation" destX := destX + (self widthOfString: aString from: charIndex to: charIndex) + kernDelta. ] ifFalse:[destX := destPt x]. ]. ]. ^destX @ aPoint y !
1
0
0
0
The Trunk: Graphics-nice.170.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-nice.170.mcz
==================== Summary ==================== Name: Graphics-nice.170 Author: nice Time: 29 December 2010, 4:04:55.524 pm UUID: 872a3907-7951-40b8-991b-0b15318c5c32 Ancestors: Graphics-mtf.169 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. Remove unused charIndex instance variable from StrikeFont. =============== Diff against Graphics-mtf.169 =============== Item was changed: ----- Method: Form>>findShapeAroundSeedBlock: (in category 'filling') ----- findShapeAroundSeedBlock: seedBlock "Build a shape that is black in any region marked by seedBlock. SeedBlock will be supplied a form, in which to blacken various pixels as 'seeds'. Then the seeds are smeared until there is no change in the smear when it fills the region, ie, when smearing hits a black border and thus goes no further." | smearForm previousSmear all count smearPort | self depth > 1 ifTrue: [self halt]. "Only meaningful for B/W forms." all := self boundingBox. smearForm := Form extent: self extent. smearPort := BitBlt current toForm: smearForm. seedBlock value: smearForm. "Blacken seeds to be smeared" + smearPort copyForm: self to: 0 @ 0 rule: Form erase. "Clear any in black" - smearPort copyForm: self to: 0@0 rule: Form erase. "Clear any in black" previousSmear := smearForm deepCopy. count := 1. [count = 10 and: "check for no change every 10 smears" [count := 1. + previousSmear copy: all from: 0 @ 0 in: smearForm rule: Form reverse. - previousSmear copy: all from: 0@0 in: smearForm rule: Form reverse. previousSmear isAllWhite]] whileFalse: + [smearPort copyForm: smearForm to: 1 @ 0 rule: Form under. + smearPort copyForm: smearForm to: -1 @ 0 rule: Form under. - [smearPort copyForm: smearForm to: 1@0 rule: Form under. - smearPort copyForm: smearForm to: -1@0 rule: Form under. "After horiz smear, trim around the region border" + smearPort copyForm: self to: 0 @ 0 rule: Form erase. + smearPort copyForm: smearForm to: 0 @ 1 rule: Form under. + smearPort copyForm: smearForm to: 0 @ -1 rule: Form under. - smearPort copyForm: self to: 0@0 rule: Form erase. - smearPort copyForm: smearForm to: 0@1 rule: Form under. - smearPort copyForm: smearForm to: 0@-1 rule: Form under. "After vert smear, trim around the region border" + smearPort copyForm: self to: 0 @ 0 rule: Form erase. + count := count + 1. - smearPort copyForm: self to: 0@0 rule: Form erase. - count := count+1. count = 9 ifTrue: "Save penultimate smear for comparison" + [previousSmear copy: all from: 0 @ 0 in: smearForm rule: Form over]]. - [previousSmear copy: all from: 0@0 in: smearForm rule: Form over]]. "Now paint the filled region in me with aHalftone" ^ smearForm! Item was changed: ----- Method: Form>>pageImage:at:corner: (in category 'transitions') ----- pageImage: otherImage at: topLeft corner: corner "Produce a page-turning illusion that gradually reveals otherImage located at topLeft in this form. Corner specifies which corner, as 1=topLeft, 2=topRight, 3=bottomRight, 4=bottomLeft." | bb maskForm resultForm delta maskLoc maskRect stepSize cornerSel smallRect | stepSize := 10. bb := otherImage boundingBox. resultForm := self copy: (topLeft extent: bb extent). maskForm := Form extent: ((otherImage width min: otherImage height) + stepSize) asPoint. "maskLoc := starting loc rel to topLeft" otherImage width > otherImage height ifTrue: ["wide image; motion is horizontal." (corner between: 2 and: 3) not ifTrue: ["motion is to the right" + delta := 1 @ 0. - delta := 1@0. maskLoc := bb topLeft - (corner = 1 + ifTrue: [maskForm width @ 0] + ifFalse: [maskForm width @ stepSize])] - ifTrue: [maskForm width@0] - ifFalse: [maskForm width@stepSize])] ifFalse: ["motion is to the left" + delta := -1 @ 0. - delta := -1@0. maskLoc := bb topRight - (corner = 2 + ifTrue: [0 @ 0] + ifFalse: [0 @ stepSize])]] - ifTrue: [0@0] - ifFalse: [0@stepSize])]] ifFalse: ["tall image; motion is vertical." corner <= 2 ifTrue: ["motion is downward" + delta := 0 @ 1. - delta := 0@1. maskLoc := bb topLeft - (corner = 1 + ifTrue: [0 @ maskForm height] + ifFalse: [stepSize @ maskForm height])] - ifTrue: [0@maskForm height] - ifFalse: [stepSize@maskForm height])] ifFalse: ["motion is upward" + delta := 0 @ -1. - delta := 0@-1. maskLoc := bb bottomLeft - (corner = 3 + ifTrue: [stepSize @ 0] + ifFalse: [0 @ 0])]]. - ifTrue: [stepSize@0] - ifFalse: [0@0])]]. "Build a solid triangle in the mask form" (Pen newOnForm: maskForm) in: [:p | corner even "Draw 45-degree line" + ifTrue: [p place: 0 @ 0; turn: 135; go: maskForm width * 3 // 2] + ifFalse: [p place: 0 @ (maskForm height - 1); turn: 45; go: maskForm width * 3 // 2]]. - ifTrue: [p place: 0@0; turn: 135; go: maskForm width*3//2] - ifFalse: [p place: 0@(maskForm height-1); turn: 45; go: maskForm width*3//2]]. maskForm smear: delta negated distance: maskForm width. "Copy the mask to full resolution for speed. Make it be the reversed so that it can be used for ORing in the page-corner color" maskForm := (Form extent: maskForm extent depth: otherImage depth) + copyBits: maskForm boundingBox from: maskForm at: 0 @ 0 - copyBits: maskForm boundingBox from: maskForm at: 0@0 colorMap: (Bitmap with: 16rFFFFFFFF with: 0). "Now move the triangle maskForm across the resultForm selecting the triangular part of otherImage to display, and across the resultForm, selecting the part of the original image to erase." cornerSel := #(topLeft topRight bottomRight bottomLeft) at: corner. + 1 to: (otherImage width + otherImage height // stepSize) + 1 do: - 1 to: (otherImage width + otherImage height // stepSize)+1 do: [:i | "Determine the affected square" maskRect := (maskLoc extent: maskForm extent) intersect: bb. + ((maskLoc x * delta x) + (maskLoc y * delta y)) < 0 ifTrue: + [smallRect := 0 @ 0 extent: (maskRect width min: maskRect height) asPoint. - ((maskLoc x*delta x) + (maskLoc y*delta y)) < 0 ifTrue: - [smallRect := 0@0 extent: (maskRect width min: maskRect height) asPoint. maskRect := smallRect align: (smallRect perform: cornerSel) with: (maskRect perform: cornerSel)]. "AND otherForm with triangle mask, and OR into result" + resultForm copyBits: bb from: otherImage at: 0 @ 0 - resultForm copyBits: bb from: otherImage at: 0@0 clippingBox: maskRect rule: Form over fillColor: nil. resultForm copyBits: maskForm boundingBox from: maskForm at: maskLoc clippingBox: maskRect rule: Form erase fillColor: nil. resultForm copyBits: maskForm boundingBox from: maskForm at: maskLoc clippingBox: maskRect rule: Form under fillColor: Color lightBrown. "Now update Display in a single BLT." self copyBits: maskRect from: resultForm at: topLeft + maskRect topLeft clippingBox: self boundingBox rule: Form over fillColor: nil. Display forceDisplayUpdate. + maskLoc := maskLoc + (delta * stepSize)] - maskLoc := maskLoc + (delta*stepSize)] " 1 to: 4 do: [:corner | Display pageImage: (Form fromDisplay: (10@10 extent: 200@300)) reverse at: 10@10 corner: corner] " ! Item was changed: ----- Method: Point>>eightNeighbors (in category 'point functions') ----- eightNeighbors + ^ (Array with: self + (1 @ 0) + with: self + (1 @ 1) + with: self + (0 @ 1) + with: self + (-1 @ 1)) , + (Array with: self + (-1 @ 0) + with: self + (-1 @ -1) + with: self + (0 @ -1) + with: self + (1 @ -1)) - ^ (Array with: self + (1@0) - with: self + (1@1) - with: self + (0@1) - with: self + (-1@1)) , - (Array with: self + (-1@0) - with: self + (-1@-1) - with: self + (0@-1) - with: self + (1@-1)) ! Item was changed: ----- Method: Point>>fourNeighbors (in category 'point functions') ----- fourNeighbors + ^ Array with: self + (1 @ 0) + with: self + (0 @ 1) + with: self + (-1 @ 0) + with: self + (0 @ -1) - ^ Array with: self + (1@0) - with: self + (0@1) - with: self + (-1@0) - with: self + (0@-1) ! Item was changed: AbstractFont subclass: #StrikeFont + instanceVariableNames: 'characterToGlyphMap xTable glyphs name type minAscii maxAscii maxWidth strikeLength ascent descent xOffset raster subscript superscript emphasis derivativeFonts pointSize fallbackFont' - instanceVariableNames: 'characterToGlyphMap xTable glyphs name type minAscii maxAscii maxWidth strikeLength ascent descent xOffset raster subscript superscript emphasis derivativeFonts pointSize fallbackFont charIndex' classVariableNames: 'DefaultStringScanner' poolDictionaries: 'TextConstants' category: 'Graphics-Fonts'! !StrikeFont commentStamp: '<historical>' prior: 0! I represent a compact encoding of a set of Forms corresponding to characters in the ASCII character set. All the forms are placed side by side in a large form whose height is the font height, and whose width is the sum of all the character widths. The xTable variable gives the left-x coordinates of the subforms corresponding to the glyphs. Characters are mapped to glyphs by using the characterToGyphMap. Subclasses can have non-trivial mapping rules as well as different representations for glyphs sizes (e.g., not using an xTable). If so, these classes should return nil when queried for xTable and/or the characterToGlyphMap. This will cause the CharacterScanner primitive to fail and query the font for the width of a character (so that a more programatical approach can be implemented). For display, fonts need to implement two messages: #installOn: aDisplayContext foregroundColor: foregroundColor backgroundColor: backgroundColor This method installs the receiver (a font) on the given DisplayContext (which may be an instance of BitBlt or Canvas (or any of it's subclasses). The font should take the appropriate action to initialize the display context so that further display operations can be optimized. #displayString: aString on: aDisplayContext from: startIndex to: stopIndex at: aPoint kern: kernDelta This method is called for each subsequent run of characters in aString which is to be displayed with the (previously installed) settings. ! Item was changed: ----- Method: StrikeFont>>displayMultiString:on:from:to:at:kern:baselineY: (in category 'displaying') ----- displayMultiString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta baselineY: baselineY | leftX rightX glyphInfo char destY form gfont destX destPt | destX := aPoint x. - charIndex := startIndex. glyphInfo := Array new: 5. startIndex to: stopIndex do:[:charIndex| char := aString at: charIndex. (self hasGlyphOf: char) ifTrue: [ self glyphInfoOf: char into: glyphInfo. form := glyphInfo at: 1. leftX := glyphInfo at: 2. rightX := glyphInfo at: 3. destY := glyphInfo at: 4. gfont := glyphInfo at: 5. (gfont == aBitBlt lastFont) ifFalse: [gfont installOn: aBitBlt]. destY := baselineY - destY. aBitBlt displayGlyph: form at: destX @ destY left: leftX right: rightX font: self. destX := destX + (rightX - leftX + kernDelta). ] ifFalse:[ destPt := self fallbackFont displayString: aString on: aBitBlt from: charIndex to: charIndex at: destX @ aPoint y kern: kernDelta from: self baselineY: baselineY. destPt x = destX ifTrue:[ "In some situations BitBlt doesn't return the advance width from the primitive. Work around the situation" destX := destX + (self widthOfString: aString from: charIndex to: charIndex) + kernDelta. ] ifFalse:[destX := destPt x]. ]. ]. ^destX @ aPoint y !
1
0
0
0
The Trunk: EToys-nice.78.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-nice.78.mcz
==================== Summary ==================== Name: EToys-nice.78 Author: nice Time: 29 December 2010, 3:58:43.772 pm UUID: 2fc3096b-3e18-4f08-8e76-b6c9d43455df Ancestors: EToys-cmm.77 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. =============== Diff against EToys-cmm.77 =============== Item was changed: ----- Method: AlignmentMorph>>addUpDownArrowsFor: (in category '*Etoys-initialization') ----- addUpDownArrowsFor: aMorph "Add a column of up and down arrows that serve to send upArrowHit and downArrowHit to aMorph when they're pressed/held down" | holder downArrow upArrow | holder := Morph new extent: 16 @ 16; beTransparent. downArrow := ImageMorph new image: (ScriptingSystem formAtKey: 'DownArrow'). upArrow := ImageMorph new image: (ScriptingSystem formAtKey: 'UpArrow'). + upArrow position: holder bounds topLeft + (2 @ 2). - upArrow position: holder bounds topLeft + (2@2). downArrow align: downArrow bottomLeft + with: holder topLeft + (0 @ TileMorph defaultH) + (2 @ -2). - with: holder topLeft + (0 @ TileMorph defaultH) + (2@-2). holder addMorph: upArrow. holder addMorph: downArrow. self addMorphBack: holder. upArrow on: #mouseDown send: #upArrowHit to: aMorph. upArrow on: #mouseStillDown send: #upArrowHit to: aMorph. downArrow on: #mouseDown send: #downArrowHit to: aMorph. downArrow on: #mouseStillDown send: #downArrowHit to: aMorph.! Item was changed: ----- Method: ScriptEditorMorph>>createThreadShowing (in category 'menu commands') ----- createThreadShowing | vertices | self deleteThreadShowing. vertices := OrderedCollection new. self tileRows do: [:row | | b | row first isTurtleRow ifTrue: [ b := row first bounds. + vertices add: ((b topLeft + (4 @ 0)) + ((0 * 0.1 * b width) @ 0)). - vertices add: ((b topLeft + (4@0)) + ((0 * 0.1 * b width)@0)). 0 to: 9 do: [:i | + vertices add: ((b topLeft + (4 @ 4))+ ((i * 0.1 * b width ) @ 0)). + vertices add: ((b bottomLeft + (4 @ -4)) + ((i * 0.1 * b width) @ 0)). - vertices add: ((b topLeft + (4@4))+ ((i * 0.1 * b width )@0)). - vertices add: ((b bottomLeft + (4@-4)) + ((i * 0.1 * b width)@0)). ]. + vertices add: ((b bottomLeft + (4 @ 0)) + ((9 * 0.1 * b width) @ 0)). - vertices add: ((b bottomLeft + (4@0)) + ((9 * 0.1 * b width)@0)). ] ifFalse: [ b := row first bounds. + vertices add: ((b origin x + b corner x) // 2) @ (b origin y). + vertices add: ((b origin x + b corner x) // 2) @ (b origin y + 4). + vertices add: ((b origin x + b corner x) // 2) @ (b corner y - 4). + vertices add: ((b origin x + b corner x) // 2) @ (b corner y). - vertices add: ((b origin x + b corner x)//2)@(b origin y). - vertices add: ((b origin x + b corner x)//2)@(b origin y + 4). - vertices add: ((b origin x + b corner x)//2)@(b corner y - 4). - vertices add: ((b origin x + b corner x)//2)@(b corner y). ]. ]. threadPolygon := PolygonMorph vertices: vertices color: Color black borderWidth: 2 borderColor: Color black. threadPolygon makeOpen. threadPolygon openInWorld. ! Item was changed: ----- Method: ScriptEditorMorph>>extent: (in category 'other') ----- extent: x | newExtent tw menu | + newExtent := x max: self minWidth @ self minHeight. - newExtent := x max: self minWidth@self minHeight. (tw := self findA: TwoWayScrollPane) ifNil: ["This was the old behavior" ^ super extent: newExtent]. (self hasProperty: #autoFitContents) ifTrue: [ menu := MenuMorph new defaultTarget: self. menu addUpdating: #autoFitString target: self action: #autoFitOnOff. menu addTitle: 'To resize the script, uncheck the box below' translated. menu popUpEvent: nil in: self world . ^ self]. "Allow the user to resize to any size" tw extent: ((newExtent x max: self firstSubmorph width) + @ (newExtent y - self firstSubmorph height)) - (borderWidth * 2) + (-4 @ -4). "inset?" - @ (newExtent y - self firstSubmorph height)) - (borderWidth*2) + (-4@-4). "inset?" ^ super extent: newExtent! Item was changed: ----- Method: ViewerLine>>addGetterFeedback (in category 'slot') ----- addGetterFeedback "Add feedback during mouseover of a getter" | aMorph endMorph | endMorph := (#(touchesA: #seesColor: #overlaps:) includes: self elementSymbol) ifTrue: [submorphs eighth] ifFalse: [submorphs sixth]. + aMorph := RectangleMorph new useRoundedCorners bounds: ((submorphs fourth topLeft - (2 @ -1)) corner: (endMorph bottomRight + (2 @ -1))). - aMorph := RectangleMorph new useRoundedCorners bounds: ((submorphs fourth topLeft - (2@-1)) corner: (endMorph bottomRight + (2@-1))). aMorph beTransparent; borderWidth: 2; borderColor: (Color r: 1.0 g: 0.355 b: 0.839); lock. aMorph setProperty: #highlight toValue: true. ActiveWorld addMorphFront: aMorph " Color fromUser (Color r: 1.0 g: 0.355 b: 0.839) "!
1
0
0
0
The Trunk: EToys-nice.78.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-nice.78.mcz
==================== Summary ==================== Name: EToys-nice.78 Author: nice Time: 29 December 2010, 3:58:43.772 pm UUID: 2fc3096b-3e18-4f08-8e76-b6c9d43455df Ancestors: EToys-cmm.77 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. =============== Diff against EToys-cmm.77 =============== Item was changed: ----- Method: AlignmentMorph>>addUpDownArrowsFor: (in category '*Etoys-initialization') ----- addUpDownArrowsFor: aMorph "Add a column of up and down arrows that serve to send upArrowHit and downArrowHit to aMorph when they're pressed/held down" | holder downArrow upArrow | holder := Morph new extent: 16 @ 16; beTransparent. downArrow := ImageMorph new image: (ScriptingSystem formAtKey: 'DownArrow'). upArrow := ImageMorph new image: (ScriptingSystem formAtKey: 'UpArrow'). + upArrow position: holder bounds topLeft + (2 @ 2). - upArrow position: holder bounds topLeft + (2@2). downArrow align: downArrow bottomLeft + with: holder topLeft + (0 @ TileMorph defaultH) + (2 @ -2). - with: holder topLeft + (0 @ TileMorph defaultH) + (2@-2). holder addMorph: upArrow. holder addMorph: downArrow. self addMorphBack: holder. upArrow on: #mouseDown send: #upArrowHit to: aMorph. upArrow on: #mouseStillDown send: #upArrowHit to: aMorph. downArrow on: #mouseDown send: #downArrowHit to: aMorph. downArrow on: #mouseStillDown send: #downArrowHit to: aMorph.! Item was changed: ----- Method: ScriptEditorMorph>>createThreadShowing (in category 'menu commands') ----- createThreadShowing | vertices | self deleteThreadShowing. vertices := OrderedCollection new. self tileRows do: [:row | | b | row first isTurtleRow ifTrue: [ b := row first bounds. + vertices add: ((b topLeft + (4 @ 0)) + ((0 * 0.1 * b width) @ 0)). - vertices add: ((b topLeft + (4@0)) + ((0 * 0.1 * b width)@0)). 0 to: 9 do: [:i | + vertices add: ((b topLeft + (4 @ 4))+ ((i * 0.1 * b width ) @ 0)). + vertices add: ((b bottomLeft + (4 @ -4)) + ((i * 0.1 * b width) @ 0)). - vertices add: ((b topLeft + (4@4))+ ((i * 0.1 * b width )@0)). - vertices add: ((b bottomLeft + (4@-4)) + ((i * 0.1 * b width)@0)). ]. + vertices add: ((b bottomLeft + (4 @ 0)) + ((9 * 0.1 * b width) @ 0)). - vertices add: ((b bottomLeft + (4@0)) + ((9 * 0.1 * b width)@0)). ] ifFalse: [ b := row first bounds. + vertices add: ((b origin x + b corner x) // 2) @ (b origin y). + vertices add: ((b origin x + b corner x) // 2) @ (b origin y + 4). + vertices add: ((b origin x + b corner x) // 2) @ (b corner y - 4). + vertices add: ((b origin x + b corner x) // 2) @ (b corner y). - vertices add: ((b origin x + b corner x)//2)@(b origin y). - vertices add: ((b origin x + b corner x)//2)@(b origin y + 4). - vertices add: ((b origin x + b corner x)//2)@(b corner y - 4). - vertices add: ((b origin x + b corner x)//2)@(b corner y). ]. ]. threadPolygon := PolygonMorph vertices: vertices color: Color black borderWidth: 2 borderColor: Color black. threadPolygon makeOpen. threadPolygon openInWorld. ! Item was changed: ----- Method: ScriptEditorMorph>>extent: (in category 'other') ----- extent: x | newExtent tw menu | + newExtent := x max: self minWidth @ self minHeight. - newExtent := x max: self minWidth@self minHeight. (tw := self findA: TwoWayScrollPane) ifNil: ["This was the old behavior" ^ super extent: newExtent]. (self hasProperty: #autoFitContents) ifTrue: [ menu := MenuMorph new defaultTarget: self. menu addUpdating: #autoFitString target: self action: #autoFitOnOff. menu addTitle: 'To resize the script, uncheck the box below' translated. menu popUpEvent: nil in: self world . ^ self]. "Allow the user to resize to any size" tw extent: ((newExtent x max: self firstSubmorph width) + @ (newExtent y - self firstSubmorph height)) - (borderWidth * 2) + (-4 @ -4). "inset?" - @ (newExtent y - self firstSubmorph height)) - (borderWidth*2) + (-4@-4). "inset?" ^ super extent: newExtent! Item was changed: ----- Method: ViewerLine>>addGetterFeedback (in category 'slot') ----- addGetterFeedback "Add feedback during mouseover of a getter" | aMorph endMorph | endMorph := (#(touchesA: #seesColor: #overlaps:) includes: self elementSymbol) ifTrue: [submorphs eighth] ifFalse: [submorphs sixth]. + aMorph := RectangleMorph new useRoundedCorners bounds: ((submorphs fourth topLeft - (2 @ -1)) corner: (endMorph bottomRight + (2 @ -1))). - aMorph := RectangleMorph new useRoundedCorners bounds: ((submorphs fourth topLeft - (2@-1)) corner: (endMorph bottomRight + (2@-1))). aMorph beTransparent; borderWidth: 2; borderColor: (Color r: 1.0 g: 0.355 b: 0.839); lock. aMorph setProperty: #highlight toValue: true. ActiveWorld addMorphFront: aMorph " Color fromUser (Color r: 1.0 g: 0.355 b: 0.839) "!
1
0
0
0
The Trunk: EToys-nice.78.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-nice.78.mcz
==================== Summary ==================== Name: EToys-nice.78 Author: nice Time: 29 December 2010, 3:58:43.772 pm UUID: 2fc3096b-3e18-4f08-8e76-b6c9d43455df Ancestors: EToys-cmm.77 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. =============== Diff against EToys-cmm.77 =============== Item was changed: ----- Method: AlignmentMorph>>addUpDownArrowsFor: (in category '*Etoys-initialization') ----- addUpDownArrowsFor: aMorph "Add a column of up and down arrows that serve to send upArrowHit and downArrowHit to aMorph when they're pressed/held down" | holder downArrow upArrow | holder := Morph new extent: 16 @ 16; beTransparent. downArrow := ImageMorph new image: (ScriptingSystem formAtKey: 'DownArrow'). upArrow := ImageMorph new image: (ScriptingSystem formAtKey: 'UpArrow'). + upArrow position: holder bounds topLeft + (2 @ 2). - upArrow position: holder bounds topLeft + (2@2). downArrow align: downArrow bottomLeft + with: holder topLeft + (0 @ TileMorph defaultH) + (2 @ -2). - with: holder topLeft + (0 @ TileMorph defaultH) + (2@-2). holder addMorph: upArrow. holder addMorph: downArrow. self addMorphBack: holder. upArrow on: #mouseDown send: #upArrowHit to: aMorph. upArrow on: #mouseStillDown send: #upArrowHit to: aMorph. downArrow on: #mouseDown send: #downArrowHit to: aMorph. downArrow on: #mouseStillDown send: #downArrowHit to: aMorph.! Item was changed: ----- Method: ScriptEditorMorph>>createThreadShowing (in category 'menu commands') ----- createThreadShowing | vertices | self deleteThreadShowing. vertices := OrderedCollection new. self tileRows do: [:row | | b | row first isTurtleRow ifTrue: [ b := row first bounds. + vertices add: ((b topLeft + (4 @ 0)) + ((0 * 0.1 * b width) @ 0)). - vertices add: ((b topLeft + (4@0)) + ((0 * 0.1 * b width)@0)). 0 to: 9 do: [:i | + vertices add: ((b topLeft + (4 @ 4))+ ((i * 0.1 * b width ) @ 0)). + vertices add: ((b bottomLeft + (4 @ -4)) + ((i * 0.1 * b width) @ 0)). - vertices add: ((b topLeft + (4@4))+ ((i * 0.1 * b width )@0)). - vertices add: ((b bottomLeft + (4@-4)) + ((i * 0.1 * b width)@0)). ]. + vertices add: ((b bottomLeft + (4 @ 0)) + ((9 * 0.1 * b width) @ 0)). - vertices add: ((b bottomLeft + (4@0)) + ((9 * 0.1 * b width)@0)). ] ifFalse: [ b := row first bounds. + vertices add: ((b origin x + b corner x) // 2) @ (b origin y). + vertices add: ((b origin x + b corner x) // 2) @ (b origin y + 4). + vertices add: ((b origin x + b corner x) // 2) @ (b corner y - 4). + vertices add: ((b origin x + b corner x) // 2) @ (b corner y). - vertices add: ((b origin x + b corner x)//2)@(b origin y). - vertices add: ((b origin x + b corner x)//2)@(b origin y + 4). - vertices add: ((b origin x + b corner x)//2)@(b corner y - 4). - vertices add: ((b origin x + b corner x)//2)@(b corner y). ]. ]. threadPolygon := PolygonMorph vertices: vertices color: Color black borderWidth: 2 borderColor: Color black. threadPolygon makeOpen. threadPolygon openInWorld. ! Item was changed: ----- Method: ScriptEditorMorph>>extent: (in category 'other') ----- extent: x | newExtent tw menu | + newExtent := x max: self minWidth @ self minHeight. - newExtent := x max: self minWidth@self minHeight. (tw := self findA: TwoWayScrollPane) ifNil: ["This was the old behavior" ^ super extent: newExtent]. (self hasProperty: #autoFitContents) ifTrue: [ menu := MenuMorph new defaultTarget: self. menu addUpdating: #autoFitString target: self action: #autoFitOnOff. menu addTitle: 'To resize the script, uncheck the box below' translated. menu popUpEvent: nil in: self world . ^ self]. "Allow the user to resize to any size" tw extent: ((newExtent x max: self firstSubmorph width) + @ (newExtent y - self firstSubmorph height)) - (borderWidth * 2) + (-4 @ -4). "inset?" - @ (newExtent y - self firstSubmorph height)) - (borderWidth*2) + (-4@-4). "inset?" ^ super extent: newExtent! Item was changed: ----- Method: ViewerLine>>addGetterFeedback (in category 'slot') ----- addGetterFeedback "Add feedback during mouseover of a getter" | aMorph endMorph | endMorph := (#(touchesA: #seesColor: #overlaps:) includes: self elementSymbol) ifTrue: [submorphs eighth] ifFalse: [submorphs sixth]. + aMorph := RectangleMorph new useRoundedCorners bounds: ((submorphs fourth topLeft - (2 @ -1)) corner: (endMorph bottomRight + (2 @ -1))). - aMorph := RectangleMorph new useRoundedCorners bounds: ((submorphs fourth topLeft - (2@-1)) corner: (endMorph bottomRight + (2@-1))). aMorph beTransparent; borderWidth: 2; borderColor: (Color r: 1.0 g: 0.355 b: 0.839); lock. aMorph setProperty: #highlight toValue: true. ActiveWorld addMorphFront: aMorph " Color fromUser (Color r: 1.0 g: 0.355 b: 0.839) "!
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
36
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Results per page:
10
25
50
100
200