Page 1 of 1

custom answer boxes

Posted: Sun Jan 07, 2018 8:28 pm
by Da_Elf
Im not sure if you can customise the ones that are built in or if i would have to code my own answer pop up. I know i can design it to be a warning with an OK and Cancel but it would also be nice to have a checkbox that says "Don't show this warning again". I assume im going to have to create my own thing.

Re: custom answer boxes

Posted: Sun Jan 07, 2018 8:48 pm
by bogs
Well, that was how I went making this -
Image
but from what I understand you should be able to customize the ask and answer dialogs pretty far. I haven't done it yet, but dialogData is a global that should be returning the information you ask for is what I got out of my reading of this page.

I doubt something like your talking about is going to be all that complicated either road.

Re: custom answer boxes

Posted: Sun Jan 07, 2018 10:34 pm
by Da_Elf
Holy crap thats so awesome. This would be exactly what i need and this opens so many more possibilities. wow. thanks.

Re: custom answer boxes

Posted: Sun Jan 07, 2018 10:36 pm
by dunbarx
It is possible to modify the "text" portion of these dialogs, but I do not know if it is possible to modify the controls that are pre-packaged with them.

I would roll your own, as you suspected. That is easy, likely easier that modifying the global that Bogs mentioned. And then you can change its size, color, whatever. Heck, you could even open a DG of type form, but I am hoping that is vastly overkill.

Craig Newman

Re: custom answer boxes

Posted: Sun Jan 07, 2018 10:54 pm
by Newbie4
It is easier to create your own "dialog". It just takes a substack that you set as "modal". It can replace your "ask" or "answer" dialog.
Modal - for blocking other actions
A modal dialog box is a window/stack that blocks all other actions as long as the stack is displayed. An example is "Ask" and "Answer" dialog boxes. You can not do anything else as long as it is open.
1. Create a substack and design your dialog box on it
2. On your original stack

Code: Select all

modal stack "Pop-up" 
or
go stack "Pop-up" as modal
That's it

For a simple example see here: https://sites.google.com/a/pgcps.org/li ... s_palettes

Re: custom answer boxes

Posted: Sun Jan 07, 2018 11:59 pm
by bogs
Da_Elf wrote:
Sun Jan 07, 2018 10:34 pm
Holy crap thats so awesome. This would be exactly what i need and this opens so many more possibilities. wow. thanks.
My pleasure, glad to be able to help :)

As the others mentioned, rolling your own isn't overly complicated either, in fact it was scary easy.

I am curious as I've seen differing opinions as to the advantage of opening it as 'modal' vs. 'modeless'. Modal is blocking right? In other words, you can't interact with any other windows until the modal one is dismissed?

And modeless would allow interaction with things even when the dialog is up? Curious as to what others think is better and why.

BTW, good explanations on the page linked in newbie's post.

Re: custom answer boxes

Posted: Mon Jan 08, 2018 1:13 am
by Da_Elf
using modal was what i needed so it would block everything else while waiting for a reply.
seeing as i was creating one of those pesky warning boxes that say Ok or Cancel i wanted a check mark too to allow my to say "Dont show this warning again". This allows me to perfectly send back an ok or cancel along with the highlight of the checkbox

Re: custom answer boxes

Posted: Mon Jan 08, 2018 6:16 pm
by MaxV
The text of answer or ask is intepreted as htmlText, so you can use HTML to produce cool effect.
For example:

Code: Select all

answer error "<b>Noooo!</b> <br>You shouldn't have clicked that button..."
Nooo.png
Nooo.png (6.18 KiB) Viewed 8643 times

Re: custom answer boxes

Posted: Mon Jan 08, 2018 9:19 pm
by bogs
Oh that is too cool Max 8)
Image

Re: custom answer boxes

Posted: Mon Jan 08, 2018 9:58 pm
by Newbie4
You can also modify fields using the htmlText property.
See #2 on this webpage - https://sites.google.com/a/pgcps.org/li ... euser/html

but the most common use of it is for showing HTML content without the HTML tags.
See #3 on the same webpage - https://sites.google.com/a/pgcps.org/li ... euser/html