Hi Scott,
Scott Rossi wrote:
>
> Howdy List:
>
> Am hoping someone can offer a suggestion for the following...
>
> My goal is a custom scroll control: to continuously set the scroll of a
> field while the mouse is down and within a target object, and cease setting
> the scroll when the mouse is outside the target object or the mouse is up.
> I also want the scrolling action to resume when the mouse is still down and
> returns to the target.
>
> I've been trying to use the mouseMove message to replace a "repeat while the
> mouse is down" handler, but I can't figure out how to track the mouse when
> the mouse is stationary. Are we supposed to use repeating "send 'blabla' to
> me in 2 seconds" messages here? Is there an easier way?
>
Sounds to me like you need a combination of things working together.
There are 2 conditions that must be true for custom scrolling to be
active:
-- set condition 1 - the mouse must be "down"
on mouseDown
set the cScrollCondition[1] of the target to true
end mouseDown
on mouseUp
set the cScrollCondition[1] of the target to false
end mouseUp
on mouseRelease
set the cScrollCondition[1] of the target to false
cancel item 1 of the pendingMessages
end mouseRelease
-- set condition 2 - the mouseLoc must be within the target rect
on mouseMove
set the cScrollCondition[2] of the target to \
(the mouseLoc is within rect of target)
end mouseMove
-- act on the condition settings
on mouseEnter
send "setScrolling" to the target in 20 milliseconds
end mouseEnter
on mouseLeave
cancel item 1 of the pendingMessages
end mouseLeave
on setScrolling
put (the cScrollCondition[1] of the target = true) \
and (the cScrollCondition[2] of the target = true) \
into bShouldScroll
if bShouldScroll = true then
-- update the settings of your custom scroller(s)
end if
send "setScrolling" to the target in 20 milliseconds
end setScrolling
DISCLAIMERS:
1) This is completely untested, which probably means it won't work
correctly.
2) It assumes you have no other pending messages in the queue.
HTH.
Phil
--
> Thanks for any help.
>
> Scott
>
> __________________________________________________________________
> Scott Rossi Tactile Media - Multimedia & Design
> Creative Director Email: [EMAIL PROTECTED]
> Web: www.tactilemedia.com
>
> This is the MetaCard mailing list.
> Archives: http://www.mail-archive.com/metacard%40lists.best.com/
> Info: http://www.xworlds.com/metacard/mailinglist.htm
--
Phil Davis
------------------
[EMAIL PROTECTED]
This is the MetaCard mailing list.
Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm