Re: closeField and exitField problem

2007-10-16 Thread David Burgun


On 15 Oct 2007, at 20:30, Björnke von Gierke wrote:

Yes, I too think that validating user entries is one of rev's  
weaknesses. However, artificially increasing the problem by not  
using the fields as data source seems a bit strange to me,  
especially with your reasoning.


One area where this falls down is if you want to enter a password  
type field. In this case when the user types a character you want to  
display a * in the field while accumulating the key strokes in  
local storage. You can't use the field as data storage in this case.


How are these two lines completely different in their horribility?

put field 1 of card 1 into x
put the field1oncard1 of this stack into x


They are identical and are horrid since the script will break if you  
remove the field at a later stage.




If you're really that much into customprops, you can put the fields  
into them when you leave the card. or with a send in time message,  
or on mousemove, or ...


I don't want to reference an object directly if I can help it. When I  
want to get or set the contents of an object I always use a handler  
if that object that references the contents via me, that way if you  
remove the object you don't get errors elsewhere in the Stack, all  
that happens is that the field no longer gets called.


More likely is that i didn't understand the problem you have  
correctly, so maybe you should explain it in a different way.




No need since I had my own work-around and there's a better one  
posted under this subject on this list which I will implement later on.


All the Best
Dave


Bjoernke


On 15 Oct 2007, at 20:48, Dave wrote:


Hi,

I asked about this problem ages ago, but didn't get a response, so  
I'm asking again as it's just come up again!


I am running on a Mac. If the user fills in a field and then tabs  
out of the field, either a closeField or exitField message is sent  
to the field. All well and good. However, if the user clicks on a  
button, nether messages are sent!


This is supposedly normal behavior since from the docs:

If the lookAndFeel property is set to Macintosh, the closeField  
message is generally not sent when another control (such as a  
button) is clicked. This is because clicked buttons do not receive  
the focus on Mac OS systems, and therefore the selection remains  
active.


(incidentally, in this case the lookAndFeel and feel property is  
set to Appearance Manager, so according to the above it should  
still send the message(s).)


This effectively means that it\s impossible to ensure that a field  
is valid using these messages, so what's the use of having them or  
am I missing something.


I want to let the user enter a number of fields and then when the  
user clicks the button, I check to see if they are valid and if  
not put if an error message. The problem is that the three field  
must be examined together, so I'd like to be able to store the  
contents of each field in a custom property of the stack and then  
check them in the mouseUp handler of the button. I can't really  
access the fields directly (as is put field XXX into whatever)  
since the check may be run on a different card and it's really  
horrible to access fields like that.


Any ideas or suggestions would be greatly appreciated!

All the Best
Dave


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


closeField and exitField problem

2007-10-15 Thread Dave

Hi,

I asked about this problem ages ago, but didn't get a response, so  
I'm asking again as it's just come up again!


I am running on a Mac. If the user fills in a field and then tabs out  
of the field, either a closeField or exitField message is sent to the  
field. All well and good. However, if the user clicks on a button,  
nether messages are sent!


This is supposedly normal behavior since from the docs:

If the lookAndFeel property is set to Macintosh, the closeField  
message is generally not sent when another control (such as a button)  
is clicked. This is because clicked buttons do not receive the focus  
on Mac OS systems, and therefore the selection remains active.


(incidentally, in this case the lookAndFeel and feel property is  
set to Appearance Manager, so according to the above it should  
still send the message(s).)


This effectively means that it\s impossible to ensure that a field is  
valid using these messages, so what's the use of having them or am I  
missing something.


I want to let the user enter a number of fields and then when the  
user clicks the button, I check to see if they are valid and if not  
put if an error message. The problem is that the three field must be  
examined together, so I'd like to be able to store the contents of  
each field in a custom property of the stack and then check them in  
the mouseUp handler of the button. I can't really access the fields  
directly (as is put field XXX into whatever) since the check may be  
run on a different card and it's really horrible to access fields  
like that.


Any ideas or suggestions would be greatly appreciated!

All the Best
Dave



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: closeField and exitField problem

2007-10-15 Thread Phil Davis

Hi Dave,

How about something like this:


-- in the card or stack script if needed by multiple fields

on openField
 detectCloseField (the long id of the target)
end openField

on closeField
 -- first do whatever needs to be done at closeField time
 -- then turn detector off immediately after
 send closeFieldDetected to the target in 0 seconds
end closeField

on detectCloseField pTargetID
 insert script of btn detector into front
 put pTargetID into vTargetField -- a local or global that's available 
to other handlers

end detectCloseField

on closeFieldDetected
 remove script of btn detector from front
 put empty into vTargetField
end detectCloseField


-- script of btn detector - a hidden, disabled button

on mouseDown
 if vTargetField  empty then -- we have a situation
   send closeField to vTargetField
 end if
 pass mouseDown
end mouseDown


Sorry - sometimes it's easier to code it than 'splain it! I haven't 
tested this so let the buyer beware.


HTH -
Phil Davis



Dave wrote:

Hi,

I asked about this problem ages ago, but didn't get a response, so I'm 
asking again as it's just come up again!


I am running on a Mac. If the user fills in a field and then tabs out 
of the field, either a closeField or exitField message is sent to the 
field. All well and good. However, if the user clicks on a button, 
nether messages are sent!


This is supposedly normal behavior since from the docs:

If the lookAndFeel property is set to Macintosh, the closeField 
message is generally not sent when another control (such as a button) 
is clicked. This is because clicked buttons do not receive the focus 
on Mac OS systems, and therefore the selection remains active.


