A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-jar.1376.mcz
==================== Summary ====================
Name: Kernel-jar.1376
Author: jar
Time: 28 February 2021, 7:58:42.007459 pm
UUID: d063e740-7836-a94a-9796-488741d2b2b6
Ancestors: Kernel-codefrau.1374
Fix Process >> #isTerminated inconsistent behavior - for discussion
=============== Diff against Kernel-codefrau.1374 ===============
Item was changed:
----- Method: Process>>isTerminated (in category 'testing') -----
isTerminated
"Answer if the receiver is terminated, or at least terminating."
self isActiveProcess ifTrue: [^ false].
^suspendedContext isNil
+ or: ["If the suspendedContext is the bottomContext and the pc is at the endPC,
+ then there is nothing more to do."
- or: ["If the suspendedContext is the bottomContext it is the block in Process>>newProcess.
- If so, and the pc is at the endPC, the block has already sent and returned
- from value and there is nothing more to do."
suspendedContext isBottomContext
+ and: [suspendedContext pc >= suspendedContext endPC
+ or: [suspendedContext closure
- and: [suspendedContext closure
ifNil: [suspendedContext methodClass == Process
and: [suspendedContext selector == #terminate]]
+ ifNotNil: [false]]]]!
- ifNotNil: [suspendedContext pc >= suspendedContext closure endPC]]]!
Christoph Thiede uploaded a new version of Morphic to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1732.mcz
==================== Summary ====================
Name: Morphic-ct.1732
Author: ct
Time: 2 March 2021, 2:36:32.90317 pm
UUID: 3670c695-6c43-d744-b2d7-03ac4e6217e8
Ancestors: Morphic-mt.1731
Updates description of #sendMouseWheelToKeyboardFocus preference. Reason: Since Windows 10, the MouseWheelRouting setting is enabled by default.
=============== Diff against Morphic-mt.1731 ===============
Item was changed:
----- Method: HandMorph class>>sendMouseWheelToKeyboardFocus (in category 'preferences') -----
sendMouseWheelToKeyboardFocus
<preference: 'Send Mouse Wheel Events to Keyboard Focus'
categoryList: #(Morphic keyboard mouse)
+ description: 'If enabled, follow the behavior known from older versions of Microsoft Windows, where the mouse wheel works for the widget that has the keyboard focus. If disabled, follow the Mac OS style, where the mouse wheel is send to the widget under the mouse position.'
- description: 'If enabled, follow the behavior known from Microsoft Windows, where the mouse wheel works for the widget that has the keyboard focus. If disabled, follow the Mac OS style, where the mouse wheel is send to the widget under the mouse position'
type: #Boolean>
^ SendMouseWheelToKeyboardFocus ifNil: [true]!
Christoph Thiede uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-ct.1220.mcz
==================== Summary ====================
Name: System-ct.1220
Author: ct
Time: 2 March 2021, 2:06:08.80617 pm
UUID: cf9872fd-fa5d-4bb6-bc1c-8ced48a02a48
Ancestors: System-mt.1219
Adds Jaromir Matas (jar) to the authors list. A late welcome aboard! :-)
=============== Diff against System-mt.1219 ===============
Item was changed:
----- Method: SystemNavigation class>>privateAuthorsRaw (in category 'class initialization') -----
(excessive size, no diff calculated)
Item was changed:
+ (PackageInfo named: 'System') postscript: 'SystemNavigation initializeAuthors.......'!
- (PackageInfo named: 'System') postscript: 'SystemNavigation initializeAuthors......'!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1731.mcz
==================== Summary ====================
Name: Morphic-mt.1731
Author: mt
Time: 2 March 2021, 11:44:21.476687 am
UUID: d06129c7-0def-1645-9066-c8a5720bf5d2
Ancestors: Morphic-mt.1730
Adds the possibility to handle #ownerChanged through composition (instead of subclassing/overwriting). Note that #cull: also works with symbols and message sends, not just blocks. :-) Got inspired by #eventHandler and how #mouseDown: (etc.) is implemented in Morph.
Use it to extract Etoys-specific background morph and grid.
=============== Diff against Morphic-mt.1730 ===============
Item was changed:
+ ----- Method: Morph>>ownerChanged (in category 'layout') -----
- ----- Method: Morph>>ownerChanged (in category 'change reporting') -----
ownerChanged
"This morph's owner has changed its geometry and is about to update its layout. This is a simple layout hook to update this morph's geometry according to its owner.
For more advanced strategies, use a LayoutPolicy with some LayoutProperties. See #layoutPolicy: and maybe also #doLayoutIn:."
+ self snapToEdgeIfAppropriate.
+
+ self ownerChangedHandler
+ ifNotNil: [:handler | handler cull: self].!
- self snapToEdgeIfAppropriate.!
Item was added:
+ ----- Method: Morph>>ownerChangedHandler (in category 'layout') -----
+ ownerChangedHandler
+
+ ^ self valueOfProperty: #ownerChangedHandler!
Item was added:
+ ----- Method: Morph>>ownerChangedHandler: (in category 'layout') -----
+ ownerChangedHandler: aHandler
+
+ self
+ setProperty: #ownerChangedHandler
+ toValue: aHandler.
+
+ self layoutChanged.!
Item was changed:
----- Method: MorphicProject class>>applyUserInterfaceTheme (in category 'preferences') -----
applyUserInterfaceTheme
self current addDeferredUIMessage: [
"After all immediate changes where applied, we can reset to values that match the current world configuration:"
self worldGridOrigin: nil.
self worldGridModulus: nil.
+ self worldGridEnabled
- self current world griddingOn
ifTrue: [self current world firstHand turnOnGridding]].!
Item was changed:
----- Method: MorphicProject class>>worldGridEnabled (in category 'preferences') -----
worldGridEnabled
<preference: 'Snap Morphs to World Grid'
categoryList: #('Morphic' 'Tools')
description: 'When true, morphs placed in the world will align with a regular grid. This includes tool windows.'
type: #Boolean>
+
+ | world |
+ world := self current world.
+ ^ self current isMorphic and: [world layoutPolicy notNil and: [world layoutPolicy isGridLayout]]!
- ^ self current isMorphic and: [self current world griddingOn]!
Item was changed:
----- Method: MorphicProject class>>worldGridEnabled: (in category 'preferences') -----
worldGridEnabled: aBooleanOrNil
+ (aBooleanOrNil ifNil: [false])
+ ifTrue: [self current world layoutPolicy: GridLayout new]
+ ifFalse: [self current world layoutPolicy: nil].
- (aBooleanOrNil ifNil: [false]) = self current world griddingOn
- ifFalse: [self current world griddingOnOff].
"Auto-configure origin and modulus to match world properties."
self worldGridOrigin: nil.
self worldGridModulus: nil.
"Snap to grid when dragging something."
+ self worldGridEnabled
- self current world griddingOn
ifTrue: [self current world firstHand turnOnGridding]
ifFalse: [self current world firstHand turnOffGridding].!
Item was changed:
BorderedMorph subclass: #PasteUpMorph
+ instanceVariableNames: 'presenter model cursor padding turtleTrailsForm turtlePen lastTurtlePositions isPartsBin indicateCursor wantsMouseOverHalos worldState'
- instanceVariableNames: 'presenter model cursor padding backgroundMorph turtleTrailsForm turtlePen lastTurtlePositions isPartsBin indicateCursor wantsMouseOverHalos worldState'
classVariableNames: 'GlobalCommandKeysEnabled WindowEventHandler'
poolDictionaries: ''
category: 'Morphic-Worlds'!
!PasteUpMorph commentStamp: '<historical>' prior: 0!
A morph whose submorphs comprise a paste-up of rectangular subparts which "show through". Anything called a 'Playfield' is a PasteUpMorph.
Facilities commonly needed on pages of graphical presentations and on simulation playfields, such as the painting of new objects, turtle trails, gradient fills, background paintings, parts-bin behavior, collision-detection, etc., are (or will be) provided.
A World, the entire Smalltalk screen, is a PasteUpMorph. A World responds true to isWorld. Morph subclasses that have specialized menus (BookMorph) build them in the message addBookMenuItemsTo:hand:. A PasteUpMorph that is a world, builds its menu in HandMorph buildWorldMenu.
presenter A Presenter in charge of stopButton stepButton and goButton,
mouseOverHalosEnabled soundsEnabled fenceEnabled coloredTilesEnabled.
model <not used>
cursor ??
padding ??
backgroundMorph A Form that covers the background.
turtleTrailsForm Moving submorphs may leave trails on this form.
turtlePen Draws the trails.
lastTurtlePositions A Dictionary of (aPlayer -> aPoint) so turtle trails can be drawn
only once each step cycle. The point is the start of the current stroke.
isPartsBin If true, every object dragged out is copied.
autoLineLayout ??
indicateCursor ??
resizeToFit ??
wantsMouseOverHalos If true, simply moving the cursor over a submorph brings up its halo.
worldState If I am also a World, keeps the hands, damageRecorder, stepList etc.
griddingOn If true, submorphs are on a grid
!
Item was changed:
----- Method: PasteUpMorph>>drawOn: (in category 'drawing') -----
drawOn: aCanvas
"Draw in order:
- background color
- - grid, if any
- - background sketch, if any
- Update and draw the turtleTrails form. See the comment in updateTrailsForm.
- cursor box if any
Later (in drawSubmorphsOn:) I will skip drawing the background sketch."
"draw background fill"
super drawOn: aCanvas.
- "draw grid"
- (self griddingOn and: [self gridVisible])
- ifTrue:
- [aCanvas fillRectangle: self bounds
- fillStyle: (self
- gridFormOrigin: self gridOrigin
- grid: self gridModulus
- background: nil
- line: Color lightGray)].
-
- "draw background sketch."
- backgroundMorph ifNotNil: [
- self clipSubmorphs ifTrue: [
- aCanvas clipBy: self clippingBounds
- during: [ :canvas | canvas fullDrawMorph: backgroundMorph ]]
- ifFalse: [ aCanvas fullDrawMorph: backgroundMorph ]].
-
"draw turtle trails"
(lastTurtlePositions isNil or: [lastTurtlePositions isEmpty]) ifFalse:[
self updateTrailsForm.
].
turtleTrailsForm
ifNotNil: [aCanvas paintImage: turtleTrailsForm at: self position].
"draw cursor"
(submorphs notEmpty and: [self indicateCursor])
ifTrue:
[aCanvas
frameRectangle: self selectedRect
width: 2
color: Color black]!
Item was removed:
- ----- Method: PasteUpMorph>>drawSubmorphsOn: (in category 'painting') -----
- drawSubmorphsOn: aCanvas
- "Display submorphs back to front, but skip my background sketch."
-
- | drawBlock |
- submorphs isEmpty ifTrue: [^self].
- drawBlock := [:canvas | submorphs reverseDo: [:m | m ~~ backgroundMorph ifTrue: [ canvas fullDrawMorph: m ]]].
- self clipSubmorphs
- ifTrue: [aCanvas clipBy: self clippingBounds during: drawBlock]
- ifFalse: [drawBlock value: aCanvas]!
Item was removed:
- ----- Method: PasteUpMorph>>gridVisible (in category 'gridding') -----
- gridVisible
-
- ^ self hasProperty: #gridVisible!
Item was removed:
- ----- Method: PasteUpMorph>>gridVisibleOnOff (in category 'gridding') -----
- gridVisibleOnOff
-
- self setProperty: #gridVisible toValue: self gridVisible not.
- self changed!
Item was removed:
- ----- Method: PasteUpMorph>>gridVisibleString (in category 'gridding') -----
- gridVisibleString
- "Answer a string to be used in a menu offering the opportunity
- to show or hide the grid"
- ^ (self gridVisible
- ifTrue: ['<yes>']
- ifFalse: ['<no>'])
- , 'grid visible when gridding' translated!
Item was removed:
- ----- Method: PasteUpMorph>>griddingOn (in category 'gridding') -----
- griddingOn
-
- ^ self layoutPolicy notNil and: [self layoutPolicy isGridLayout]!
Item was removed:
- ----- Method: PasteUpMorph>>griddingOnOff (in category 'gridding') -----
- griddingOnOff
- "Change grid layout. Consider the #clearArea to ignore docking bars and other adhereing morphs."
-
- self layoutPolicy: (self griddingOn ifFalse: [GridLayout new]).!
Item was removed:
- ----- Method: PasteUpMorph>>griddingString (in category 'gridding') -----
- griddingString
- "Answer a string to use in a menu offering the user the
- opportunity to start or stop using gridding"
- ^ (self griddingOn
- ifTrue: ['<yes>']
- ifFalse: ['<no>'])
- , 'use gridding' translated!
Item was removed:
- ----- Method: PasteUpMorph>>privateRemoveMorph: (in category 'private') -----
- privateRemoveMorph: aMorph
- backgroundMorph == aMorph ifTrue: [ backgroundMorph := nil ].
- ^super privateRemoveMorph: aMorph.
- !
Item was removed:
- ----- Method: PasteUpMorph>>setGridSpec (in category 'gridding') -----
- setGridSpec
- "Gridding rectangle provides origin and modulus"
- | response result |
- response := UIManager default
- request: 'New grid origin (usually 0@0):' translated
- initialAnswer: self gridOrigin printString.
- response isEmpty ifTrue: [^ self].
- result := [Compiler evaluate: response] ifError: [^ self].
- (result isPoint and: [(result >= (0@0))])
- ifTrue: [self gridOrigin: result]
- ifFalse: [self inform: ('Must be a Point with coordinates (for example 10@10)' translated )].
-
- response := UIManager default
- request: 'New grid spacing:' translated
- initialAnswer: self gridModulus printString.
- response isEmpty ifTrue: [^ self].
- result := [Compiler evaluate: response] ifError: [^ self].
- (result isPoint and: [(result > (0@0)) ])
- ifTrue: [self gridModulus: result]
- ifFalse: [self inform: ('Must be a Point with coordinates (for example 10@10)' translated )].
-
- !
Marcel Taeumel uploaded a new version of MorphicTests to project The Trunk:
http://source.squeak.org/trunk/MorphicTests-mt.72.mcz
==================== Summary ====================
Name: MorphicTests-mt.72
Author: mt
Time: 2 March 2021, 11:03:22.265687 am
UUID: b86bc3c1-fdde-7343-9628-073d9dd73d70
Ancestors: MorphicTests-mt.71
More tests for the new grid layout.
=============== Diff against MorphicTests-mt.71 ===============
Item was changed:
----- Method: GridLayoutTest>>test01Position (in category 'tests') -----
test01Position
+ | m o |
- | m |
m := self addMorph.
+ o := container position.
{
0@0 . 0@0 .
9@9 . 0@0 .
10@10 . 20@20 .
25@25 . 20@20
} pairsDo: [:newPosition :expectedGrid |
+ m position: newPosition + o.
- m position: newPosition.
container fullBounds.
+ self assert: expectedGrid + o equals: m position].!
- self assert: expectedGrid equals: m position].!
Item was added:
+ ----- Method: GridLayoutTest>>test05SnapToEdge (in category 'tests') -----
+ test05SnapToEdge
+ "The grid should be ignored for morphs that snap to their owner's edges."
+
+ | m |
+ m := Morph new color: Color random; extent: 10@10; yourself.
+ container addMorph: m.
+
+ "1) Manual snap-to-edge will not work."
+ m position: 0@(100 - 10).
+ container fullBounds.
+ self assert: 0@100 equals: m position.
+
+ "2) Use snap-to-edge property."
+ m setToAdhereToEdge: #bottom.
+ container fullBounds.
+ self assert: 0@(100 - 10) equals: m position.!
Item was added:
+ ----- Method: GridLayoutTest>>test06Origin (in category 'tests') -----
+ test06Origin
+ "The grid's origin should be relative to its morph's position so that the morph can be moved around without the grid changing."
+
+ container position: 0@0.
+ container removeAllMorphs.
+ self test01Position.
+
+ container position: 10@10.
+ container removeAllMorphs.
+ self test01Position.!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1730.mcz
==================== Summary ====================
Name: Morphic-mt.1730
Author: mt
Time: 2 March 2021, 11:01:40.072687 am
UUID: 5fa729ff-1ebb-3a4e-8283-f88485971bd6
Ancestors: Morphic-mt.1729
A fix and a tweak.
(Note that it is interesting that damage-recording-based drawing via #changed and deferred layout computation via #layoutChanged are in conflict with each other. Also see #privateInvalidateMorph: and its senders.)
=============== Diff against Morphic-mt.1729 ===============
Item was changed:
----- Method: Morph>>position: (in category 'geometry') -----
position: aPoint
"Change the position of this morph, which is the top left corner of its bounds."
| delta box |
delta := (aPoint - self bounds topLeft) rounded.
"Skip drawing and layout updates for null changes."
(delta x = 0 and: [delta y = 0])
ifTrue: [^ self].
"Optimize drawing. Record one damage rectangle for short distance and two damage rectangles for large distances."
+ box := fullBounds ifNil: [self outerBounds]. "Avoid premature layout computation. Like in #extent: and #changed."
- box := self fullBounds.
(delta dotProduct: delta) > 100 "More than 10 pixels?"
ifTrue: [self
invalidRect: box;
invalidRect: (box translateBy: delta)]
ifFalse: [self
invalidRect: (box merge: (box translateBy: delta))].
"Move this morph and *all* of its submorphs."
self privateFullMoveBy: delta.
"For all known layout policies, my layout and the layout of my children is fine. Only the layout of my owner might be affected. So, tell about it."
self owner ifNotNil: [:o |
self flag: #todo. "mt: Maybe we can save a lot of effort and troubles by only calling #layoutChanged if the owner has a layout policy installed? Take the thumbs of scroll-bars as an example..."
o layoutChanged].!
Item was changed:
----- Method: Morph>>setToAdhereToEdge: (in category 'menus') -----
setToAdhereToEdge: anEdge
anEdge ifNil: [^ self].
anEdge == #none ifTrue: [^ self removeProperty: #edgeToAdhereTo].
self setProperty: #edgeToAdhereTo toValue: anEdge.
+ self layoutChanged.
!