Hey Keith (et al),
Hmmm “... TRANSFORM PICTURE …” hadn’t though about that.
(For posterity) Using 'Translate’ as the operator the docs say: The picture is
moved by param1 pixels horizontally and by param2 pixels vertically. Pass a
positive value to move to the right or towards the bottom and a negative value
to move to the left or towards the top.
I’ll give it a go.
I’ve been trolling through the docs: 'User Interface' and found:
Caps lock down
Shift down
Macintosh command down
Macintosh control down
Macintosh option down
Windows Alt down
Windows Ctrl down
But I can’t seem to find which 4D command, if any, returns that the spacebar is
depressed? Or any key (other then above) for that matter? Maybe KeyCode and On
EVENT CALL? Maybe I’ll have to change character sequence?
Anything pop into your mind?
Appreciate,
John...
> 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
>
>
>> 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]
**********************************************************************