please give me just a clue.....

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

chris25
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: please give me just a clue.....

Post by chris25 » Fri Nov 15, 2013 7:33 pm

Sooo...I am back to square one, because despite all the theory that I really do understand - I am failing seriously to know exactly what the practical outworking is. I have no idea now what to write or where to write it. I'm lost. sorry. I was actually trying everything that had been said by the way but absolutely nothing was working.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: please give me just a clue.....

Post by Klaus » Fri Nov 15, 2013 7:35 pm

HI Chris,

why not let the user do it?
I am sure most if not all computer users are used to end/confirm a text entry by hitting the
ENTER or RETURN key so this will be "natriual" behavior to them!
Just add a little info to let the user know, if neccessary.

Add this to the scripts of these fields that do not want to close :D

Code: Select all

on returninfield
  focus on nothing
end returninfield

on enterinfield
  returninfield
end enterinfield
This way, hitting ENTER or RETURN will force a "closefield" message!


Best

Klaus

chris25
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: please give me just a clue.....

Post by chris25 » Fri Nov 15, 2013 7:36 pm

This works: But is it correct? I simply put it into the calculate button and Bobs your Uncle!
on mouseUp
  if the text of me is not among the items of "360,300,240,180" then
    answer "360, 300, 240 or 180"
  end if
end mouseUp

chris25
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: please give me just a clue.....

Post by chris25 » Fri Nov 15, 2013 7:40 pm

Klaus wrote:HI Chris,

why not let the user do it?
I am sure most if not all computer users are used to end/confirm a text entry by hitting the
ENTER or RETURN key so this will be "natriual" behavior to them!
Just add a little info to let the user know, if neccessary.

Add this to the scripts of these fields that do not want to close :D

Code: Select all

on returninfield
  focus on nothing
end returninfield

on enterinfield
  returninfield
end enterinfield
This way, hitting ENTER or RETURN will force a "closefield" message!


Best

Klaus

See darn it, I was reading all over the place in the dictionary about the focus field hours ago, I knew essentially that this was the problem. But I would never in a million years have thought of this script - so this is my problem half of the time I can not find syntax. I knew to use focus, remove focus, but could not figure that out from the dictionary.

I will try this as well now.

Post Reply