SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

Mantis - Squeak
Viewing Issue Advanced Details
6973 Morphic feature N/A 03-07-08 00:32 03-07-08 01:17
0006973: [Enh] better MouseMoveEvent interaction with a targetPoint
Context: When dragged by the mouse a target wishes to be moved but must remain within certain constraints. (for example the bounds of its owner.)

The problem: currently this is done by trying to having the target track the LOCATION of the cursor as the mouse moves. This means that if the constraint is reached the target will not track the cursor until the cursor returns within the contraints.

The solution: Have the target track the MOTION of the cursor, then apply the constraint.

The difference: the target responds immediately to new movements and seems to move freely and responsively (within its constraints) as the mouse moves.
Uploaded are


enhancements to MouseMoveEvent to add vocabulary to aid motion tracking.

related to 0002406closed tim Set cursor position primitive does not work and has not in some time. 
related to 0006594new  [Fix] [Enh] A better way to handle Balloon-Fill adjustments 
related to 0006975new  [RFE] Better event distictions between drag, click and mouse up. 
 MouseMoveEnh-wiz.4.cs [^] (8,784 bytes) 03-07-08 00:32

03-07-08 01:17   
From an off topic thread in 0002406 Bert wrote:

>Could you add a small morphic example demonstrating this? I can't quite imagine what you're trying to accomplish.

>I downloaded as suggested in 0006594 but could not find a #hasMoved method, or deltaVectors etc.

Ok. The point of the ramp and fill handles was to demonstrate the difference between the motion tracking and what squeak usually does which is cursor position tracking. A lot else is going on in those examples, but it does demonstrate the abiltity to move the target along a constrained track and to keep moving it even as the cursor and target get out of sync.

What I was trying for was that the target becomes the "cursor". Squeaks hand maintains a targetOffset but unless that is updated constantly it stops working as targets reach their constraints.
So rather than updating target offsets
1) let the target supply the initial position fresh each move and
2) let the event then return how that targetpoint would be moved. Then
3) apply the constraints to the moved-point and
4) reposition the target accordingly.


the method
#hasMoved is in the cs for completeness. MouseMoveEvents are generated frequently for timing and pacing reasons so often the events do not represent a real mouse move.

The #deltaVector method is the result of the first attempt at these changes. Further iterations made me settle on #moveAndTug: tagretpoint. I probably use that most often in my coding projects.