Re: When has a field changed?

2011-10-26 Thread Pete
Hi Ken, This took me by surprise so I just did a test. Pasted text into a field then clicked on another field on the card and I did get a closeField, so maybe this was a bug that has been fixed? LC 4.6.3/OS X 10.6.8 Pete Molly's Revenge http://www.mollysrevenge.com On Tue, Oct 25, 2011 at

Re: When has a field changed?

2011-10-26 Thread Pete
I guess that works but it means the button script will execute before the focus on nothing in the card script which could be an issue, depending on the application requirements. Pete Molly's Revenge http://www.mollysrevenge.com On Wed, Oct 26, 2011 at 9:09 AM, Bob Sneidar b...@twft.com wrote:

Re: When has a field changed?

2011-10-26 Thread Bob Sneidar
How about inserting the mouseUp handler into the frontScript. That should run before the button script then. Make sure to pass mouseUp though! Here is what I did: Create a button called btnFrontScript in the script of that button put on mouseUp focus on nothing pass mouseUp end mouseUp in

Re: When has a field changed?

2011-10-26 Thread Ken Ray
On Oct 26, 2011, at 11:29 AM, Pete wrote: Hi Ken, This took me by surprise so I just did a test. Pasted text into a field then clicked on another field on the card and I did get a closeField, so maybe this was a bug that has been fixed? LC 4.6.3/OS X 10.6.8 Well whaddaya know? You're

Re: When has a field changed?

2011-10-26 Thread Pete
I'm glad they fixed it, 'cause that didn't seem right! Pete Molly's Revenge http://www.mollysrevenge.com On Wed, Oct 26, 2011 at 2:44 PM, Ken Ray k...@sonsothunder.com wrote: On Oct 26, 2011, at 11:29 AM, Pete wrote: Hi Ken, This took me by surprise so I just did a test. Pasted text

Re: When has a field changed?

2011-10-26 Thread James Hurley
Message: 10 Date: Wed, 26 Oct 2011 15:05:09 -0700 From: Pete p...@mollysrevenge.com To: How to use LiveCode use-livecode@lists.runrev.com Subject: Re: When has a field changed? Message-ID: CABx6j9k5s_42TG85A-HL_yMoGD9cccKtQbD=bk9rbomadua...@mail.gmail.com Content-Type: text/plain

When has a field changed?

2011-10-25 Thread James Hurley
I have a text field (unlocked) that the user can edit, but I want to know when and to deal with the changes. Here is what I have come up with, something of a kludge. Is there a cleaner way? on mouseEnter --Enter the field set the textChange of me to false end mouseEnter on rawkeydown tKey

Re: When has a field changed?

2011-10-25 Thread Joe Lewis Wilkins
Sorry to say Jim, but I had the same problem on my hands last year and ended up doing pretty much as you have done, but I never asked the list for help, so I'll be interested in seeing where this leads. (smile) Joe Wilkins Architect On Oct 25, 2011, at 2:21 PM, James Hurley wrote: I have a

Re: When has a field changed?

2011-10-25 Thread Bob Sneidar
yes. on closeField. However be aware that clicking a button before tabbing out of the field will NOT send a closeField to an edited field. Someone sent me a workaround for that, but I cannot find it right now. I am sure it is in the archives. Note that exitField is sent when a field loses

Re: When has a field changed?

2011-10-25 Thread Klaus on-rev
Hi James, Am 25.10.2011 um 23:21 schrieb James Hurley: I have a text field (unlocked) that the user can edit, but I want to know when and to deal with the changes. Here is what I have come up with, something of a kludge. Is there a cleaner way? on mouseEnter --Enter the field ... end

RE: When has a field changed?

2011-10-25 Thread John Dixon
'closeField' is your friend here... Dixie Subject: When has a field changed? From: jhurley0...@sbcglobal.net Date: Tue, 25 Oct 2011 14:21:56 -0700 To: use-livecode@lists.runrev.com I have a text field (unlocked) that the user can edit, but I want to know when and to deal

Re: When has a field changed?

2011-10-25 Thread Mark Schonewille
James, // this is a field script, providing // a safe way to check if a field has changed local lHash local lHasChanged on openField put md5Digest(the text of me) into lHash pass openField end openField on closeField checkHash pass closeField end closeField // depending on the purpose

Re: When has a field changed?

2011-10-25 Thread Mark Schonewille
Hi James, In addition to my previous field script, for your button: on mouseUp if the changed of fld Whatever is true then // continue end if end mouseUp -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter:

Re: When has a field changed?

2011-10-25 Thread J. Landman Gay
On 10/25/11 6:48 PM, James Hurley wrote: I worry about the size of the field text that it would be hashing. It would be book length. I don't have that much in there at present, so I can't test it, but that is the ultimate goal. I'd just use closefield myself. The bug with the buttons was a

Re: When has a field changed?

2011-10-25 Thread Terry Judd
In the button script you could put select empty in the first line. That should cause the field's closeField handler to fire before the rest of the button script. Terry... On 26/10/2011, at 10:48 AM, James Hurley wrote: Mark, Well there's another RR command (md5hash) I was unaware of. I

Re: When has a field changed?

2011-10-25 Thread Pete
James, The button click/closeField problem happens because, on OS X anyway, the filed doesn;t lose focus when you click on the button (you'll see the cursor is still in it). Put focus on nothing at the top of your button's mouseDown handler. That removes focus from the field thus causing the

Re: When has a field changed?

2011-10-25 Thread Bob Sneidar
Actually, the workaround I was thinking of trapped mouseUp in the card or stack handler, then used the command focus on nothing. This will force the loss of focus by the field thereby forcing a closeField to be sent to the field that lost the focus. This way you can use closeField in fields,

Re: When has a field changed?

2011-10-25 Thread Keith (Gulf Breeze Ortho Lab)
field... Cheers, - Boo -Original Message- From: Bob Sneidar Sent: Tuesday, October 25, 2011 7:08 PM To: How to use LiveCode Subject: Re: When has a field changed? Actually, the workaround I was thinking of trapped mouseUp in the card or stack handler, then used the command focus

Re: When has a field changed?

2011-10-25 Thread Ken Ray
On Oct 25, 2011, at 7:30 PM, Keith (Gulf Breeze Ortho Lab) wrote: Hi All, Was following this thread and tried the instructions (see below), just for the fun of it, and it worked fine. I set a bogus field so that it was not visible, then simply set the focus to this hidden field upon

Re: When has a field changed?

2011-10-25 Thread James Hurley
Thanks all. Problem solved. The closeField is triggered only when the field is changed and the focus is changed to something outside the field. The only problem is when the next selection is a button (on the Mac at least) the focus remains in the field. The work around, as several pointed

Re: When has a field changed?

2011-10-25 Thread J. Landman Gay
On 10/25/11 11:24 PM, James Hurley wrote: It appears to make no difference whether the traversalOn is true or false for the button, which seems a bit odd. Yeah. I misspoke. It's auto-hilite that matters. But then you have to write your own hiliting handlers, so the focus solution is much