Return in field where it's told not to happen
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 222
- Joined: Wed Jun 21, 2006 7:33 pm
- Location: West of the Pecos
- Contact:
Return in field where it's told not to happen
Alrighty, my lot in life is to find bugs...
I have three fields in a stack. None of the fields have any handlers in them. All three have "Tab on Return" and "Don't Wrap" checked. Yet, if I type something into any of the fields and press the Return key (the one in the main part of the keyboard above right-shift), a return char is added and the text I entered moves upward. This behavior persists regardless of the settings of "Tab on Return" and "Don't Wrap". The tab key works as expected but I need to intercept bad user behavior.
IIRC, in previous versions of LC, these field settings were respected. Do I need to add some sort of "returnInField" handler to each field and, if so, what would I have the handler do?
Thanks,
Barry
LC 8.1.9 Indy.
I have three fields in a stack. None of the fields have any handlers in them. All three have "Tab on Return" and "Don't Wrap" checked. Yet, if I type something into any of the fields and press the Return key (the one in the main part of the keyboard above right-shift), a return char is added and the text I entered moves upward. This behavior persists regardless of the settings of "Tab on Return" and "Don't Wrap". The tab key works as expected but I need to intercept bad user behavior.
IIRC, in previous versions of LC, these field settings were respected. Do I need to add some sort of "returnInField" handler to each field and, if so, what would I have the handler do?
Thanks,
Barry
LC 8.1.9 Indy.
Re: Return in field where it's told not to happen
Hi Barry,
a quick test confirmed this issue! :-/
But looks like the bug has already been reported, so I added a comment:
http://quality.livecode.com/show_bug.cgi?id=20948
Best
Klaus
a quick test confirmed this issue! :-/
But looks like the bug has already been reported, so I added a comment:
http://quality.livecode.com/show_bug.cgi?id=20948
Best
Klaus
-
- Posts: 222
- Joined: Wed Jun 21, 2006 7:33 pm
- Location: West of the Pecos
- Contact:
Re: Return in field where it's told not to happen
Hello, Klaus! Thanks for your reply. I read your comment at the bug page.
Until the LC crew fixes this, what would you recommend I use as a handler to intercept the "return" and send the focus to the next field?
Thanks,
Barry
Until the LC crew fixes this, what would you recommend I use as a handler to intercept the "return" and send the focus to the next field?
Thanks,
Barry
Re: Return in field where it's told not to happen
Just a guess, but probably something like (not tested)
Code: Select all
on returnInField
put tab after field "yourField"
end returnInField
-
- Posts: 222
- Joined: Wed Jun 21, 2006 7:33 pm
- Location: West of the Pecos
- Contact:
Re: Return in field where it's told not to happen
Just read your replay as I was about to post this:
64293 is the raw code for "Return"
Seems to work but I'll try yours as it's certainly less verbose.
Code: Select all
on rawKeyDown pkey
if pkey is 64293 then
exit rawKeyDown
else
pass rawKeyDown
end if
end rawKeyDown pkey
Seems to work but I'll try yours as it's certainly less verbose.
-
- Posts: 222
- Joined: Wed Jun 21, 2006 7:33 pm
- Location: West of the Pecos
- Contact:
Re: Return in field where it's told not to happen
Nope; just adds a tab character to the end of the current field. Mine seems to work okay.bogs wrote: ↑Wed Mar 21, 2018 10:23 pmJust a guess, but probably something like (not tested)Code: Select all
on returnInField put tab after field "yourField" end returnInField
-
- Posts: 222
- Joined: Wed Jun 21, 2006 7:33 pm
- Location: West of the Pecos
- Contact:
Re: Return in field where it's told not to happen
Nope, I thought it was working but no more. *sigh* I'll keep trying.rumplestiltskin wrote: ↑Wed Mar 21, 2018 10:27 pmNope; just adds a tab character to the end of the current field. Mine seems to work okay.bogs wrote: ↑Wed Mar 21, 2018 10:23 pmJust a guess, but probably something like (not tested)Code: Select all
on returnInField put tab after field "yourField" end returnInField
-
- Livecode Staff Member
- Posts: 818
- Joined: Fri Feb 06, 2015 4:03 pm
Re: Return in field where it's told not to happen
Does that work in your use case?
Panos
--
Code: Select all
on returnInField
focus on fld "myNextField"
end returnInField
--
Re: Return in field where it's told not to happen
This seems to work:
Code: Select all
on returnInField
type TAB
end returninfield
Re: Return in field where it's told not to happen
My bad, I misinterpreted what you were shooting for, totally on me, I thought you wanted to add a tab at the end instead of a return What Klaus said thoughrumplestiltskin wrote: ↑Wed Mar 21, 2018 10:27 pmNope; just adds a tab character to the end of the current field. Mine seems to work okay.bogs wrote: ↑Wed Mar 21, 2018 10:23 pmJust a guess, but probably something like (not tested)Code: Select all
on returnInField put tab after field "yourField" end returnInField
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Return in field where it's told not to happen
Barry, what is the height of the field, and what is the textHeight of the field?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 222
- Joined: Wed Jun 21, 2006 7:33 pm
- Location: West of the Pecos
- Contact:
Re: Return in field where it's told not to happen
Yep! That did it. Restores proper behavior. One the bug has been eliminated, I can eliminate this extra code but it's nice to know it will continue working even if I forget.Klaus wrote: ↑Wed Mar 21, 2018 10:41 pmThis seems to work:Code: Select all
on returnInField type TAB end returninfield
Simple solution. The best ones often are.
Thanks again!
Barry
PS - I was posting and the forum advised me of a new post so here are the answers:
put Height of field c1 returns 29
put textHeight of field c1 returns nothing
(You probably meant "effective textHeight" and that returned 21)
In the field object properties, it shows a textHeight of 21 ("fixed") and a test size of 16.
Hope this is meaningful.
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Return in field where it's told not to happen
Meaningful, but not as helpful as I'd hoped. I was hoping to reproduce the problem, but here, using v9dp1 on Ubuntu 14.04,fields set to those metrics behave as expected. I wish I had something more useful to offer for what you're seeing.rumplestiltskin wrote: ↑Wed Mar 21, 2018 11:02 pmPS - I was posting and the forum advised me of a new post so here are the answers:
put Height of field c1 returns 29
put textHeight of field c1 returns nothing
(You probably meant "effective textHeight" and that returned 21)
In the field object properties, it shows a textHeight of 21 ("fixed") and a test size of 16.
Hope this is meaningful.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 222
- Joined: Wed Jun 21, 2006 7:33 pm
- Location: West of the Pecos
- Contact:
Re: Return in field where it's told not to happen
I don't know if this is meaningful or not but I just discovered I had somehow made the three fields in my stack invisible but, just as strange, had selected "Show invisible objects"; so my fields (though "visible" was unchecked) were showing up and displaying that bizarre behavior that caused me to start this thread. I discovered this a few minutes ago when, inexplicably, the three fields disappeared. I figured they had somehow become invisible so I used the "Show invisible objects" menu item and then checked the "visible" checkbox for each field. I saved everything, quit LC, and double-clicked my stack to re-launch LC and open things. Now the expected (non-buggy) "Return-in-field-yields-a-tab-to-the-next-field" behavior seems to be consistently fine.
{a few minutes pass while I check some other things...}
Okay, now I've tried this with checking and unchecking the "resizable" checkbox in the stack's properties and I'm finding the problem ("returns" generating new lines in the field) if I check the checkbox. If I leave the "resizable" checkbox unchecked, this seems to be working properly now.
I'll note my original thought (see paragraph 1, above) did not include the "resizable" checkbox but, indeed, that stack -was- set to be resizable. Once I unchecked it, it looks like it's working properly.
So I'll let Klaus and others whose pay grade is much higher than mine test this. Maybe I got lucky and zeroed in on the issue? Heck; even a stopped watch is correct twice a day!
{a few minutes pass while I check some other things...}
Okay, now I've tried this with checking and unchecking the "resizable" checkbox in the stack's properties and I'm finding the problem ("returns" generating new lines in the field) if I check the checkbox. If I leave the "resizable" checkbox unchecked, this seems to be working properly now.
I'll note my original thought (see paragraph 1, above) did not include the "resizable" checkbox but, indeed, that stack -was- set to be resizable. Once I unchecked it, it looks like it's working properly.
So I'll let Klaus and others whose pay grade is much higher than mine test this. Maybe I got lucky and zeroed in on the issue? Heck; even a stopped watch is correct twice a day!
Re: Return in field where it's told not to happen
Please take a look at my last comment for that bug!
http://quality.livecode.com/show_bug.cgi?id=20948
The expalantion is really not straightforward, but the observed behavior is definitively correct, once you understand what is going on. Create a ONE line text field with AUTOTAB and see yourself.
http://quality.livecode.com/show_bug.cgi?id=20948
The expalantion is really not straightforward, but the observed behavior is definitively correct, once you understand what is going on. Create a ONE line text field with AUTOTAB and see yourself.