Bert Freudenberg uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-bf.448.mcz ==================== Summary ==================== Name: Morphic-bf.448 Author: bf Time: 24 June 2010, 3:00:00.714 pm UUID: 858c2c78-7627-4795-bd81-aca5d1e03876 Ancestors: Morphic-ar.447 - when dragging after a ctrl-halo click, resize instead of move the target =============== Diff against Morphic-ar.447 =============== 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. 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. Preferences maintainHalos ifFalse:[ 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"! |
Free forum by Nabble | Edit this page |