How to present a dialog box with focus.

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

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

How to present a dialog box with focus.

Post by CAsba » Wed Mar 08, 2023 1:00 pm

Hi
Is there any way that the user may be presented with an answer dialog box where the cursor is already flashing in the answer dialog box, so enabling the user to enter data without first having to click in the dialog box?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: How to present a dialog box with focus.

Post by richmond62 » Wed Mar 08, 2023 1:37 pm

I think you will have to 'roll your own', which is really very easy.

BUT I think you mean ASK, not ANSWER:

ANSWER:
-
Screen Shot 2023-03-08 at 2.33.15 PM.png
-
ASK:
-
Screen Shot 2023-03-08 at 2.34.33 PM.png
-
AND the Focus is already present with ASK.

SO: can you explain (maybe with a picture) what you need?

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

Re: How to present a dialog box with focus.

Post by CAsba » Wed Mar 08, 2023 1:53 pm

Hi Richmond 62,
Many thanks for your quick reply.
I should have said ASK in my question to you, I am using the ASK in the code. However, the cursor is NOT present..
Sorry, I haven't a clue how to make a picture of the dialog box.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: How to present a dialog box with focus.

Post by richmond62 » Wed Mar 08, 2023 2:00 pm

I don't know which operating system you are working with: but all the systems
for development supported by LiveCode have a way to take screen shots.

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

Re: How to present a dialog box with focus.

Post by CAsba » Wed Mar 08, 2023 2:52 pm

Hi again,
I looked into taking a screen shot, made a jpeg of it, copied to clipboard, but it wouldn't paste into here. Not to worry m- that's not the main point, which is, that the dialog box, coded by

Code: Select all

ask question "Enter the business name." titled field "fieldboxtitle"  of cd "template1" 
does not show a cursor in the box. Any idea how to remedy this ?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: How to present a dialog box with focus.

Post by richmond62 » Wed Mar 08, 2023 3:03 pm

You do NOT paste images here:
-
Screen Shot 2023-03-08 at 3.58.50 PM.png
-
You ADD FILES and then:
-
Screen Shot 2023-03-08 at 3.59.42 PM.png
-
Insert them into the text using the 'Place inline' button.

And your code makes no sense to me at all, I'm afraid.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: How to present a dialog box with focus.

Post by richmond62 » Wed Mar 08, 2023 3:11 pm

The first reason is because you did NOT do as I told you: use ASK:
-
Screen Shot 2023-03-08 at 4.09.18 PM.png
-
You have to make an effort to follow instructions..
-

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

Re: How to present a dialog box with focus.

Post by Klaus » Wed Mar 08, 2023 3:26 pm

On MacOS 12.6.3 on INTEL with LC 9.6.9 rc2 I also do NOT get a blinking cursor with a simple -> ask "whatever..."

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

Re: How to present a dialog box with focus.

Post by CAsba » Wed Mar 08, 2023 3:32 pm

Hi
I thought my line

'I should have said ASK in my question to you, I am using the ASK in the code.'

would have made it clear that I made a mistake in my original post, when I indicated, wrongly, that it was with an Answer dialog, when I should have said that it was with an Ask dialog.

So yes, I have been using the Ask dialog all along, and the cursor has not appeared in the input line until the box is clicked. Hope this is clear, now, sorry I have caused a bit of a kerfuffel.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: How to present a dialog box with focus.

Post by dunbarx » Wed Mar 08, 2023 4:25 pm

I always get a blinking cursor in an "Ask" dialog. There are occasions when I do not, but they are rare, and always are invoked in a long-running handler.

Always have. Mac, of course.

Craig

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

Re: How to present a dialog box with focus.

Post by CAsba » Wed Mar 08, 2023 5:18 pm

I should have mentioned, I'm using Windows. Any body any ideas how to force the cursor to be present in the ASK dialog box ?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: How to present a dialog box with focus.

Post by richmond62 » Wed Mar 08, 2023 5:41 pm

Personally I'd go back to my earlier idea and make my owe palette substack to do exactly what I wanted, the way I wanted.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: How to present a dialog box with focus.

Post by jacque » Wed Mar 08, 2023 6:18 pm

Just as a diagnostic, what happens if you type this plain version in the message box?

Code: Select all

ask "What's your name?" 
If that works, we can test with the other parameters.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: How to present a dialog box with focus.

Post by jacque » Wed Mar 08, 2023 6:21 pm

richmond62 wrote:
Wed Mar 08, 2023 3:03 pm
And your code makes no sense to me at all, I'm afraid.
See the dictionary where all the optional parameters are listed.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: How to present a dialog box with focus.

Post by richmond62 » Wed Mar 08, 2023 7:05 pm

I did see the dictionary:
-
SShot 2023-03-08 at 20.03.45.png
-
BUT, did not really equate what I saw there with this:

Code: Select all

ask question "Enter the business name." titled field "fieldboxtitle"  of cd "template1" 
-
SShot 2023-03-08 at 20.08.46.png

Post Reply