Emulate thumb drag on desktop

dunbarx at aol.com dunbarx at aol.com
Sun Aug 9 06:34:42 CEST 2015


Are you asking if there is a way to make the scroll of a field track the mouseLoc? If so, then you are right to use the "mouseMove" message, and scale the y-value of its included parameter to the vScroll of the field.

Or am I missing it?

Craig Newman

-----Original Message-----
From: Brahmanathaswami <brahma at hindu.org>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Sat, Aug 8, 2015 7:04 pm
Subject: Emulate thumb drag on desktop

To scroll a field on mobile I'm going to try this:

on createQuoteScroller
local tScrollerRect,tContentRect,sScrollerID
    if environment() is not
"mobile" then exit createQuoteScroller
    mobileControlCreate "scroller",
    put the result into sScrollerID
    put the rect of fld
"quote" into tScrollerRect
    put the topleft of fld "scrollMe" & "," & the
right of fld 
"scrollme"&","&( the top of fld "scrollme" + the formattedHeight
of fld 
"scrollme") into tContentRect
    mobileControlSet "quoteScroller",
"rect", tScrollerRect
    mobileControlSet "quoteScroller", "contentRect",
    mobileControlSet "quoteScroller", "visible", true
mobileControlSet "quoteScroller", "scrollingEnabled", true
"quoteScroller", "vIndicator", true
    mobileControlSet "quoteScroller",
"vscroll", 0
end createQuoteScroller

on scrollerDidScroll hOffset, vOffset

// When the user scrolls move the displayed content
    set the vScroll of fld
"quote" to vOffset
end scrollerDidScroll

but how do we emulate this with the

on mouseMove

end mouseMove

would seem to be our best tool

how to translate the mouseloc into vScroll of the field?

on mouseMove
put the mouseloc
end mouseMove

have to sleep on that one... but perhaps
someone else already build


mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe,
unsubscribe and manage your subscription


More information about the use-livecode mailing list