Drag-scrolling a group
Devin Asay
devin_asay at byu.edu
Thu Jul 11 14:28:13 EDT 2013
On Jul 11, 2013, at 12:10 PM, Roger Eller wrote:
> Can it be done math-free? If you nest a group inside the scrollable locked
> group, and set the nested group to a simple "grab me" in a mouseDown or
> mouseStillDown handler…
While I appreciate the math-free approach, ;) grab isn't the best tool here, because it lets you drag the group contents beyond the bounds you want to show. Setting the scroll values, on the other hand, prevents that problem.
BTW, in the meantime I discovered that lock screen fixes most of my problems:
on mouseMove pNewMouseH, pNewMouseV
if sDragging then
lock screen
set the hScroll of me to the hScroll of me - (pNewMouseH -sMouseH)
set the vScroll of me to the vScroll of me - (pNewMouseV - sMouseV)
unlock screen
end if
end mouseMove
I'm still interested in other people's solutions to this. I can't imagine I'm the only one who's ever tried this.
Devin
Devin Asay
Learn to code with LiveCode University
http://university.livecode.com
More information about the use-livecode
mailing list