(incidentally, in this case the lookAndFeel and feel property is set 
to Appearance Manager, so according to the above it should still 
send the message(s).)


This effectively means that it\s impossible to ensure that a field is 
valid using these messages, so what's the use of having them or am I 
missing something.


I want to let the user enter a number of fields and then when the user 
clicks the button, I check to see if they are valid and if not put if 
an error message. The problem is that the three field must be examined 
together, so I'd like to be able to store the contents of each field 
in a custom property of the stack and then check them in the mouseUp 
handler of the button. I can't really access the fields directly (as 
is put field XXX into whatever) since the check may be run on a 
different card and it's really horrible to access fields like that.


Any ideas or suggestions would be greatly appreciated!

All the Best
Dave



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: closeField and exitField problem

2007-10-15 Thread Björnke von Gierke
Yes, I too think that validating user entries is one of rev's 
weaknesses. However, artificially increasing the problem by not using 
the fields as data source seems a bit strange to me, especially with 
your reasoning.


How are these two lines completely different in their horribility?

put field 1 of card 1 into x
put the field1oncard1 of this stack into x

If you're really that much into customprops, you can put the fields 
into them when you leave the card. or with a send in time message, or 
on mousemove, or ...


More likely is that i didn't understand the problem you have correctly, 
so maybe you should explain it in a different way.


Bjoernke


On 15 Oct 2007, at 20:48, Dave wrote:


Hi,

I asked about this problem ages ago, but didn't get a response, so I'm 
asking again as it's just come up again!


I am running on a Mac. If the user fills in a field and then tabs out 
of the field, either a closeField or exitField message is sent to the 
field. All well and good. However, if the user clicks on a button, 
nether messages are sent!


This is supposedly normal behavior since from the docs:

If the lookAndFeel property is set to Macintosh, the closeField 
message is generally not sent when another control (such as a button) 
is clicked. This is because clicked buttons do not receive the focus 
on Mac OS systems, and therefore the selection remains active.


(incidentally, in this case the lookAndFeel and feel property is set 
to Appearance Manager, so according to the above it should still 
send the message(s).)


This effectively means that it\s impossible to ensure that a field is 
valid using these messages, so what's the use of having them or am I 
missing something.


I want to let the user enter a number of fields and then when the user 
clicks the button, I check to see if they are valid and if not put if 
an error message. The problem is that the three field must be examined 
together, so I'd like to be able to store the contents of each field 
in a custom property of the stack and then check them in the mouseUp 
handler of the button. I can't really access the fields directly (as 
is put field XXX into whatever) since the check may be run on a 
different card and it's really horrible to access fields like that.


Any ideas or suggestions would be greatly appreciated!

All the Best
Dave


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: closeField and exitField problem

2007-10-15 Thread Ken Ray
On Mon, 15 Oct 2007 19:48:36 +0100, Dave wrote:

 Hi,
 
 I asked about this problem ages ago, but didn't get a response, so 
 I'm asking again as it's just come up again!
 
 I am running on a Mac. If the user fills in a field and then tabs out 
 of the field, either a closeField or exitField message is sent to the 
 field. All well and good. However, if the user clicks on a button, 
 nether messages are sent!
 
 This effectively means that it\s impossible to ensure that a field is 
 valid using these messages, so what's the use of having them or am I 
 missing something.

The messages are useful, you just need to manually trigger them on 
MacOS - the easiest way (IMHO) is to issue select empty on a 
mouseDown. If you're not trapping mouseDown anywhere this can go in the 
card/stack script:

on mouseDown
  select empty
  pass mouseDown
end mouseDown

If you *do* trap mouseDown, you can set up a frontscript that does the 
same thing. Create an object (say, a button), and give it a name (like 
FS) and give it the script above. Then at some point prior to the 
user being able to enter data, execute:

insert script of btn FS into front

Doing a select empty forces the cursor out of the field and should 
trigger an exitField or closeField depending on whether the contents 
have changed or not.

HTH,

Ken Ray
Sons of Thunder Software, Inc.
Email: [EMAIL PROTECTED]
Web Site: http://www.sonsothunder.com/
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: closeField and exitField problem

2007-10-15 Thread Phil Davis

This is so much simpler than what I proposed! Thanks Ken.

Phil Davis



Ken Ray wrote:

On Mon, 15 Oct 2007 19:48:36 +0100, Dave wrote:

  

Hi,

I asked about this problem ages ago, but didn't get a response, so 
I'm asking again as it's just come up again!


I am running on a Mac. If the user fills in a field and then tabs out 
of the field, either a closeField or exitField message is sent to the 
field. All well and good. However, if the user clicks on a button, 
nether messages are sent!


This effectively means that it\s impossible to ensure that a field is 
valid using these messages, so what's the use of having them or am I 
missing something.



The messages are useful, you just need to manually trigger them on 
MacOS - the easiest way (IMHO) is to issue select empty on a 
mouseDown. If you're not trapping mouseDown anywhere this can go in the 
card/stack script:


on mouseDown
  select empty
  pass mouseDown
end mouseDown

If you *do* trap mouseDown, you can set up a frontscript that does the 
same thing. Create an object (say, a button), and give it a name (like 
FS) and give it the script above. Then at some point prior to the 
user being able to enter data, execute:


insert script of btn FS into front

Doing a select empty forces the cursor out of the field and should 
trigger an exitField or closeField depending on whether the contents 
have changed or not.


HTH,

Ken Ray
Sons of Thunder Software, Inc.
Email: [EMAIL PROTECTED]
Web Site: http://www.sonsothunder.com/
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

  

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution