RE: mouseDown/Up - no actions when not on buttons

2005-02-10 Thread Silver, Jason
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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Pat
Trendler
Sent: Wednesday, February 09, 2005 5:50 PM
To: [EMAIL PROTECTED]; 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
[EMAIL PROTECTED]
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: mouseDown/Up - no actions when not on buttons

2005-02-09 Thread Pat Trendler
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
[EMAIL PROTECTED]

___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


mouseDown/Up - no actions when not on buttons

2005-02-08 Thread Silver, Jason
Hello (again) :)  After some very useful advice from Jacqueline Landman
Gay at Hyperactive, I've changed the structure of my mobile phone sim
tool.  Now, instead of the buttons being on a palette, they're grouped
and behave like a background, showing up on every card.  When buttons
are pressed, they send a custom ButtonPress message with the name of the
button being pressed to the card.  The card then has a switch statement,
and does some action based on which button was pressed.

The current card I'm working on is a Login type screen, with two
focusable/editable fields, User ID and Password.  (Please see my shared
stack in RevOnline's User Spaces; the username is jsilver).  In the
switch statements, I have this script when the user presses up (or
down):

case navUp
  -- Determine which text field the user is currently in
  put the short name of the selectedField into activeField
  if activeField = User ID then
focus on field Password
  else -- The user must be in the password field
focus on field User ID
  end if
  break

This works all well and good, except when pressing on an area that's not
a button (in my stack, the purpleish area).  The cursor then disappears
from either the User ID or Password fields, and then when pressing Up or
Down, the following error occurs (because the focus is not in a field):

Type: Chunk: no target found
Object: Login Screen
Line: put the short name of the selectedField into activeField

Basically, I never want the focus to leave either the User ID or
Password fields; this simulation is supposed to be controlled solely by
the buttons placed in the Buttons group.  Is there an easy way to
block the mouseUp (or mouseDown?) handler from doing anything when not
on those buttons?  I've tried adding exit mouseDown type handlers in
the card and stack, but this doesn't do anything.  Any help is
appreciated.

Thanks again!

Jason Silver
Human Factors Engineer, Sr.
QUALCOMM Inc.
(858) 845-3444
[EMAIL PROTECTED] 
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: mouseDown/Up - no actions when not on buttons

2005-02-08 Thread Pat Trendler
Hello Jason,
Could you just make the purple area a button. Turn off 
showName,autoHilite,sharedHilite, showFocusBorder. And turn off 
traversalOn - so that it doesn't take focus off the field if it is clicked..

You can use property inspector (size  position/layer) to 'send to the back' 
alter you create the button.

Regards
Pat
[EMAIL PROTECTED]
- Original Message - 
From: Silver, Jason [EMAIL PROTECTED]
To: use-revolution@lists.runrev.com
Sent: Wednesday, February 09, 2005 8:54 AM
Subject: mouseDown/Up - no actions when not on buttons

Hello (again) :)  After some very useful advice from Jacqueline Landman
Gay at Hyperactive, I've changed the structure of my mobile phone sim
tool.  Now, instead of the buttons being on a palette, they're grouped
and behave like a background, showing up on every card.  When buttons
are pressed, they send a custom ButtonPress message with the name of the
button being pressed to the card.  The card then has a switch statement,
and does some action based on which button was pressed.
The current card I'm working on is a Login type screen, with two
focusable/editable fields, User ID and Password.  (Please see my shared
stack in RevOnline's User Spaces; the username is jsilver).  In the
switch statements, I have this script when the user presses up (or
down):
case navUp
 -- Determine which text field the user is currently in
 put the short name of the selectedField into activeField
 if activeField = User ID then
   focus on field Password
 else -- The user must be in the password field
   focus on field User ID
 end if
 break
This works all well and good, except when pressing on an area that's not
a button (in my stack, the purpleish area).  The cursor then disappears
from either the User ID or Password fields, and then when pressing Up or
Down, the following error occurs (because the focus is not in a field):
Type: Chunk: no target found
Object: Login Screen
Line: put the short name of the selectedField into activeField
Basically, I never want the focus to leave either the User ID or
Password fields; this simulation is supposed to be controlled solely by
the buttons placed in the Buttons group.  Is there an easy way to
block the mouseUp (or mouseDown?) handler from doing anything when not
on those buttons?  I've tried adding exit mouseDown type handlers in
the card and stack, but this doesn't do anything.  Any help is
appreciated.
Thanks again!
Jason Silver
Human Factors Engineer, Sr.
QUALCOMM Inc.
(858) 845-3444
[EMAIL PROTECTED]
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution 

___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: mouseDown/Up - no actions when not on buttons

2005-02-08 Thread J. Landman Gay
On 2/8/05 4:54 PM, Silver, Jason wrote:
case navUp
  -- Determine which text field the user is currently in
  put the short name of the selectedField into activeField
  if activeField = User ID then
focus on field Password
  else -- The user must be in the password field
focus on field User ID
  end if
  break
This works all well and good, except when pressing on an area that's not
a button (in my stack, the purpleish area).  The cursor then disappears
from either the User ID or Password fields, and then when pressing Up or
Down, the following error occurs (because the focus is not in a field):
Type: Chunk: no target found
Object: Login Screen
Line: put the short name of the selectedField into activeField
That's because when you click on the card, no field is in focus. The 
selectedfield will be empty, and you can't get the short name of empty.

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
else -- Currently in password field
  focus on field User ID
end if
break
By using contains instead of equals, you can work with an empty 
case. Since it is never used more than once, you can also eliminate the 
line that puts the selectedfield into the variable; just compare it 
directly.

I took a quick look at your script, and noticed you have an exit 
statement as the last line of the handler. No need -- all messages 
automatically stop at the end of the handler, unless they are expressly 
passed. The buttonPress message will never go any farther.

You don't need send to in the button scripts -- all messages are 
automatically sent to the card if the button itself doesn't handle them. 
Use:

on mouseup
 buttonPress selectKey
end mouseup
But even better, since you have elegantly named your buttons for the 
messages they send (which is good,) you could put this same script in 
all of them:

on mouseUp
 buttonPress (the short name of me)
end mouseUp
And if you wanted to get really fancy, don't put any scripts in those 
buttons at all. Leave them completely empty. Instead, use a single card 
script:

on mouseup
 get the name of the target
 if it contains button
 then buttonPress (the short name of the target)
end mouseUp
This last approach will work even if you add future buttons that aren't 
supposed to use the buttonpress message. If you give those future 
buttons their own mouseup handler, then the mouseup message they 
catch will never reach the one that is living in the card.

--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: mouseDown/Up - no actions when not on buttons

2005-02-08 Thread J. Landman Gay
On 2/8/05 10:08 PM, I wrote:
By using contains instead of equals, you can work with an empty 
case.
Sorry, this is of course untrue; you could use equals there. The thing 
that fixes the script is that it is no longer trying to get the name of 
empty. Any comparison type would work.

--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution