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: EToys-nice.79.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.79.mcz
==================== Summary ==================== Name: EToys-nice.79 Author: nice Time: 29 December 2010, 5:05:46.331 pm UUID: 17fbf753-04dc-4f40-a007-7e3cbf61242b Ancestors: EToys-nice.78 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. =============== Diff against EToys-nice.78 =============== Item was changed: ----- Method: SyntaxMorph classSide>>standardInset (in category 'as yet unclassified') ----- standardInset + ^ self alansTest1 ifTrue: [1] ifFalse: [-1 @ -1]! - ^ self alansTest1 ifTrue: [1] ifFalse: [-1@-1]! Item was changed: ----- Method: SyntaxMorph>>drawOn: (in category 'drawing') ----- drawOn: aCanvas super drawOn: aCanvas. self isBlockNode ifFalse: [^self]. self alansTest1 ifTrue: [^self]. self immediatelyBelowTheMethodNode ifTrue: [ + aCanvas fillRectangle: (self topLeft + (0 @ -1) extent: self width @ 1) color: Color gray - aCanvas fillRectangle: (self topLeft + (0@-1) extent: self width@1) color: Color gray ] ifFalse: [ + aCanvas fillRectangle: (self topLeft + (1 @ 1) extent: 2 @ (self height-2)) color: Color gray. + aCanvas fillRectangle: (self topLeft + (1 @ 1) extent: 4 @ 1) color: Color gray. + aCanvas fillRectangle: (self bottomLeft + (1 @ -1) extent: 4 @ 1) color: Color gray - aCanvas fillRectangle: (self topLeft + (1@1) extent: 2@(self height-2)) color: Color gray. - aCanvas fillRectangle: (self topLeft + (1@1) extent: 4@1) color: Color gray. - aCanvas fillRectangle: (self bottomLeft + (1@-1) extent: 4@1) color: Color gray ]. ! Item was changed: ----- Method: SyntaxMorph>>selectorMenuAsk: (in category 'pop ups') ----- selectorMenuAsk: listOfLists "I represent a SelectorNode to be replaced by one of the selectors in one of the category lists. Each list has pre-built StringMorphs in it." | menu | listOfLists isEmpty ifTrue: [^ nil]. listOfLists first addFirst: (self aSimpleStringMorphWith: '( Cancel )'). listOfLists first first color: Color red. menu := RectangleMorph new. + menu listDirection: #leftToRight; layoutInset: 3; cellInset: 1 @ 0. - menu listDirection: #leftToRight; layoutInset: 3; cellInset: 1@0. menu layoutPolicy: TableLayout new; hResizing: #shrinkWrap; vResizing: #shrinkWrap; color: (Color r: 0.767 g: 1.0 b: 0.767); useRoundedCorners; cellPositioning: #topLeft. listOfLists do: [:ll | | col | col := Morph new. + col listDirection: #topToBottom; layoutInset: 0; cellInset: 0 @ 0. - col listDirection: #topToBottom; layoutInset: 0; cellInset: 0@0. col layoutPolicy: TableLayout new; hResizing: #shrinkWrap. col color: Color transparent; vResizing: #shrinkWrap. menu addMorphBack: col. ll do: [:ss | col addMorphBack: ss. ss on: #mouseUp send: #replaceKeyWord:menuItem: to: self] ]. self world addMorph: menu. + menu setConstrainedPosition: (owner localPointToGlobal: self topRight) + (10 @ -30) - menu setConstrainedPosition: (owner localPointToGlobal: self topRight) + (10@-30) hangOut: false. ! Item was changed: ----- Method: SyntaxMorph>>standardInset (in category 'alans styles') ----- standardInset + parseNode class == BlockNode ifTrue: [^ 5 @ 1]. - parseNode class == BlockNode ifTrue: [^ 5@1]. "allow pointing beside a line so can replace it" ^ self alansTest1 ifTrue: [1] ifFalse: [-1]!
1
0
0
0
The Trunk: EToys-nice.79.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.79.mcz
==================== Summary ==================== Name: EToys-nice.79 Author: nice Time: 29 December 2010, 5:05:46.331 pm UUID: 17fbf753-04dc-4f40-a007-7e3cbf61242b Ancestors: EToys-nice.78 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. =============== Diff against EToys-nice.78 =============== Item was changed: ----- Method: SyntaxMorph classSide>>standardInset (in category 'as yet unclassified') ----- standardInset + ^ self alansTest1 ifTrue: [1] ifFalse: [-1 @ -1]! - ^ self alansTest1 ifTrue: [1] ifFalse: [-1@-1]! Item was changed: ----- Method: SyntaxMorph>>drawOn: (in category 'drawing') ----- drawOn: aCanvas super drawOn: aCanvas. self isBlockNode ifFalse: [^self]. self alansTest1 ifTrue: [^self]. self immediatelyBelowTheMethodNode ifTrue: [ + aCanvas fillRectangle: (self topLeft + (0 @ -1) extent: self width @ 1) color: Color gray - aCanvas fillRectangle: (self topLeft + (0@-1) extent: self width@1) color: Color gray ] ifFalse: [ + aCanvas fillRectangle: (self topLeft + (1 @ 1) extent: 2 @ (self height-2)) color: Color gray. + aCanvas fillRectangle: (self topLeft + (1 @ 1) extent: 4 @ 1) color: Color gray. + aCanvas fillRectangle: (self bottomLeft + (1 @ -1) extent: 4 @ 1) color: Color gray - aCanvas fillRectangle: (self topLeft + (1@1) extent: 2@(self height-2)) color: Color gray. - aCanvas fillRectangle: (self topLeft + (1@1) extent: 4@1) color: Color gray. - aCanvas fillRectangle: (self bottomLeft + (1@-1) extent: 4@1) color: Color gray ]. ! Item was changed: ----- Method: SyntaxMorph>>selectorMenuAsk: (in category 'pop ups') ----- selectorMenuAsk: listOfLists "I represent a SelectorNode to be replaced by one of the selectors in one of the category lists. Each list has pre-built StringMorphs in it." | menu | listOfLists isEmpty ifTrue: [^ nil]. listOfLists first addFirst: (self aSimpleStringMorphWith: '( Cancel )'). listOfLists first first color: Color red. menu := RectangleMorph new. + menu listDirection: #leftToRight; layoutInset: 3; cellInset: 1 @ 0. - menu listDirection: #leftToRight; layoutInset: 3; cellInset: 1@0. menu layoutPolicy: TableLayout new; hResizing: #shrinkWrap; vResizing: #shrinkWrap; color: (Color r: 0.767 g: 1.0 b: 0.767); useRoundedCorners; cellPositioning: #topLeft. listOfLists do: [:ll | | col | col := Morph new. + col listDirection: #topToBottom; layoutInset: 0; cellInset: 0 @ 0. - col listDirection: #topToBottom; layoutInset: 0; cellInset: 0@0. col layoutPolicy: TableLayout new; hResizing: #shrinkWrap. col color: Color transparent; vResizing: #shrinkWrap. menu addMorphBack: col. ll do: [:ss | col addMorphBack: ss. ss on: #mouseUp send: #replaceKeyWord:menuItem: to: self] ]. self world addMorph: menu. + menu setConstrainedPosition: (owner localPointToGlobal: self topRight) + (10 @ -30) - menu setConstrainedPosition: (owner localPointToGlobal: self topRight) + (10@-30) hangOut: false. ! Item was changed: ----- Method: SyntaxMorph>>standardInset (in category 'alans styles') ----- standardInset + parseNode class == BlockNode ifTrue: [^ 5 @ 1]. - parseNode class == BlockNode ifTrue: [^ 5@1]. "allow pointing beside a line so can replace it" ^ self alansTest1 ifTrue: [1] ifFalse: [-1]!
1
0
0
0
The Trunk: ST80-nice.121.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-nice.121.mcz
==================== Summary ==================== Name: ST80-nice.121 Author: nice Time: 29 December 2010, 4:21:35.51 pm UUID: a6adba3b-7694-4b0b-b933-027440aaf8f9 Ancestors: ST80-ul.120 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. Test Integer equality with = rather than == . =============== Diff against ST80-ul.120 =============== Item was changed: ----- Method: ParagraphEditor>>sameColumn:newLine:forward: (in category 'private') ----- sameColumn: start newLine: lineBlock forward: isForward "Private - Compute the index in my text with the line number derived from lineBlock," " a one argument block accepting the old line number. The position inside the line will be preserved as good as possible" "The boolean isForward is used in the border case to determine if we should move to the beginning or the end of the line." | wordStyle column currentLine offsetAtTargetLine targetEOL lines numberOfLines currentLineNumber targetLineNumber | wordStyle := Preferences wordStyleCursorMovement. wordStyle ifTrue: [ lines := paragraph lines. numberOfLines := paragraph numberOfLines. currentLineNumber := paragraph lineIndexOfCharacterIndex: start. currentLine := lines at: currentLineNumber] ifFalse: [ lines := self lines. numberOfLines := lines size. currentLine := lines detect:[:lineInterval | lineInterval last >= start] ifNone:[lines last]. currentLineNumber := currentLine second]. column := start - currentLine first. targetLineNumber := ((lineBlock value: currentLineNumber) max: 1) min: numberOfLines. offsetAtTargetLine := (lines at: targetLineNumber) first. + targetEOL := (lines at: targetLineNumber) last + (targetLineNumber = numberOfLines ifTrue:[1]ifFalse:[0]). + targetLineNumber = currentLineNumber - targetEOL := (lines at: targetLineNumber) last + (targetLineNumber == numberOfLines ifTrue:[1]ifFalse:[0]). - targetLineNumber == currentLineNumber "No movement or movement failed. Move to beginning or end of line." ifTrue:[^isForward ifTrue:[targetEOL] ifFalse:[offsetAtTargetLine]]. ^offsetAtTargetLine + column min: targetEOL.! Item was changed: ----- Method: StandardSystemController>>cursorOnBorder (in category 'borders') ----- cursorOnBorder | cp i box | view isCollapsed ifTrue: [^ false]. cp := sensor cursorPoint. + ((view labelDisplayBox insetBy: (0 @ 2 corner: 0 @ -2)) containsPoint: cp) - ((view labelDisplayBox insetBy: (0@2 corner: 0@-2)) containsPoint: cp) ifTrue: [^ false]. (i := view subViews findFirst: [:v | v displayBox containsPoint: cp]) = 0 ifTrue: [box := view windowBox] ifFalse: [box := (view subViews at: i) insetDisplayBox]. ^ ((box insetBy: 3) containsPoint: cp) not and: [(box expandBy: 4) containsPoint: cp]! Item was changed: ----- Method: StandardSystemView>>closeBoxFrame (in category 'label access') ----- closeBoxFrame + ^ Rectangle origin: (self labelDisplayBox leftCenter + (10 @ -5)) extent: (11 @ 11)! - ^ Rectangle origin: (self labelDisplayBox leftCenter + (10@-5)) extent: (11@11)! Item was changed: ----- Method: StandardSystemView>>growBoxFrame (in category 'label access') ----- growBoxFrame + ^ Rectangle origin: (self labelDisplayBox rightCenter + (-22 @ -5)) extent: (11 @ 11)! - ^ Rectangle origin: (self labelDisplayBox rightCenter + (-22@-5)) extent: (11@11)!
1
0
0
0
The Trunk: ST80-nice.121.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-nice.121.mcz
==================== Summary ==================== Name: ST80-nice.121 Author: nice Time: 29 December 2010, 4:21:35.51 pm UUID: a6adba3b-7694-4b0b-b933-027440aaf8f9 Ancestors: ST80-ul.120 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. Test Integer equality with = rather than == . =============== Diff against ST80-ul.120 =============== Item was changed: ----- Method: ParagraphEditor>>sameColumn:newLine:forward: (in category 'private') ----- sameColumn: start newLine: lineBlock forward: isForward "Private - Compute the index in my text with the line number derived from lineBlock," " a one argument block accepting the old line number. The position inside the line will be preserved as good as possible" "The boolean isForward is used in the border case to determine if we should move to the beginning or the end of the line." | wordStyle column currentLine offsetAtTargetLine targetEOL lines numberOfLines currentLineNumber targetLineNumber | wordStyle := Preferences wordStyleCursorMovement. wordStyle ifTrue: [ lines := paragraph lines. numberOfLines := paragraph numberOfLines. currentLineNumber := paragraph lineIndexOfCharacterIndex: start. currentLine := lines at: currentLineNumber] ifFalse: [ lines := self lines. numberOfLines := lines size. currentLine := lines detect:[:lineInterval | lineInterval last >= start] ifNone:[lines last]. currentLineNumber := currentLine second]. column := start - currentLine first. targetLineNumber := ((lineBlock value: currentLineNumber) max: 1) min: numberOfLines. offsetAtTargetLine := (lines at: targetLineNumber) first. + targetEOL := (lines at: targetLineNumber) last + (targetLineNumber = numberOfLines ifTrue:[1]ifFalse:[0]). + targetLineNumber = currentLineNumber - targetEOL := (lines at: targetLineNumber) last + (targetLineNumber == numberOfLines ifTrue:[1]ifFalse:[0]). - targetLineNumber == currentLineNumber "No movement or movement failed. Move to beginning or end of line." ifTrue:[^isForward ifTrue:[targetEOL] ifFalse:[offsetAtTargetLine]]. ^offsetAtTargetLine + column min: targetEOL.! Item was changed: ----- Method: StandardSystemController>>cursorOnBorder (in category 'borders') ----- cursorOnBorder | cp i box | view isCollapsed ifTrue: [^ false]. cp := sensor cursorPoint. + ((view labelDisplayBox insetBy: (0 @ 2 corner: 0 @ -2)) containsPoint: cp) - ((view labelDisplayBox insetBy: (0@2 corner: 0@-2)) containsPoint: cp) ifTrue: [^ false]. (i := view subViews findFirst: [:v | v displayBox containsPoint: cp]) = 0 ifTrue: [box := view windowBox] ifFalse: [box := (view subViews at: i) insetDisplayBox]. ^ ((box insetBy: 3) containsPoint: cp) not and: [(box expandBy: 4) containsPoint: cp]! Item was changed: ----- Method: StandardSystemView>>closeBoxFrame (in category 'label access') ----- closeBoxFrame + ^ Rectangle origin: (self labelDisplayBox leftCenter + (10 @ -5)) extent: (11 @ 11)! - ^ Rectangle origin: (self labelDisplayBox leftCenter + (10@-5)) extent: (11@11)! Item was changed: ----- Method: StandardSystemView>>growBoxFrame (in category 'label access') ----- growBoxFrame + ^ Rectangle origin: (self labelDisplayBox rightCenter + (-22 @ -5)) extent: (11 @ 11)! - ^ Rectangle origin: (self labelDisplayBox rightCenter + (-22@-5)) extent: (11@11)!
1
0
0
0
The Trunk: ST80-nice.121.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-nice.121.mcz
==================== Summary ==================== Name: ST80-nice.121 Author: nice Time: 29 December 2010, 4:21:35.51 pm UUID: a6adba3b-7694-4b0b-b933-027440aaf8f9 Ancestors: ST80-ul.120 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. Test Integer equality with = rather than == . =============== Diff against ST80-ul.120 =============== Item was changed: ----- Method: ParagraphEditor>>sameColumn:newLine:forward: (in category 'private') ----- sameColumn: start newLine: lineBlock forward: isForward "Private - Compute the index in my text with the line number derived from lineBlock," " a one argument block accepting the old line number. The position inside the line will be preserved as good as possible" "The boolean isForward is used in the border case to determine if we should move to the beginning or the end of the line." | wordStyle column currentLine offsetAtTargetLine targetEOL lines numberOfLines currentLineNumber targetLineNumber | wordStyle := Preferences wordStyleCursorMovement. wordStyle ifTrue: [ lines := paragraph lines. numberOfLines := paragraph numberOfLines. currentLineNumber := paragraph lineIndexOfCharacterIndex: start. currentLine := lines at: currentLineNumber] ifFalse: [ lines := self lines. numberOfLines := lines size. currentLine := lines detect:[:lineInterval | lineInterval last >= start] ifNone:[lines last]. currentLineNumber := currentLine second]. column := start - currentLine first. targetLineNumber := ((lineBlock value: currentLineNumber) max: 1) min: numberOfLines. offsetAtTargetLine := (lines at: targetLineNumber) first. + targetEOL := (lines at: targetLineNumber) last + (targetLineNumber = numberOfLines ifTrue:[1]ifFalse:[0]). + targetLineNumber = currentLineNumber - targetEOL := (lines at: targetLineNumber) last + (targetLineNumber == numberOfLines ifTrue:[1]ifFalse:[0]). - targetLineNumber == currentLineNumber "No movement or movement failed. Move to beginning or end of line." ifTrue:[^isForward ifTrue:[targetEOL] ifFalse:[offsetAtTargetLine]]. ^offsetAtTargetLine + column min: targetEOL.! Item was changed: ----- Method: StandardSystemController>>cursorOnBorder (in category 'borders') ----- cursorOnBorder | cp i box | view isCollapsed ifTrue: [^ false]. cp := sensor cursorPoint. + ((view labelDisplayBox insetBy: (0 @ 2 corner: 0 @ -2)) containsPoint: cp) - ((view labelDisplayBox insetBy: (0@2 corner: 0@-2)) containsPoint: cp) ifTrue: [^ false]. (i := view subViews findFirst: [:v | v displayBox containsPoint: cp]) = 0 ifTrue: [box := view windowBox] ifFalse: [box := (view subViews at: i) insetDisplayBox]. ^ ((box insetBy: 3) containsPoint: cp) not and: [(box expandBy: 4) containsPoint: cp]! Item was changed: ----- Method: StandardSystemView>>closeBoxFrame (in category 'label access') ----- closeBoxFrame + ^ Rectangle origin: (self labelDisplayBox leftCenter + (10 @ -5)) extent: (11 @ 11)! - ^ Rectangle origin: (self labelDisplayBox leftCenter + (10@-5)) extent: (11@11)! Item was changed: ----- Method: StandardSystemView>>growBoxFrame (in category 'label access') ----- growBoxFrame + ^ Rectangle origin: (self labelDisplayBox rightCenter + (-22 @ -5)) extent: (11 @ 11)! - ^ Rectangle origin: (self labelDisplayBox rightCenter + (-22@-5)) extent: (11@11)!
1
0
0
0
The Trunk: MorphicExtras-nice.98.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-nice.98.mcz
==================== Summary ==================== Name: MorphicExtras-nice.98 Author: nice Time: 29 December 2010, 4:18:13.421 pm UUID: a61e9f05-6a6f-4590-a274-18423b8336f5 Ancestors: MorphicExtras-cmm.97 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. =============== Diff against MorphicExtras-cmm.97 =============== Item was changed: ----- Method: FlapTab>>fitContents (in category 'misc') ----- fitContents self isCurrentlyTextual ifFalse: [^ super fitContents]. self ifVertical: + [self extent: submorphs first extent + (2 * self borderWidth) + (0 @ 4). + submorphs first position: self position + self borderWidth + (1 @ 4)] - [self extent: submorphs first extent + (2 * self borderWidth) + (0@4). - submorphs first position: self position + self borderWidth + (1@4)] ifHorizontal: + [self extent: submorphs first extent + (2 * self borderWidth) + (8 @ -1). + submorphs first position: self position + self borderWidth + (5 @ 1)]! - [self extent: submorphs first extent + (2 * self borderWidth) + (8@-1). - submorphs first position: self position + self borderWidth + (5@1)]! Item was changed: ----- Method: PaintBoxMorph>>fixUpColorPicker (in category 'recent colors') ----- fixUpColorPicker | chart picker | + chart := ColorChart ifNil: [ColorChart := Cursor wait showWhile: [(ColorPickerMorph colorPaletteForDepth: 16 extent: 120 @ 89)]]. - chart := ColorChart ifNil:[Cursor wait showWhile:[ColorChart := (ColorPickerMorph colorPaletteForDepth: 16 extent: 120@89)]]. chart getCanvas frameRectangle: chart boundingBox color: Color black. + picker := Form extent: (chart extent + (14 @ 12)) depth: 16. - picker := Form extent: (chart extent + (14@12)) depth: 16. picker fillWhite. "top" + picker copy: (0 @ 0 extent: picker width @ 6) + from: (colorMemory image width - picker width) @ 0 - picker copy: (0@0 extent: picker width@6) - from: (colorMemory image width - picker width)@0 in: colorMemory image rule: Form over. "bottom" + picker copy: (0 @ (picker height - 6) extent: picker width @ 6) + from: (colorMemory image width - picker width) @ (colorMemory image height - 7) - picker copy: (0@ (picker height-6) extent: picker width@6) - from: (colorMemory image width - picker width)@(colorMemory image height - 7) in: colorMemory image rule: Form over. "left" + picker copy: (0 @ 6 corner: 8 @ (picker height - 6)) + from: (colorMemory image boundingBox topLeft + (0 @ 6)) - picker copy: (0@6 corner: 8@(picker height - 6)) - from: (colorMemory image boundingBox topLeft + (0@6)) in: colorMemory image rule: Form over. "right" + picker copy: (picker width-6 @ 6 corner: picker width @ (picker height - 6)) + from: (colorMemory image boundingBox topRight - (6 @ -6)) - picker copy: (picker width-6@6 corner: picker width@(picker height - 6)) - from: (colorMemory image boundingBox topRight - (6@-6)) in: colorMemory image rule: Form over. + chart displayOn: picker at: 8 @ 6. - chart displayOn: picker at: 8@6. picker getCanvas frameRectangle: picker boundingBox color: Color black. colorMemory image: picker. ! Item was changed: ----- Method: PaintBoxMorph>>init4 (in category 'initialization') ----- init4 "Just a record of how Ted loaded in the paintbox button images, Feb 98" + | bb im pp newImage pic24Bit picNewBit blt | - | bb im pp newImage pic24Bit picNewBit blt | + "self loadoffImage: 'roundedPalette3.bmp'." + pic24Bit := GIFReadWriter formFromServerFile: 'updates/137roundedPalette3.bmp'. + picNewBit := Form extent: pic24Bit extent depth: 16. + pic24Bit displayOn: picNewBit. + OriginalBounds := picNewBit boundingBox. + AllOffImage := Form extent: OriginalBounds extent depth: 16. + blt := BitBlt current toForm: AllOffImage. + blt sourceForm: picNewBit; combinationRule: Form over; + sourceRect: OriginalBounds; destOrigin: 0 @ 0; copyBits. - "self loadoffImage: 'roundedPalette3.bmp'." - pic24Bit := GIFReadWriter formFromServerFile: 'updates/137roundedPalette3.bmp'. - picNewBit := Form extent: pic24Bit extent depth: 16. - pic24Bit displayOn: picNewBit. - OriginalBounds := picNewBit boundingBox. - AllOffImage := Form extent: OriginalBounds extent depth: 16. - blt := BitBlt current toForm: AllOffImage. - blt sourceForm: picNewBit; combinationRule: Form over; - sourceRect: OriginalBounds; destOrigin: 0@0; copyBits. + AllOffImage mapColor: Color transparent to: Color black. + self image: AllOffImage. + self invalidRect: bounds. - AllOffImage mapColor: Color transparent to: Color black. - self image: AllOffImage. - self invalidRect: bounds. + self submorphsDo: [:button | button position: button position + (10 @ 10)]. + (im := submorphs at: 28) class == ImageMorph ifTrue: [ + im position: im position + (2 @ 0)]. "color picker" + "exercise it once" - self submorphsDo: [:button | button position: button position + (10@10)]. - (im := submorphs at: 28) class == ImageMorph ifTrue: [ - im position: im position + (2@0)]. "color picker" - "exercise it once" + (bb := self submorphNamed: #keep:) position: bb position + (0 @ 25). + (bb := self submorphNamed: #toss:) position: bb position + (0 @ 25). + (bb := self submorphNamed: #undo:) position: bb position + (0 @ -25). + (bb := self submorphNamed: #clear:) position: bb position + (0 @ -25). + (bb := self submorphNamed: #undo:) position: bb position + (0 @ -69). + (bb := self submorphNamed: #clear:) position: bb position + (0 @ -69). + self submorphsDo: [:button | + button class == AlignmentMorph ifTrue: [ + button position: button position + (0 @ 25)]. + (button printString includesSubString: 'stamp:') ifTrue: [ + button position: button position + (0 @ 25)]]. + (bb := self submorphNamed: #prevStamp:) position: bb position + (0 @ 25). + (bb := self submorphNamed: #nextStamp:) position: bb position + (0 @ 25). - (bb := self submorphNamed: #keep:) position: bb position + (0@25). - (bb := self submorphNamed: #toss:) position: bb position + (0@25). - (bb := self submorphNamed: #undo:) position: bb position + (0@-25). - (bb := self submorphNamed: #clear:) position: bb position + (0@-25). - (bb := self submorphNamed: #undo:) position: bb position + (0@-69). - (bb := self submorphNamed: #clear:) position: bb position + (0@-69). - self submorphsDo: [:button | - button class == AlignmentMorph ifTrue: [ - button position: button position + (0@25)]. - (button printString includesSubString: 'stamp:') ifTrue: [ - button position: button position + (0@25)]]. - (bb := self submorphNamed: #prevStamp:) position: bb position + (0@25). - (bb := self submorphNamed: #nextStamp:) position: bb position + (0@25). + bb := self submorphNamed: #keep:. + newImage := bb pressedImage copy: (0 @ 4 corner: (bb pressedImage boundingBox extent)). + bb onImage: newImage. bb pressedImage: newImage. bb extent: newImage extent. + bb position: bb position + (4 @ 1). - bb := self submorphNamed: #keep:. - newImage := bb pressedImage copy: (0@4 corner: (bb pressedImage boundingBox extent)). - bb onImage: newImage. bb pressedImage: newImage. bb extent: newImage extent. - bb position: bb position + (4@1). + pp := (bb := self submorphNamed: #toss:) pressedImage. + newImage := pp copy: (0 @ 4 corner: (bb pressedImage extent - (3 @ 0))). + bb onImage: newImage. bb pressedImage: newImage. + bb extent: newImage extent. + bb position: bb position + (3 @ 1). - pp := (bb := self submorphNamed: #toss:) pressedImage. - newImage := pp copy: (0@4 corner: (bb pressedImage extent - (3@0))). - bb onImage: newImage. bb pressedImage: newImage. - bb extent: newImage extent. - bb position: bb position + (3@1). + pp := (bb := self submorphNamed: #undo:) pressedImage. + newImage := pp copy: (0 @ 0 corner: (bb pressedImage extent - (3 @ 5))). + bb onImage: newImage. bb pressedImage: newImage. + bb extent: newImage extent. + bb position: bb position + (3 @ -1). - pp := (bb := self submorphNamed: #undo:) pressedImage. - newImage := pp copy: (0@0 corner: (bb pressedImage extent - (3@5))). - bb onImage: newImage. bb pressedImage: newImage. - bb extent: newImage extent. - bb position: bb position + (3@-1). + pp := (bb := self submorphNamed: #clear:) pressedImage. + newImage := pp copy: (0 @ 0 corner: (bb pressedImage extent - (0 @ 5))). + bb onImage: newImage. bb pressedImage: newImage. + bb extent: newImage extent. + bb position: bb position + (3 @ -1). - pp := (bb := self submorphNamed: #clear:) pressedImage. - newImage := pp copy: (0@0 corner: (bb pressedImage extent - (0@5))). - bb onImage: newImage. bb pressedImage: newImage. - bb extent: newImage extent. - bb position: bb position + (3@-1). + pic24Bit := GIFReadWriter formFromServerFile: 'updates/137pencil.bmp'. + picNewBit := Form extent: pic24Bit extent depth: 16. + pic24Bit displayOn: picNewBit. + newImage := picNewBit as8BitColorForm. + newImage transparentColor: (Color r: 0 g: 0 b: 0). + (bb := self submorphNamed: #erase:) pressedImage: newImage; onImage: newImage; + extent: newImage extent. - pic24Bit := GIFReadWriter formFromServerFile: 'updates/137pencil.bmp'. - picNewBit := Form extent: pic24Bit extent depth: 16. - pic24Bit displayOn: picNewBit. - newImage := picNewBit as8BitColorForm. - newImage transparentColor: (Color r: 0 g: 0 b: 0). - (bb := self submorphNamed: #erase:) pressedImage: newImage; onImage: newImage; - extent: newImage extent. + bb position: bb position + (-11 @ -1). - bb position: bb position + (-11@-1). ! Item was changed: ----- Method: PianoKeyboardMorph>>buildKeyboard (in category 'simple keyboard') ----- buildKeyboard | wtWid bkWid keyRect octavePt nWhite nBlack | self removeAllMorphs. wtWid := 8. bkWid := 5. + self extent: 10 @ 10. + 1 to: nOctaves + 1 do: - self extent: 10@10. - 1 to: nOctaves+1 do: [:i | i <= nOctaves ifTrue: [nWhite := 7. nBlack := 5] ifFalse: [nWhite := 1. nBlack := 0 "High C"]. + octavePt := self innerBounds topLeft + ((7 * wtWid * (i - 1) - 1) @ -1). - octavePt := self innerBounds topLeft + ((7*wtWid*(i-1)-1)@-1). 1 to: nWhite do: + [:j | keyRect := octavePt + (j - 1 * wtWid @ 0) extent: (wtWid + 1) @ 36. - [:j | keyRect := octavePt + (j-1*wtWid@0) extent: (wtWid+1)@36. self addMorph: ((RectangleMorph newBounds: keyRect color: whiteKeyColor) borderWidth: 1; on: #mouseDown send: #mouseDownPitch:event:noteMorph: to: self + withValue: i - 1 * 12 + (#(1 3 5 6 8 10 12) at: j))]. - withValue: i-1*12 + (#(1 3 5 6 8 10 12) at: j))]. 1 to: nBlack do: + [:j | keyRect := octavePt + ((#(6 15 29 38 47) at: j) @ 1) extent: bkWid @ 21. - [:j | keyRect := octavePt + ((#(6 15 29 38 47) at: j)@1) extent: bkWid@21. self addMorph: ((Morph newBounds: keyRect color: blackKeyColor) on: #mouseDown send: #mouseDownPitch:event:noteMorph: to: self + withValue: i - 1 * 12 + (#(2 4 7 9 11) at: j))]]. - withValue: i-1*12 + (#(2 4 7 9 11) at: j))]]. self submorphsDo: [:m | m on: #mouseMove send: #mouseMovePitch:event:noteMorph: to: self; on: #mouseUp send: #mouseUpPitch:event:noteMorph: to: self; on: #mouseEnterDragging send: #mouseDownPitch:event:noteMorph: to: self; on: #mouseLeaveDragging send: #mouseUpPitch:event:noteMorph: to: self]. self extent: (self fullBounds extent + borderWidth - 1)! Item was changed: ----- Method: PostscriptDummyWarp>>subCanvas: (in category 'dummy') ----- subCanvas:patchRect subCanvas ifNil: + [ subCanvas := PostscriptCanvas new reset setOrigin:patchRect topLeft clipRect: (-10000 @ -10000 extent: 20000 @ 20000)]. - [ subCanvas := PostscriptCanvas new reset setOrigin:patchRect topLeft clipRect:(-10000@-10000 extent:20000@20000)]. ^subCanvas. !
1
0
0
0
The Trunk: MorphicExtras-nice.98.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-nice.98.mcz
==================== Summary ==================== Name: MorphicExtras-nice.98 Author: nice Time: 29 December 2010, 4:18:13.421 pm UUID: a61e9f05-6a6f-4590-a274-18423b8336f5 Ancestors: MorphicExtras-cmm.97 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. =============== Diff against MorphicExtras-cmm.97 =============== Item was changed: ----- Method: FlapTab>>fitContents (in category 'misc') ----- fitContents self isCurrentlyTextual ifFalse: [^ super fitContents]. self ifVertical: + [self extent: submorphs first extent + (2 * self borderWidth) + (0 @ 4). + submorphs first position: self position + self borderWidth + (1 @ 4)] - [self extent: submorphs first extent + (2 * self borderWidth) + (0@4). - submorphs first position: self position + self borderWidth + (1@4)] ifHorizontal: + [self extent: submorphs first extent + (2 * self borderWidth) + (8 @ -1). + submorphs first position: self position + self borderWidth + (5 @ 1)]! - [self extent: submorphs first extent + (2 * self borderWidth) + (8@-1). - submorphs first position: self position + self borderWidth + (5@1)]! Item was changed: ----- Method: PaintBoxMorph>>fixUpColorPicker (in category 'recent colors') ----- fixUpColorPicker | chart picker | + chart := ColorChart ifNil: [ColorChart := Cursor wait showWhile: [(ColorPickerMorph colorPaletteForDepth: 16 extent: 120 @ 89)]]. - chart := ColorChart ifNil:[Cursor wait showWhile:[ColorChart := (ColorPickerMorph colorPaletteForDepth: 16 extent: 120@89)]]. chart getCanvas frameRectangle: chart boundingBox color: Color black. + picker := Form extent: (chart extent + (14 @ 12)) depth: 16. - picker := Form extent: (chart extent + (14@12)) depth: 16. picker fillWhite. "top" + picker copy: (0 @ 0 extent: picker width @ 6) + from: (colorMemory image width - picker width) @ 0 - picker copy: (0@0 extent: picker width@6) - from: (colorMemory image width - picker width)@0 in: colorMemory image rule: Form over. "bottom" + picker copy: (0 @ (picker height - 6) extent: picker width @ 6) + from: (colorMemory image width - picker width) @ (colorMemory image height - 7) - picker copy: (0@ (picker height-6) extent: picker width@6) - from: (colorMemory image width - picker width)@(colorMemory image height - 7) in: colorMemory image rule: Form over. "left" + picker copy: (0 @ 6 corner: 8 @ (picker height - 6)) + from: (colorMemory image boundingBox topLeft + (0 @ 6)) - picker copy: (0@6 corner: 8@(picker height - 6)) - from: (colorMemory image boundingBox topLeft + (0@6)) in: colorMemory image rule: Form over. "right" + picker copy: (picker width-6 @ 6 corner: picker width @ (picker height - 6)) + from: (colorMemory image boundingBox topRight - (6 @ -6)) - picker copy: (picker width-6@6 corner: picker width@(picker height - 6)) - from: (colorMemory image boundingBox topRight - (6@-6)) in: colorMemory image rule: Form over. + chart displayOn: picker at: 8 @ 6. - chart displayOn: picker at: 8@6. picker getCanvas frameRectangle: picker boundingBox color: Color black. colorMemory image: picker. ! Item was changed: ----- Method: PaintBoxMorph>>init4 (in category 'initialization') ----- init4 "Just a record of how Ted loaded in the paintbox button images, Feb 98" + | bb im pp newImage pic24Bit picNewBit blt | - | bb im pp newImage pic24Bit picNewBit blt | + "self loadoffImage: 'roundedPalette3.bmp'." + pic24Bit := GIFReadWriter formFromServerFile: 'updates/137roundedPalette3.bmp'. + picNewBit := Form extent: pic24Bit extent depth: 16. + pic24Bit displayOn: picNewBit. + OriginalBounds := picNewBit boundingBox. + AllOffImage := Form extent: OriginalBounds extent depth: 16. + blt := BitBlt current toForm: AllOffImage. + blt sourceForm: picNewBit; combinationRule: Form over; + sourceRect: OriginalBounds; destOrigin: 0 @ 0; copyBits. - "self loadoffImage: 'roundedPalette3.bmp'." - pic24Bit := GIFReadWriter formFromServerFile: 'updates/137roundedPalette3.bmp'. - picNewBit := Form extent: pic24Bit extent depth: 16. - pic24Bit displayOn: picNewBit. - OriginalBounds := picNewBit boundingBox. - AllOffImage := Form extent: OriginalBounds extent depth: 16. - blt := BitBlt current toForm: AllOffImage. - blt sourceForm: picNewBit; combinationRule: Form over; - sourceRect: OriginalBounds; destOrigin: 0@0; copyBits. + AllOffImage mapColor: Color transparent to: Color black. + self image: AllOffImage. + self invalidRect: bounds. - AllOffImage mapColor: Color transparent to: Color black. - self image: AllOffImage. - self invalidRect: bounds. + self submorphsDo: [:button | button position: button position + (10 @ 10)]. + (im := submorphs at: 28) class == ImageMorph ifTrue: [ + im position: im position + (2 @ 0)]. "color picker" + "exercise it once" - self submorphsDo: [:button | button position: button position + (10@10)]. - (im := submorphs at: 28) class == ImageMorph ifTrue: [ - im position: im position + (2@0)]. "color picker" - "exercise it once" + (bb := self submorphNamed: #keep:) position: bb position + (0 @ 25). + (bb := self submorphNamed: #toss:) position: bb position + (0 @ 25). + (bb := self submorphNamed: #undo:) position: bb position + (0 @ -25). + (bb := self submorphNamed: #clear:) position: bb position + (0 @ -25). + (bb := self submorphNamed: #undo:) position: bb position + (0 @ -69). + (bb := self submorphNamed: #clear:) position: bb position + (0 @ -69). + self submorphsDo: [:button | + button class == AlignmentMorph ifTrue: [ + button position: button position + (0 @ 25)]. + (button printString includesSubString: 'stamp:') ifTrue: [ + button position: button position + (0 @ 25)]]. + (bb := self submorphNamed: #prevStamp:) position: bb position + (0 @ 25). + (bb := self submorphNamed: #nextStamp:) position: bb position + (0 @ 25). - (bb := self submorphNamed: #keep:) position: bb position + (0@25). - (bb := self submorphNamed: #toss:) position: bb position + (0@25). - (bb := self submorphNamed: #undo:) position: bb position + (0@-25). - (bb := self submorphNamed: #clear:) position: bb position + (0@-25). - (bb := self submorphNamed: #undo:) position: bb position + (0@-69). - (bb := self submorphNamed: #clear:) position: bb position + (0@-69). - self submorphsDo: [:button | - button class == AlignmentMorph ifTrue: [ - button position: button position + (0@25)]. - (button printString includesSubString: 'stamp:') ifTrue: [ - button position: button position + (0@25)]]. - (bb := self submorphNamed: #prevStamp:) position: bb position + (0@25). - (bb := self submorphNamed: #nextStamp:) position: bb position + (0@25). + bb := self submorphNamed: #keep:. + newImage := bb pressedImage copy: (0 @ 4 corner: (bb pressedImage boundingBox extent)). + bb onImage: newImage. bb pressedImage: newImage. bb extent: newImage extent. + bb position: bb position + (4 @ 1). - bb := self submorphNamed: #keep:. - newImage := bb pressedImage copy: (0@4 corner: (bb pressedImage boundingBox extent)). - bb onImage: newImage. bb pressedImage: newImage. bb extent: newImage extent. - bb position: bb position + (4@1). + pp := (bb := self submorphNamed: #toss:) pressedImage. + newImage := pp copy: (0 @ 4 corner: (bb pressedImage extent - (3 @ 0))). + bb onImage: newImage. bb pressedImage: newImage. + bb extent: newImage extent. + bb position: bb position + (3 @ 1). - pp := (bb := self submorphNamed: #toss:) pressedImage. - newImage := pp copy: (0@4 corner: (bb pressedImage extent - (3@0))). - bb onImage: newImage. bb pressedImage: newImage. - bb extent: newImage extent. - bb position: bb position + (3@1). + pp := (bb := self submorphNamed: #undo:) pressedImage. + newImage := pp copy: (0 @ 0 corner: (bb pressedImage extent - (3 @ 5))). + bb onImage: newImage. bb pressedImage: newImage. + bb extent: newImage extent. + bb position: bb position + (3 @ -1). - pp := (bb := self submorphNamed: #undo:) pressedImage. - newImage := pp copy: (0@0 corner: (bb pressedImage extent - (3@5))). - bb onImage: newImage. bb pressedImage: newImage. - bb extent: newImage extent. - bb position: bb position + (3@-1). + pp := (bb := self submorphNamed: #clear:) pressedImage. + newImage := pp copy: (0 @ 0 corner: (bb pressedImage extent - (0 @ 5))). + bb onImage: newImage. bb pressedImage: newImage. + bb extent: newImage extent. + bb position: bb position + (3 @ -1). - pp := (bb := self submorphNamed: #clear:) pressedImage. - newImage := pp copy: (0@0 corner: (bb pressedImage extent - (0@5))). - bb onImage: newImage. bb pressedImage: newImage. - bb extent: newImage extent. - bb position: bb position + (3@-1). + pic24Bit := GIFReadWriter formFromServerFile: 'updates/137pencil.bmp'. + picNewBit := Form extent: pic24Bit extent depth: 16. + pic24Bit displayOn: picNewBit. + newImage := picNewBit as8BitColorForm. + newImage transparentColor: (Color r: 0 g: 0 b: 0). + (bb := self submorphNamed: #erase:) pressedImage: newImage; onImage: newImage; + extent: newImage extent. - pic24Bit := GIFReadWriter formFromServerFile: 'updates/137pencil.bmp'. - picNewBit := Form extent: pic24Bit extent depth: 16. - pic24Bit displayOn: picNewBit. - newImage := picNewBit as8BitColorForm. - newImage transparentColor: (Color r: 0 g: 0 b: 0). - (bb := self submorphNamed: #erase:) pressedImage: newImage; onImage: newImage; - extent: newImage extent. + bb position: bb position + (-11 @ -1). - bb position: bb position + (-11@-1). ! Item was changed: ----- Method: PianoKeyboardMorph>>buildKeyboard (in category 'simple keyboard') ----- buildKeyboard | wtWid bkWid keyRect octavePt nWhite nBlack | self removeAllMorphs. wtWid := 8. bkWid := 5. + self extent: 10 @ 10. + 1 to: nOctaves + 1 do: - self extent: 10@10. - 1 to: nOctaves+1 do: [:i | i <= nOctaves ifTrue: [nWhite := 7. nBlack := 5] ifFalse: [nWhite := 1. nBlack := 0 "High C"]. + octavePt := self innerBounds topLeft + ((7 * wtWid * (i - 1) - 1) @ -1). - octavePt := self innerBounds topLeft + ((7*wtWid*(i-1)-1)@-1). 1 to: nWhite do: + [:j | keyRect := octavePt + (j - 1 * wtWid @ 0) extent: (wtWid + 1) @ 36. - [:j | keyRect := octavePt + (j-1*wtWid@0) extent: (wtWid+1)@36. self addMorph: ((RectangleMorph newBounds: keyRect color: whiteKeyColor) borderWidth: 1; on: #mouseDown send: #mouseDownPitch:event:noteMorph: to: self + withValue: i - 1 * 12 + (#(1 3 5 6 8 10 12) at: j))]. - withValue: i-1*12 + (#(1 3 5 6 8 10 12) at: j))]. 1 to: nBlack do: + [:j | keyRect := octavePt + ((#(6 15 29 38 47) at: j) @ 1) extent: bkWid @ 21. - [:j | keyRect := octavePt + ((#(6 15 29 38 47) at: j)@1) extent: bkWid@21. self addMorph: ((Morph newBounds: keyRect color: blackKeyColor) on: #mouseDown send: #mouseDownPitch:event:noteMorph: to: self + withValue: i - 1 * 12 + (#(2 4 7 9 11) at: j))]]. - withValue: i-1*12 + (#(2 4 7 9 11) at: j))]]. self submorphsDo: [:m | m on: #mouseMove send: #mouseMovePitch:event:noteMorph: to: self; on: #mouseUp send: #mouseUpPitch:event:noteMorph: to: self; on: #mouseEnterDragging send: #mouseDownPitch:event:noteMorph: to: self; on: #mouseLeaveDragging send: #mouseUpPitch:event:noteMorph: to: self]. self extent: (self fullBounds extent + borderWidth - 1)! Item was changed: ----- Method: PostscriptDummyWarp>>subCanvas: (in category 'dummy') ----- subCanvas:patchRect subCanvas ifNil: + [ subCanvas := PostscriptCanvas new reset setOrigin:patchRect topLeft clipRect: (-10000 @ -10000 extent: 20000 @ 20000)]. - [ subCanvas := PostscriptCanvas new reset setOrigin:patchRect topLeft clipRect:(-10000@-10000 extent:20000@20000)]. ^subCanvas. !
1
0
0
0
The Trunk: MorphicExtras-nice.98.mcz
by commits@source.squeak.org
29 Dec '10
29 Dec '10
Nicolas Cellier uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-nice.98.mcz
==================== Summary ==================== Name: MorphicExtras-nice.98 Author: nice Time: 29 December 2010, 4:18:13.421 pm UUID: a61e9f05-6a6f-4590-a274-18423b8336f5 Ancestors: MorphicExtras-cmm.97 Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling. =============== Diff against MorphicExtras-cmm.97 =============== Item was changed: ----- Method: FlapTab>>fitContents (in category 'misc') ----- fitContents self isCurrentlyTextual ifFalse: [^ super fitContents]. self ifVertical: + [self extent: submorphs first extent + (2 * self borderWidth) + (0 @ 4). + submorphs first position: self position + self borderWidth + (1 @ 4)] - [self extent: submorphs first extent + (2 * self borderWidth) + (0@4). - submorphs first position: self position + self borderWidth + (1@4)] ifHorizontal: + [self extent: submorphs first extent + (2 * self borderWidth) + (8 @ -1). + submorphs first position: self position + self borderWidth + (5 @ 1)]! - [self extent: submorphs first extent + (2 * self borderWidth) + (8@-1). - submorphs first position: self position + self borderWidth + (5@1)]! Item was changed: ----- Method: PaintBoxMorph>>fixUpColorPicker (in category 'recent colors') ----- fixUpColorPicker | chart picker | + chart := ColorChart ifNil: [ColorChart := Cursor wait showWhile: [(ColorPickerMorph colorPaletteForDepth: 16 extent: 120 @ 89)]]. - chart := ColorChart ifNil:[Cursor wait showWhile:[ColorChart := (ColorPickerMorph colorPaletteForDepth: 16 extent: 120@89)]]. chart getCanvas frameRectangle: chart boundingBox color: Color black. + picker := Form extent: (chart extent + (14 @ 12)) depth: 16. - picker := Form extent: (chart extent + (14@12)) depth: 16. picker fillWhite. "top" + picker copy: (0 @ 0 extent: picker width @ 6) + from: (colorMemory image width - picker width) @ 0 - picker copy: (0@0 extent: picker width@6) - from: (colorMemory image width - picker width)@0 in: colorMemory image rule: Form over. "bottom" + picker copy: (0 @ (picker height - 6) extent: picker width @ 6) + from: (colorMemory image width - picker width) @ (colorMemory image height - 7) - picker copy: (0@ (picker height-6) extent: picker width@6) - from: (colorMemory image width - picker width)@(colorMemory image height - 7) in: colorMemory image rule: Form over. "left" + picker copy: (0 @ 6 corner: 8 @ (picker height - 6)) + from: (colorMemory image boundingBox topLeft + (0 @ 6)) - picker copy: (0@6 corner: 8@(picker height - 6)) - from: (colorMemory image boundingBox topLeft + (0@6)) in: colorMemory image rule: Form over. "right" + picker copy: (picker width-6 @ 6 corner: picker width @ (picker height - 6)) + from: (colorMemory image boundingBox topRight - (6 @ -6)) - picker copy: (picker width-6@6 corner: picker width@(picker height - 6)) - from: (colorMemory image boundingBox topRight - (6@-6)) in: colorMemory image rule: Form over. + chart displayOn: picker at: 8 @ 6. - chart displayOn: picker at: 8@6. picker getCanvas frameRectangle: picker boundingBox color: Color black. colorMemory image: picker. ! Item was changed: ----- Method: PaintBoxMorph>>init4 (in category 'initialization') ----- init4 "Just a record of how Ted loaded in the paintbox button images, Feb 98" + | bb im pp newImage pic24Bit picNewBit blt | - | bb im pp newImage pic24Bit picNewBit blt | + "self loadoffImage: 'roundedPalette3.bmp'." + pic24Bit := GIFReadWriter formFromServerFile: 'updates/137roundedPalette3.bmp'. + picNewBit := Form extent: pic24Bit extent depth: 16. + pic24Bit displayOn: picNewBit. + OriginalBounds := picNewBit boundingBox. + AllOffImage := Form extent: OriginalBounds extent depth: 16. + blt := BitBlt current toForm: AllOffImage. + blt sourceForm: picNewBit; combinationRule: Form over; + sourceRect: OriginalBounds; destOrigin: 0 @ 0; copyBits. - "self loadoffImage: 'roundedPalette3.bmp'." - pic24Bit := GIFReadWriter formFromServerFile: 'updates/137roundedPalette3.bmp'. - picNewBit := Form extent: pic24Bit extent depth: 16. - pic24Bit displayOn: picNewBit. - OriginalBounds := picNewBit boundingBox. - AllOffImage := Form extent: OriginalBounds extent depth: 16. - blt := BitBlt current toForm: AllOffImage. - blt sourceForm: picNewBit; combinationRule: Form over; - sourceRect: OriginalBounds; destOrigin: 0@0; copyBits. + AllOffImage mapColor: Color transparent to: Color black. + self image: AllOffImage. + self invalidRect: bounds. - AllOffImage mapColor: Color transparent to: Color black. - self image: AllOffImage. - self invalidRect: bounds. + self submorphsDo: [:button | button position: button position + (10 @ 10)]. + (im := submorphs at: 28) class == ImageMorph ifTrue: [ + im position: im position + (2 @ 0)]. "color picker" + "exercise it once" - self submorphsDo: [:button | button position: button position + (10@10)]. - (im := submorphs at: 28) class == ImageMorph ifTrue: [ - im position: im position + (2@0)]. "color picker" - "exercise it once" + (bb := self submorphNamed: #keep:) position: bb position + (0 @ 25). + (bb := self submorphNamed: #toss:) position: bb position + (0 @ 25). + (bb := self submorphNamed: #undo:) position: bb position + (0 @ -25). + (bb := self submorphNamed: #clear:) position: bb position + (0 @ -25). + (bb := self submorphNamed: #undo:) position: bb position + (0 @ -69). + (bb := self submorphNamed: #clear:) position: bb position + (0 @ -69). + self submorphsDo: [:button | + button class == AlignmentMorph ifTrue: [ + button position: button position + (0 @ 25)]. + (button printString includesSubString: 'stamp:') ifTrue: [ + button position: button position + (0 @ 25)]]. + (bb := self submorphNamed: #prevStamp:) position: bb position + (0 @ 25). + (bb := self submorphNamed: #nextStamp:) position: bb position + (0 @ 25). - (bb := self submorphNamed: #keep:) position: bb position + (0@25). - (bb := self submorphNamed: #toss:) position: bb position + (0@25). - (bb := self submorphNamed: #undo:) position: bb position + (0@-25). - (bb := self submorphNamed: #clear:) position: bb position + (0@-25). - (bb := self submorphNamed: #undo:) position: bb position + (0@-69). - (bb := self submorphNamed: #clear:) position: bb position + (0@-69). - self submorphsDo: [:button | - button class == AlignmentMorph ifTrue: [ - button position: button position + (0@25)]. - (button printString includesSubString: 'stamp:') ifTrue: [ - button position: button position + (0@25)]]. - (bb := self submorphNamed: #prevStamp:) position: bb position + (0@25). - (bb := self submorphNamed: #nextStamp:) position: bb position + (0@25). + bb := self submorphNamed: #keep:. + newImage := bb pressedImage copy: (0 @ 4 corner: (bb pressedImage boundingBox extent)). + bb onImage: newImage. bb pressedImage: newImage. bb extent: newImage extent. + bb position: bb position + (4 @ 1). - bb := self submorphNamed: #keep:. - newImage := bb pressedImage copy: (0@4 corner: (bb pressedImage boundingBox extent)). - bb onImage: newImage. bb pressedImage: newImage. bb extent: newImage extent. - bb position: bb position + (4@1). + pp := (bb := self submorphNamed: #toss:) pressedImage. + newImage := pp copy: (0 @ 4 corner: (bb pressedImage extent - (3 @ 0))). + bb onImage: newImage. bb pressedImage: newImage. + bb extent: newImage extent. + bb position: bb position + (3 @ 1). - pp := (bb := self submorphNamed: #toss:) pressedImage. - newImage := pp copy: (0@4 corner: (bb pressedImage extent - (3@0))). - bb onImage: newImage. bb pressedImage: newImage. - bb extent: newImage extent. - bb position: bb position + (3@1). + pp := (bb := self submorphNamed: #undo:) pressedImage. + newImage := pp copy: (0 @ 0 corner: (bb pressedImage extent - (3 @ 5))). + bb onImage: newImage. bb pressedImage: newImage. + bb extent: newImage extent. + bb position: bb position + (3 @ -1). - pp := (bb := self submorphNamed: #undo:) pressedImage. - newImage := pp copy: (0@0 corner: (bb pressedImage extent - (3@5))). - bb onImage: newImage. bb pressedImage: newImage. - bb extent: newImage extent. - bb position: bb position + (3@-1). + pp := (bb := self submorphNamed: #clear:) pressedImage. + newImage := pp copy: (0 @ 0 corner: (bb pressedImage extent - (0 @ 5))). + bb onImage: newImage. bb pressedImage: newImage. + bb extent: newImage extent. + bb position: bb position + (3 @ -1). - pp := (bb := self submorphNamed: #clear:) pressedImage. - newImage := pp copy: (0@0 corner: (bb pressedImage extent - (0@5))). - bb onImage: newImage. bb pressedImage: newImage. - bb extent: newImage extent. - bb position: bb position + (3@-1). + pic24Bit := GIFReadWriter formFromServerFile: 'updates/137pencil.bmp'. + picNewBit := Form extent: pic24Bit extent depth: 16. + pic24Bit displayOn: picNewBit. + newImage := picNewBit as8BitColorForm. + newImage transparentColor: (Color r: 0 g: 0 b: 0). + (bb := self submorphNamed: #erase:) pressedImage: newImage; onImage: newImage; + extent: newImage extent. - pic24Bit := GIFReadWriter formFromServerFile: 'updates/137pencil.bmp'. - picNewBit := Form extent: pic24Bit extent depth: 16. - pic24Bit displayOn: picNewBit. - newImage := picNewBit as8BitColorForm. - newImage transparentColor: (Color r: 0 g: 0 b: 0). - (bb := self submorphNamed: #erase:) pressedImage: newImage; onImage: newImage; - extent: newImage extent. + bb position: bb position + (-11 @ -1). - bb position: bb position + (-11@-1). ! Item was changed: ----- Method: PianoKeyboardMorph>>buildKeyboard (in category 'simple keyboard') ----- buildKeyboard | wtWid bkWid keyRect octavePt nWhite nBlack | self removeAllMorphs. wtWid := 8. bkWid := 5. + self extent: 10 @ 10. + 1 to: nOctaves + 1 do: - self extent: 10@10. - 1 to: nOctaves+1 do: [:i | i <= nOctaves ifTrue: [nWhite := 7. nBlack := 5] ifFalse: [nWhite := 1. nBlack := 0 "High C"]. + octavePt := self innerBounds topLeft + ((7 * wtWid * (i - 1) - 1) @ -1). - octavePt := self innerBounds topLeft + ((7*wtWid*(i-1)-1)@-1). 1 to: nWhite do: + [:j | keyRect := octavePt + (j - 1 * wtWid @ 0) extent: (wtWid + 1) @ 36. - [:j | keyRect := octavePt + (j-1*wtWid@0) extent: (wtWid+1)@36. self addMorph: ((RectangleMorph newBounds: keyRect color: whiteKeyColor) borderWidth: 1; on: #mouseDown send: #mouseDownPitch:event:noteMorph: to: self + withValue: i - 1 * 12 + (#(1 3 5 6 8 10 12) at: j))]. - withValue: i-1*12 + (#(1 3 5 6 8 10 12) at: j))]. 1 to: nBlack do: + [:j | keyRect := octavePt + ((#(6 15 29 38 47) at: j) @ 1) extent: bkWid @ 21. - [:j | keyRect := octavePt + ((#(6 15 29 38 47) at: j)@1) extent: bkWid@21. self addMorph: ((Morph newBounds: keyRect color: blackKeyColor) on: #mouseDown send: #mouseDownPitch:event:noteMorph: to: self + withValue: i - 1 * 12 + (#(2 4 7 9 11) at: j))]]. - withValue: i-1*12 + (#(2 4 7 9 11) at: j))]]. self submorphsDo: [:m | m on: #mouseMove send: #mouseMovePitch:event:noteMorph: to: self; on: #mouseUp send: #mouseUpPitch:event:noteMorph: to: self; on: #mouseEnterDragging send: #mouseDownPitch:event:noteMorph: to: self; on: #mouseLeaveDragging send: #mouseUpPitch:event:noteMorph: to: self]. self extent: (self fullBounds extent + borderWidth - 1)! Item was changed: ----- Method: PostscriptDummyWarp>>subCanvas: (in category 'dummy') ----- subCanvas:patchRect subCanvas ifNil: + [ subCanvas := PostscriptCanvas new reset setOrigin:patchRect topLeft clipRect: (-10000 @ -10000 extent: 20000 @ 20000)]. - [ subCanvas := PostscriptCanvas new reset setOrigin:patchRect topLeft clipRect:(-10000@-10000 extent:20000@20000)]. ^subCanvas. !
1
0
0
0
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: 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
← Newer
1
2
3
4
5
6
7
...
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