Page 1 of 2

How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 1:00 pm
by CAsba
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?

Re: How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 1:37 pm
by richmond62
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?

Re: How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 1:53 pm
by CAsba
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.

Re: How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 2:00 pm
by richmond62
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.

Re: How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 2:52 pm
by CAsba
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 ?

Re: How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 3:03 pm
by richmond62
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.

Re: How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 3:11 pm
by richmond62
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..
-

Re: How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 3:26 pm
by Klaus
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..."

Re: How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 3:32 pm
by CAsba
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.

Re: How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 4:25 pm
by dunbarx
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

Re: How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 5:18 pm
by CAsba
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 ?

Re: How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 5:41 pm
by richmond62
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.

Re: How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 6:18 pm
by jacque
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.

Re: How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 6:21 pm
by jacque
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.

Re: How to present a dialog box with focus.

Posted: Wed Mar 08, 2023 7:05 pm
by richmond62
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