"selectionChanged" handler in native scroller
Posted: Tue Jun 11, 2019 7:35 pm
I am having difficulty in capturing a selectionChanged message in an iOS native scrolling field, when it is locked. My handler works when there is not enough text in the field to need the scroller to activate scrolling (text not filling entire field rectangle), but when it does, even if I try using a scroll lock flag to exit the scrollerDidScroll handler immediately, the message doesn't get trapped by my handler. Any ideas of how to do this?
Code: Select all
global scrollLock
on mouseDown
put true into scrollLock
end mouseDown
on selectionChanged
wait until the mouse is up
put the selectedChunk into tChunk
if word 2 of tChunk < word 4 of tChunk
then
answer "Choose color" with "Red" or "Blue" or "Yellow" or "Clear" as sheet
if it = "Clear" then get the effective backgroundColor of me
set the backgroundcolor of tChunk to it
select empty
end if
put false into scrollLock
end selectionChanged
on scrollerDidScroll hOffset, vOffset
if scrollLock then exit scrollerDidScroll
fwmobScroll hOffset, vOffset, mobileControlTarget()
pass scrollerDidScroll
end scrollerDidScroll