Answer dialog enhancement...

J. Landman Gay jacque at hyperactivesw.com
Tue Mar 31 20:35:41 EDT 2020


I had to create my own for mobile since the default didn't do what I 
wanted. I implemented it as a group. When the user hits the OK button it 
places the response in the dialogdata and sends a message to the card. The 
card has a handler that captures the message and gets the dialogdata to do 
what it needs. If the user cancels, the dialogdata contains "cancel".

I keep the group in an unplaced background, and when I need it I copy it to 
the card. When it's dismissed I delete it. That way I don't need to include 
it on all the cards. I trigger it with a command that passes any necessary 
data to the group as parameters.

I don't think it's possible to remove the answer dialog from an app, the 
last time I tried it reselected itself, so I just ignore it. Since I was 
using it on mobile this works pretty well, but on desktop it would be 
confined to the card rect. You could do the same thing with a stack, which 
would eliminate the need to copy anything.

--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On March 31, 2020 6:11:51 PM Paul Dupuis via use-livecode 
<use-livecode at lists.runrev.com> wrote:

> On 3/31/2020 6:10 PM, Bob Sneidar via use-livecode wrote:
>> The answer dialog is simply a stack in and of itself if I am not mistaken. 
>> I’m wondering if you couldn’t find that stack and clone it for your own 
>> purposes…
>>
>> Bob S
>
> Yes. That is easy enough. Turn on "Show IDE Stacks in List" from the
> "View" menu and there are the Answer and Ask Dialogs.
>
> Then you need to work out how the Answer command passes its data via
> "the dialogData" property into order to create an alternative calling
> routine that sets up the Don't Ask Again check box
>
> You could copy the Answer to your own project  and in the Standalone
> Settings switch to Manual Inclusions and exclude the Answer Dialog. Then
> I believe the answer command will use the copy of the dialog in your
> project. Then you need to add the button, change the resizeStack
> handlers accordingly, script its show and hide, add code to get the
> return value
>
> AND remember to see if the dialog needs updates with each new release of
> LiveCode.
>
> That is why I asked if anyone has already done it so as to not re-invent
> the wheel.
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode






More information about the use-livecode mailing list