Emulate thumb drag on desktop

dunbarx at aol.com dunbarx at aol.com
Sun Aug 9 00:34:42 EDT 2015


Hi.


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",
"quoteScroller"
    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",
tContentRect
    mobileControlSet "quoteScroller", "visible", true
   
mobileControlSet "quoteScroller", "scrollingEnabled", true
    mobileControlSet
"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
mouse?

on mouseMove

end mouseMove

would seem to be our best tool

but
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
this...

BR

_______________________________________________
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