Something like this in the picture object:
C_LONGINT($mx;$my;startX;startY)
GET MOUSE($mx;$my;$mb)
Case of 
: (Form event=On Clicked)
startX:=$mx
startY:=$my

: (Form event=On Mouse Move)
If ($mb=1)
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 case 


Keith - CDI
> On Oct 20, 2016, at 2:58 PM, truegold <[email protected]> wrote:
> 
> Hey All,
> 
> So it looks like…
> 
> will need to manipulate various sets of coords:
> 
> 1. picture coords holding svg (need width and height)
> 2. scroll position of each scrollbar (OBJECT GET SCROLL POSITION) 
> 3. mouse coordinates of where I am in picture (GET MOUSE)
> 4. relative coords inside svg image (so I know how much can be moved…)
> 
> A bit of work but doable. Anyone already done it?
> 
> Code snippets?
> 
> Thanks,
> John...
> 
>> Hey Keith,
>> 
>> Ahh, as the doc says “... even the pixels of a picture”
>> 
>> This might work.
>> 
>> I’ll see if I can get it to work.
>> 
>> Appreciate,
>> John...
>> 
>>> I think the easiest option would be to use OBJECT SET SCROLL POSITION ( * ; 
>>> object {; vPosition {; hPosition}}{; *} ) once the picture has been created.
>> 
>>>> Hi All,
>>>> 
>>>> 4D 15.2 (mac and windows).
>>>> 
>>>> I would like to implement a scrolling technique in an SVG picture 
>>>> (diagram) on a form. Essentially I want to be able to move around my 
>>>> digram by holding the space bar + mouse down. So as I move the mouse 
>>>> around the the page it scrolls horizontal and vertically. I’d like to use 
>>>> the “native” 4D SVG plugin commands.
>>>> 
>>>> Has anyone implemented?
>>>> 
>>>> Ideas? Code sample?
>>>> 
>>>> Thanks,
>>>> 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]
> **********************************************************************

**********************************************************************
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]
**********************************************************************

Reply via email to