> I'm trying to build a CBT package for a target program. In the CBT
> package I move the mouse over a simulated screen of the target
> program as if the user were actually controlling the real program.
> I've got the mouse moving OK and I get the mouse to pause over screen
> objects (using 'wait x secs'). However, during the wait pause, the
> tooltip doesn't appear even though the mouse is over an object. It
> seems that the object under the mouse doesn't receive the mouseEnter
> during the wait. If I move the mouse and leave it over an object the
> tooltip appears and the object can respond to the mouseEnter
> (changing it's image for example as the mouse hovers over it).
>
> Obviously I can send mouseEnter and mouseLeave messages, but I
> wondered whether there was any message I could send to MetaCard (a
> bit like 'exit to System' in SuperCard?) that would allow objects
> user the mouse to respond as if the mouse were under user control.
> This would make it a lot easier to script pseudo-user control.
>
> Thanks for any ideas.
Hi Peter,
Use the send command. Here is an example:
Create two buttons side by side. In the right hand button put a mouseEnter
handler that does something e.g beeps. Also, set a toolTip on this button.
In the left hand button put the following script. Note that the script does
pause the mouse over the right hand button to allow the toolTip to show.
However, this is the same when the mouse is under user control.
local lCounter, lMessageId
on mouseUp
put empty into lCounter
moveMouse
end mouseUp
on moveMouse
if lCounter < 400 then
set the screenMouseLoc to item 1 of the screenMouseLoc + 1, item 2 of\
the screenMouseLoc
send moveMouse to me in 5 milliseconds
put the result into lMessageId
add 1 to lCounter
else
cancel lMessageId
send "doNextStage" to me in 2 seconds
end if
end moveMouse
on doNextStage
mouseUp -- don't actually do this or you'll go on forever!
end doNextStage
Of course, to stop the mouse moving you will have to run the following in
the message box:
repeat for each line l in the pendingmessages
cancel item 1 of l
end repeat
For more information on the send command, check out the "Using the Send
Command" article on our website:
<http://www.xworlds.com/metacard/index.htm>
HTH,
Cheers,
Alan
-----------------------------------------------------------------
Alan Beattie <[EMAIL PROTECTED]> <http://www.xworlds.com/>
Cross Worlds Computing, MetaCard Distributors, Custom Development.
Tel: +44 (0)131 672 2909. Fax: +44 (0)1639 830 707.