Dialog box selections using keyboard.

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Dialog box selections using keyboard.

Post by richmond62 » Thu Feb 16, 2023 8:54 am

What Richmond did is fine because he rolled his own dialog box. That is just another LC gadget.
1. Not sure about that, as every time Richmond rolls his own 2 people, predictably, react negatively.

2. Surely, given the lack of 'movement' in a lot of areas, a repository of publically
and freely available hand-rolled gadgets might not be a bad thing?

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Dialog box selections using keyboard.

Post by Klaus » Thu Feb 16, 2023 11:04 am

CAsba,

this is NOT what Richmond tried to tell you with his example of a "selfmade" dialog!
Maybe you want to take another look at his example!

I presume you are working on Windows, which explains why your script does indeed work out of the box, that is what Jacque told you in her post.
You should really read all of our answers and ASK if something is not clear enough and you don't understand.
If you don't then we are wasting our time.

Code: Select all

answer question "You have entered the business name as:" ...  with "YES" or "NO"
We cannot modify the LC dialog boxes like you tried to do in your example.
Even if we could, your "set the traversalon..." will be executed AFTER the dialog has already been closed again, so we would need to apply our modifactions BEFORE we issue "answer ..."

Code: Select all

answer "whatever..."...
set the traversalon of btn "YES" to true 
set the traversalon of btn "NO" to true 
The LC ASK and ANSWER dialogs are opened as MODAL, which means everything in the script will stop and wait until the dialogs have closed by clicking OK, CANCEL or any of these buttons in the dialogs.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Dialog box selections using keyboard.

Post by richmond62 » Thu Feb 16, 2023 12:21 pm

There seem to be lots of people who turn to the forums for advice and then do NOT
read CAREFULLY what they are told, and often, subsequently, make unsubstantiatable
claims about things the say they have achieved using a 'mash-up' of bits and bobs they
have picked up on the forums with no obvious signs that they have understood anything.

But, to my mind, this is symptomatic of a certain recent attitude, that computer programming can
be achieved by cobbling together bits of code with no real work and no real thinking: this has probably
come about because of silly adverts containing phrases such as 'no code'.
Last edited by richmond62 on Thu Feb 16, 2023 7:09 pm, edited 1 time in total.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Dialog box selections using keyboard.

Post by jacque » Thu Feb 16, 2023 7:01 pm

The problem seems to be just a misunderstanding about how dialogs work. LC has a huge body of required knowledge. CAsba was applying what he knows about non-modal stack behavior.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Dialog box selections using keyboard.

Post by dunbarx » Thu Feb 16, 2023 8:50 pm

Richmond.
1. Not sure about that, as every time Richmond rolls his own 2 people, predictably, react negatively.
Am I one of those two? If so you misread my intent. I was not denigrating you or your efforts. I was trying to make a clear distinction between a custom, home-made LC gadget, to which all of the power of LC itself is available, as opposed to a call to a standard dialog box, to which very little indeed is.

There is nothing but pride one should take in rolling one's own, however home-made they are. It is what makes LC so fun and powerful.

Anyway, really? Do you think that I have that low an opinion of you? I do not at all. Well, apart from your habit of posting handfuls of replies in succession. If you keep that up, you will surpass my total number of posts soon, and I will be heartbroken.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Dialog box selections using keyboard.

Post by richmond62 » Thu Feb 16, 2023 9:19 pm

