> Rev allows many ways to script:

Agreed!

> Here is the same as the above using a function.
> What is interesting is that a function returns a value immediately
> when a condition matches and avoids using nested conditional
> structures or long statements with and/or.
> 
> on mouseDown pButton
>    if PopupAllowed(pButton) then popup btn "contextualMenu" --
> end mouseDown
> ------------------------------
> function PopupAllowed pButton
>    if pButton <> 3 then return false
>    if word 1 of the target <> "field" then return false
>    if the lockText of the target then return false
>    return true
> end PopupAllowed

I would also put this in a frontScript instead of a card/stack script in the
event you need to use the mouseDown in a field for other reasons. The only
real difference is to add the "pass mouseDown":

 on mouseDown pButton
    if PopupAllowed(pButton) then popup btn "contextualMenu"
    else pass mouseDown
 end mouseDown

This way, if the user right-clicks/Control-clicks, the popup menu displays,
otherwise the target field gets the mouseDown message that it can do with as
it likes.

Ken Ray
Sons of Thunder Software, Inc.
Email: [EMAIL PROTECTED]
Web Site: http://www.sonsothunder.com/


_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to