[etoys-dev] Etoys: Morphic-bf.24.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Jun 24 09:22:28 EDT 2010
Bert Freudenberg uploaded a new version of Morphic to project Etoys:
http://source.squeak.org/etoys/Morphic-bf.24.mcz
==================== Summary ====================
Name: Morphic-bf.24
Author: bf
Time: 24 June 2010, 3:21:23 pm
UUID: dbbb87cc-14c4-4f4c-8e9f-c29d47299e43
Ancestors: Morphic-Richo.23
- like dragging with the right mousebutton, resize if the control key is pressed
=============== Diff against Morphic-Richo.23 ===============
Item was changed:
----- Method: HaloMorph>>mouseMove: (in category 'event handling') -----
mouseMove: evt
+ "Drag our target around or resize it"
+ growingOrRotating
+ ifTrue: [
+ | newExtent |
+ newExtent := originalExtent + evt position - positionOffset.
+ (newExtent x > 1 and: [newExtent y > 1])
+ ifTrue: [ target renderedMorph setExtentFromHalo: newExtent]]
+ ifFalse: [
+ | thePoint |
+ thePoint := target point: (evt position - positionOffset) from: owner.
+ target setConstrainedPosition: thePoint hangOut: true.
+ ]!
- "Drag our target around"
- | thePoint |
- thePoint _ target point: (evt position - positionOffset) from: owner.
- target setConstrainedPosition: thePoint hangOut: true.!
Item was changed:
----- Method: HaloMorph>>dragTarget: (in category 'events') -----
dragTarget: event
"Begin dragging the target"
| thePoint |
+ event controlKeyPressed ifTrue: [^self growTarget: event].
+ growingOrRotating := false.
innerTarget aboutToBeBrownDragged.
self setProperty: #conclusionSelector toValue: #brownDragConcluded.
thePoint _ target point: event position - positionOffset from: owner.
target setConstrainedPosition: thePoint hangOut: true.
event hand newMouseFocus: self!
Item was changed:
----- Method: Morph>>handleMouseDown: (in category 'events-processing') -----
handleMouseDown: anEvent
"System level event handling."
anEvent wasHandled ifTrue:[^self]. "not interested"
anEvent hand removePendingBalloonFor: self.
anEvent hand removePendingHaloFor: self.
anEvent wasHandled: true.
(anEvent controlKeyPressed
+ and: [anEvent blueButtonChanged not
+ and: [Preferences cmdGesturesEnabled]])
- and: [Preferences cmdGesturesEnabled])
ifTrue: [^ self invokeMetaMenu: anEvent].
"Make me modal during mouse transitions"
anEvent hand newMouseFocus: self event: anEvent.
anEvent blueButtonChanged ifTrue:[^self blueButtonDown: anEvent].
"this mouse down could be the start of a gesture, or the end of a gesture focus"
(self isGestureStart: anEvent)
ifTrue: [^ self gestureStart: anEvent].
self mouseDown: anEvent.
anEvent hand removeHaloFromClick: anEvent on: self.
(self handlesMouseStillDown: anEvent) ifTrue:[
self startStepping: #handleMouseStillDown:
at: Time millisecondClockValue + self mouseStillDownThreshold
arguments: {anEvent copy resetHandlerFields}
stepTime: self mouseStillDownStepRate ].
!
Item was added:
+ ----- Method: HaloMorph>>growTarget: (in category 'events') -----
+ growTarget: event
+ "Begin resizing the target"
+ growingOrRotating := true.
+ positionOffset := event position.
+ originalExtent := target extent.
+ self removeAllHandlesBut: nil.
+ event hand newMouseFocus: self.
+ event hand addMouseListener: self. "add handles back on mouse-up"!
More information about the etoys-dev
mailing list