Sorry to disappoint you, Craig, but you are not among that pair. 8)
apart from your habit of posting handfuls of replies in succession.
Err, just the way my mind works (or doesn't). :D

CAsba
Posts: 364
Joined: Fri Sep 30, 2022 12:11 pm

Re: Dialog box selections using keyboard.

Post by CAsba » Fri Feb 17, 2023 11:49 am

OK, I deleted the linesa

Code: Select all

set the traversalon of btn "YES" to true 
set the traversalon of btn "NO" to true 
and the tab still works, changing the focus from YES to NO and viceversa.
I'm pretty sure the tab didn't do this before, so now I'm at a loss as to how the tab now works ! However, it DOES.

stam
Posts: 2686
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Dialog box selections using keyboard.

Post by stam » Fri Feb 17, 2023 12:02 pm

CAsba wrote:
Fri Feb 17, 2023 11:49 am
...the tab still works, changing the focus from YES to NO and viceversa.
I'm pretty sure the tab didn't do this before, so now I'm at a loss as to how the tab now works ! However, it DOES.
Presumably you're on Windows.
As others mentioned this is the default system setting, and the modal is set to be consistent with the system.
Consequently this does not work by default on MacOS unless you change the system setting.
Unless I'm greatly misunderstanding the question?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Dialog box selections using keyboard.

Post by richmond62 » Fri Feb 17, 2023 1:48 pm

IF you are planning to produce standalones for other operating systems than the one you are developing on you had better be *&^%£#@! careful that 'things' behave on those systems in the same way as you have set them up on your home system.

As has been mentioned MORE THAN ONCE in this thread, the traversalOn default settings are different on different operating systems: so try to absorb and act on that bit of vital information before your modal dialogs go 'all funny' on clients' computers.

CAsba
Posts: 364
Joined: Fri Sep 30, 2022 12:11 pm

Re: Dialog box selections using keyboard.

Post by CAsba » Fri Feb 17, 2023 4:29 pm

Thanks, all of you, even for the bad press. I am suitably scolded. But perhaps I should give my point of view - though perhaps not meeting with universal approval.
Right, Here goes..
I have had NO training in any coding. I am 77 years old and my project is a retirement one, I retired from small business 8 years ago.
About 30 years ago I bought a business accounts package - TAS Books, which was a huge disappointment to me; it was sooo user-unfriendly. Eventually I got into it and it was good in many ways, but, it was written for accountancy professionals, and there were areas of it that remained baffling, when I would have to consult - and pay - the 'high priest', the accountant.
I picked up VBA (part of Excel) and made several handy programmes for the businesses I ran. I got quite familiar with VBA. When I retired I started a project, an accounts package that would be the ultimate tool for small business, to operate within Excel using VBA.
I spent 5 years of my spare time on it. Then I discovered one by one all the drawbacks of VBA, and looked for a better solution, and last August I got hold of LC, and I've made good progress. Now, here's the point.. I DO pick out the bits that I need for my project, and, to be frank, my attitude is a pragmatic one to drive the project on, with little interest in the larger view of LC. There, I've said it. I do hope this won't alienate me on the forum, which has been such a huge help to me, but I thought it necessary to explain 'where I'm coming from'.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Dialog box selections using keyboard.

Post by richmond62 » Fri Feb 17, 2023 5:44 pm

Well, I don't know about anyone else, but your contextualisation makes me
feel very pro you. 8)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Dialog box selections using keyboard.

Post by dunbarx » Fri Feb 17, 2023 5:57 pm

@CAsba. And I thought Jacque and I were the oldest people here. Do not overFret overmuch about the back and forth here. Nobody is mad at you. We have all been there.

@ Richmond. "Contextualization" is not a word allowed in Scrabble, so do not use it. Though in the dictionary, it will not fit on the board.

On the other hand, "overFret" is a word, especially in Scotland, but not permitted in Scrabble. It is permitted in LC-related posts such as this one, however, since I capitalized the "F".

Craig

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Dialog box selections using keyboard.

Post by mwieder » Fri Feb 17, 2023 6:51 pm

Why is overfret a word but underfret is not?
...and I see that overfrate is an "acceptable" past tense, which I find quite annoying.

https://en.wiktionary.org/wiki/overfret

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Dialog box selections using keyboard.

Post by jacque » Fri Feb 17, 2023 7:38 pm

CAsba wrote:
Fri Feb 17, 2023 4:29 pm
Thanks, all of you, even for the bad press. I am suitably scolded. But perhaps I should give my point of view - though perhaps not meeting with universal approval.
You have my universal approval, and I hope this thread hasn't scared you away from us.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Dialog box selections using keyboard.

Post by richmond62 » Fri Feb 17, 2023 7:50 pm

Ah, but wait a moment: I did NOT write 'contextualization', I wrote 'contextualisation', having at SIUC, Carbondale, got my feet wet by trying to be American, and just getting my feet wet producing Mid-Atlantic English [neither one thing nor the other].

AND while I am here I should state that I jalouse most umbrageously at 'dialog'. 8)

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”