Interesting problem. This solution feels klunky, but it sees the key down and
moves the picture.
Keith
==Picture object method ==
Case of
: (Form event=On Mouse Enter) // maybe jump to a special hidden field?
SET TIMER(1)
: (Form event=On Mouse Move)
vMMoved:=True
: (Form event=On Mouse Leave) // and go back to the old field
SET TIMER(0)
End case
==Form method ==
C_BOOLEAN(vMMoved)
C_LONGINT($mx;$my;startX;startY)
Case of
: (Form event=On Load)
$svg:=SVG_New
SVG_New_rect ($svg;10;10;1010;1010)
vPic:=SVG_Export_to_picture ($svg)
SVG_CLEAR ($svg)
startX:=0
startY:=0
: (Form event=On Timer)
$s:=Keystroke
FILTER KEYSTROKE("")
If ($s=" ")
If (vMMoved)
vMMoved:=False
GET MOUSE($mx;$my;$mb)
PICTURE PROPERTIES(vPic;$pw;$ph)
OBJECT GET COORDINATES(*;"vPic";$l;$t;$r;$b)
$nw:=$r-$l
$nh:=$b-$t
TRANSFORM PICTURE(vPic;Translate;$mx-startX*($nw/$pw);$my-startY*($nh/$ph))
startX:=$mx
startY:=$my
End if
End if
End case
> On Oct 21, 2016, at 6:41 PM, truegold <[email protected]> wrote:
>
> Hey Keith,
>
> Thanks for the code. I’ll give it a test run and see how it works.
>
> Appreciate,
> John...
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************