[squeak-dev] The Trunk: EToys-mt.429.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Mar 2 10:45:42 UTC 2021
Marcel Taeumel uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-mt.429.mcz
==================== Summary ====================
Name: EToys-mt.429
Author: mt
Time: 2 March 2021, 11:45:35.238687 am
UUID: ef67f837-252c-6b4d-a9ff-b543b854da2a
Ancestors: EToys-mt.428
Complements Morphic-mt.1731
=============== Diff against EToys-mt.428 ===============
Item was changed:
----- Method: PasteUpMorph>>backgroundForm (in category '*Etoys-playfield') -----
backgroundForm
^ self backgroundSketch
ifNil: [Form extent: self extent depth: Display depth]
+ ifNotNil: [:sketch | sketch form]!
- ifNotNil: [backgroundMorph form]!
Item was added:
+ ----- Method: PasteUpMorph>>backgroundGridMorph (in category '*Etoys-playfield-gridding') -----
+ backgroundGridMorph
+
+ ^ self valueOfProperty: #backgroundGridMorph!
Item was added:
+ ----- Method: PasteUpMorph>>backgroundGridMorph: (in category '*Etoys-playfield-gridding') -----
+ backgroundGridMorph: aMorph
+
+ self setProperty: #backgroundGridMorph toValue: aMorph.!
Item was added:
+ ----- Method: PasteUpMorph>>backgroundMorph (in category '*Etoys-playfield') -----
+ backgroundMorph
+
+ ^ self valueOfProperty: #backgroundMorph!
Item was added:
+ ----- Method: PasteUpMorph>>backgroundMorph: (in category '*Etoys-playfield') -----
+ backgroundMorph: aMorph
+
+ self setProperty: #backgroundMorph toValue: aMorph.!
Item was changed:
----- Method: PasteUpMorph>>backgroundSketch (in category '*Etoys-playfield') -----
backgroundSketch
+ self backgroundMorph ifNil: [^ nil].
+ self backgroundMorph owner == self ifFalse:
+ [self backgroundMorph: nil]. "has been deleted"
+ ^ self backgroundMorph!
- backgroundMorph ifNil: [^ nil].
- backgroundMorph owner == self ifFalse:
- [backgroundMorph := nil]. "has been deleted"
- ^ backgroundMorph!
Item was changed:
----- Method: PasteUpMorph>>backgroundSketch: (in category '*Etoys-playfield') -----
backgroundSketch: aSketchMorphOrNil
"Set the receiver's background graphic as indicated. If nil is supplied, remove any existing background graphic. In any case, delete any preexisting background graphic."
+ self backgroundMorph ifNotNil: [self backgroundMorph delete]. "replacing old background"
- backgroundMorph ifNotNil: [backgroundMorph delete]. "replacing old background"
+ aSketchMorphOrNil ifNil: [self backgroundMorph: nil. ^ self].
- aSketchMorphOrNil ifNil: [backgroundMorph := nil. ^ self].
+ self backgroundMorph: (StickySketchMorph new form: aSketchMorphOrNil form).
+ self backgroundMorph position: aSketchMorphOrNil position.
+ self addMorphBack: self backgroundMorph.
- backgroundMorph := StickySketchMorph new form: aSketchMorphOrNil form.
- backgroundMorph position: aSketchMorphOrNil position.
- self addMorphBack: backgroundMorph.
aSketchMorphOrNil delete.
+ self backgroundMorph lock.
+ self backgroundMorph disableLayout: true.
+ self backgroundMorph setProperty: #shared toValue: true.
+ self backgroundMorph morphicLayerNumber: self class backmostLayer.
+ ^ self backgroundMorph
- backgroundMorph lock.
- backgroundMorph setProperty: #shared toValue: true.
- ^ backgroundMorph
!
Item was changed:
----- Method: PasteUpMorph>>deleteBackgroundPainting (in category '*Etoys-playfield') -----
deleteBackgroundPainting
+ self backgroundMorph
- backgroundMorph
ifNotNil:
+ [self backgroundMorph delete.
+ self backgroundMorph: nil]
- [backgroundMorph delete.
- backgroundMorph := nil]
ifNil:
[self inform: 'There is presently no
background painting
to delete.' translated]!
Item was added:
+ ----- Method: PasteUpMorph>>gridVisible (in category '*Etoys-playfield-gridding') -----
+ gridVisible
+
+ ^ self hasProperty: #gridVisible!
Item was added:
+ ----- Method: PasteUpMorph>>gridVisibleOnOff (in category '*Etoys-playfield-gridding') -----
+ gridVisibleOnOff
+
+ self setProperty: #gridVisible toValue: self gridVisible not.
+
+ self backgroundGridMorph ifNotNil: [:morph | morph delete].
+
+ self gridVisible ifFalse: [self backgroundGridMorph: nil. ^ self].
+
+ self backgroundGridMorph: (Morph new
+ fillStyle: (self
+ gridFormOrigin: self gridOrigin grid: self gridModulus
+ background: nil line: Color lightGray);
+ lock;
+ disableLayout: true; "The morphs itself visualizes the origin."
+ ownerChangedHandler: [:m | m bounds: m owner bounds];
+ morphicLayerNumber: self class backmostLayer - 1).
+
+ self addMorph: self backgroundGridMorph.!
Item was added:
+ ----- Method: PasteUpMorph>>gridVisibleString (in category '*Etoys-playfield-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 added:
+ ----- Method: PasteUpMorph>>griddingOn (in category '*Etoys-playfield-gridding') -----
+ griddingOn
+
+ ^ self layoutPolicy notNil and: [self layoutPolicy isGridLayout]!
Item was added:
+ ----- Method: PasteUpMorph>>griddingOnOff (in category '*Etoys-playfield-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 added:
+ ----- Method: PasteUpMorph>>griddingString (in category '*Etoys-playfield-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 added:
+ ----- Method: PasteUpMorph>>setGridSpec (in category '*Etoys-playfield-gridding') -----
+ setGridSpec
+ "Gridding rectangle provides origin and modulus"
+ | response result |
+ response := UIManager default
+ request: 'New grid origin (usually 0 at 0):' translated
+ initialAnswer: self gridOrigin printString.
+ response isEmpty ifTrue: [^ self].
+ result := [Compiler evaluate: response] ifError: [^ self].
+ (result isPoint and: [(result >= (0 at 0))])
+ ifTrue: [self gridOrigin: result]
+ ifFalse: [self inform: ('Must be a Point with coordinates (for example 10 at 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 at 0)) ])
+ ifTrue: [self gridModulus: result]
+ ifFalse: [self inform: ('Must be a Point with coordinates (for example 10 at 10)' translated )].
+
+ !
More information about the Squeak-dev
mailing list
|