mouseDown/Up - no actions when not on buttons

Silver, Jason jsilver at qualcomm.com
Thu Feb 10 12:58:40 CST 2005


Even without storing the selectedField into a local variable, I was
still getting errors when clicking on the stack.  The problems persisted
even when there was an invisible button behind the "normal" buttons.  I
think the best way to prevent errors is the following method:

Store the current location of the cursor in a local variable for the
card.
For all buttons that depend on the selectedField being in an text box,
run a function to return the name of the selectedField.
If empty is returned, then we know we're not in "User ID" or "Password"
anymore.  Restore the previous known location from the variable, and go
there.

I have yet another question (actually one that my boss would like me to
pose to the mailing list), but I think I'll start it in a new topic, as
it has nothing to do with buttons.  :)

All the best,
Jason

-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Pat
Trendler
Sent: Wednesday, February 09, 2005 5:50 PM
To: jacque at hyperactivesw.com; How to use Revolution
Subject: Re: mouseDown/Up - no actions when not on buttons

J Landman Gay wrote:

snip
> Instead of trying to get the name for all cases, change the syntax to:
>
> case navUp
>     -- Determine which text field the user was in
>     if the selectedField contains "User ID" then -- change this
>       focus on field "Password"

Jaqueline,
The above is always empty. If you use:

> put the short name of the selectedField into activeField
>   if activeField = "User ID" then

as Jason did, you can store the selectedField.

Of course, the rest of your recommendations are a far better way of
coding.

Pat
patrend at bigpond.com


More information about the use-livecode mailing list