scrollerdidscroll, but WHAT has bee scrolled?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

scrollerdidscroll, but WHAT has bee scrolled?

Tore Nilsen via use-livecode
Hi friends,

this interesting question came up in the german LC forum.

If you have 2 native scrollers on a card, how do you differ in the
"scrollderdidscroll" handler WHICH one has been actually scrolled?
Know what i mean?

I would have exspected an appropriate parameter pContolID like in
"mobilecontroldo", but could not find anything in the dictionary
about "scrollerdidscroll".

Thaks for any hints!


Best

Klaus
--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: scrollerdidscroll, but WHAT has bee scrolled?

Tore Nilsen via use-livecode
From memory I think there is mobileControlTarget() function which is the equivalent of 'the target'.

Warmest Regards,

Mark.

Sent from my iPhone

> On 2 Jun 2018, at 13:04, Klaus major-k via use-livecode <[hidden email]> wrote:
>
> Hi friends,
>
> this interesting question came up in the german LC forum.
>
> If you have 2 native scrollers on a card, how do you differ in the
> "scrollderdidscroll" handler WHICH one has been actually scrolled?
> Know what i mean?
>
> I would have exspected an appropriate parameter pContolID like in
> "mobilecontroldo", but could not find anything in the dictionary
> about "scrollerdidscroll".
>
> Thaks for any hints!
>
>
> Best
>
> Klaus
> --
> Klaus Major
> http://www.major-k.de
> [hidden email]
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: scrollerdidscroll, but WHAT has bee scrolled?

Tore Nilsen via use-livecode
Hi Mark,

> Am 02.06.2018 um 15:29 schrieb Mark Waddingham via use-livecode <[hidden email]>:
>
> From memory I think there is mobileControlTarget() function which is the equivalent of 'the target'.

ah, yes, that's what I was looking for, thanks a bunch! :-)

> Warmest Regards,
>
> Mark.
>
> Sent from my iPhone
>
>> On 2 Jun 2018, at 13:04, Klaus major-k via use-livecode <[hidden email]> wrote:
>>
>> Hi friends,
>>
>> this interesting question came up in the german LC forum.
>>
>> If you have 2 native scrollers on a card, how do you differ in the
>> "scrollderdidscroll" handler WHICH one has been actually scrolled?
>> Know what i mean?
>>
>> I would have exspected an appropriate parameter pContolID like in
>> "mobilecontroldo", but could not find anything in the dictionary
>> about "scrollerdidscroll".

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

RE: scrollerdidscroll, but WHAT has bee scrolled?

Tore Nilsen via use-livecode
In reply to this post by Tore Nilsen via use-livecode
Klaus,

I name the scroller the same as the control it's scrolling. The
"scrollderdidscroll" is only sent to the stack that created it. If you have
a generic "create scroller" handler in a library stack then the
"scrollderdidscroll" message will only go to that stack. In the context of
"scrollderdidscroll" message "this stack" is the library stack. If you want
a truly generic scroller in a library stack then you would also have to put
the stack name into the control ID along with the LC control name and parse
it out in the "scrollderdidscroll" handler later. In my case there is only
one stack for the GUI so it's easy to know what the stack the control is in.
Here's my generic "scrollderdidscroll" I have this in a library stack(along
with generic scroller create handle).

on scrollerDidScroll hScrolled, vScrolled
   local ControlID
   
      put mobileControlTarget() into ControlID

      set the vscroll of control ControlID of stack "MainStackGUI" to
vscrolled
      set the hscroll of control ControlID of stack "MainStackGUI" to
hscrolled
     
   pass scrollerDidScroll
end scrollerDidScroll

Ralph DiMola
IT Director
Evergreen Information Services
[hidden email]

-----Original Message-----
From: use-livecode [mailto:[hidden email]] On Behalf
Of Klaus major-k via use-livecode
Sent: Saturday, June 02, 2018 8:05 AM
To: How to use LiveCode
Cc: Klaus major-k
Subject: scrollerdidscroll, but WHAT has bee scrolled?

Hi friends,

this interesting question came up in the german LC forum.

If you have 2 native scrollers on a card, how do you differ in the
"scrollderdidscroll" handler WHICH one has been actually scrolled?
Know what i mean?

I would have exspected an appropriate parameter pContolID like in
"mobilecontroldo", but could not find anything in the dictionary about
"scrollerdidscroll".

Thaks for any hints!


Best

Klaus
--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode