Unexpected scrollbarDrag message

Alex Tweedly alex at tweedly.net
Wed May 22 20:13:44 EDT 2013


I think it's behaving as intended (however strange that may be).
Note - there is no need to have any scrollbars anywhere to have 
scrollbardrag messages generated.

The key part (in the docs) is perhaps
> Summary:
> Sent to a field, scrollbar, or group when the user drags the scrollbar 
> thumb or when a text selection causes a field to scroll.

Create a new stack, card with only one field (no scrollbar associated 
with it), and add some suitable script to the card, like

on scrollbardrag
    put "drag" && the millisecs &CR after msg
end scrollbardrag

and click in the field - nothing happens.
But either typing a CR into the field, or enough chars to cause a 
horizontal shift, and a scrollbardrag message is generated.

Then make the field very slightly less tall - and now simply clicking in 
the field causes a tiny scroll because the insertion cursor is being put 
in the field. And that generates a 'scrollbardrag' which is picked up by 
the handler in the card script. I prsume that because it is generated 
*from* the field, it wouldn't be seen by a handler attached to the field 
itself (to avoid possible recursion ??)

-- Alex.

On 22/05/2013 23:32, Peter Haworth wrote:
> I have a card with a number of slider scrollbars on it and a scrollbarDrag
> handler in the card script to deal what happens when any of the sliders are
> moved.  I also have a field associated with each scrollbar which receives
> the thumbpos of its associated slider.  All that works fine
>
> However, if I click into the slider value field, my card level
> scrollbardrag message is triggered with a value of 1.  I also see that the
> message is coming from the value field.
>
> If I get rid of the scrollbardrag message at the card level and put it into
> the script of each individual slider, the problem goes away.  If I put a
> scrollbardrag handler into the script of the value fields, it is triggered
> as soon as I click into the field.
>
> The value fields do not have any scrollbars enabled, do not have a behavior
> script, and there are no other scripts in the messagepath between them and
> the card.
>
> I'm sure this is not an intended behavior?
>
>
> Pete
> lcSQL Software <http://www.lcsql.com>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list