Page 1 of 2

customizing the answer dialogue box

Posted: Sun Sep 08, 2019 8:31 pm
by paulalsmith1000
Evening Everyone

Just a quick question, does anyone know how to customize the background and/or text colour of the the answer dialogue box.

I searched around for a while and found variations on this:-

on preOpenStack
set the backgroundColor of this stack to black
if the environment is "standalone application" then set the backgroundColor of stack "Answer Dialog" to 231,231,231
set the loc of this stack to the screenLoc
end preOpenStack

It works fine on the desktop, but doesn't on android?

Kind regards

Paul

Re: customizing the answer dialogue box

Posted: Sun Sep 08, 2019 10:00 pm
by Klaus
Hi Paul,

the ASK and ASNWER diakogs are just stacks, but only on desktop system Mac/Win/Linux!

On the mobile platforms iOS and Android, these dialogs are supplied from the underlying OS
and you cannot modify them.


Best

Klaus

Re: customizing the answer dialogue box

Posted: Sun Sep 08, 2019 11:24 pm
by jmburnod
Hi Paul,
When i need a custom dialog I use a group which works for OS X and iOS :D
Best regards
Jean-Marc

Re: customizing the answer dialogue box

Posted: Sat Sep 21, 2019 7:09 pm
by paulalsmith1000
Hi Jean-Marc and Klaus

Many thanks for your replies.

I googled around and found that I could use sub-stacks instead of the dialogue boxes so that I could customize their appearance, which has worked a treat.

But unsurprisingly I have hit a slight snag - the only thing I can't seem to do is fix/loc the size of these stacks.

I used this site (https://sites.google.com/a/pgcps.org/li ... s_palettes) to set up the substacks. I can resize them happily on the desktop (ubuntu) so they look like dialogue boxes (as in the link above) however, when I deploy the app to my android phone they are all full-screen.

Any ideas would be much appreciated.

Kind regards

Paul

Re: customizing the answer dialogue box

Posted: Sat Sep 21, 2019 7:57 pm
by richmond62
I'm not sure I understand why your faux dialogue boxes are going full-screen on Android, but
my best bet would be to have this sort of code in the openStack script of your dialogue:

Code: Select all

on openStack
	set the width of this stack to 100
	set the height of this stack to 30
end openStack
Certainly worth a try. 8)

Re: customizing the answer dialogue box

Posted: Sat Sep 21, 2019 8:09 pm
by bogs
Mind you, I don't do ... well, anything with mobile devices :D but, since this is a stack your putting in your app to simulate a dialog, is it possible you have the rest of the app set to ...what is it, full screen or some such?

*IF* your app is set to whatever amounts to full screen, and doesn't know the sub stacks are not supposed to be full screen, that might cause the issue your describing. I am pretty sure Lc would be using something like the android api for dialog boxes itself, so likely the dialogs you get will show up like an android dialog {this is a complete guess on my part!!}.
The Dialog class is the base class for dialogs, but you should avoid instantiating Dialog directly. Instead, use one of the following subclasses:

AlertDialog
A dialog that can show a title, up to three buttons, a list of selectable items, or a custom layout.
DatePickerDialog or TimePickerDialog
A dialog with a pre-defined UI that allows the user to select a date or time.
I'm curious, though, as to why you would have to design a dialog? Is it doing something really non standard?

Re: customizing the answer dialogue box

Posted: Sat Sep 21, 2019 10:57 pm
by jmburnod
Hi Bogs,
I'm curious, though, as to why you would have to design a dialog? Is it doing something really non standard?
I used one group as ask/answer dialog if I need to choose a line of a list or several menus, checkboxes or radio buttons or...
Best regards
Jean-Marc

Re: customizing the answer dialogue box

Posted: Sun Sep 22, 2019 10:02 am
by richmond62
Evening Everyone
-
DODG.jpg
DODG.jpg (13.89 KiB) Viewed 7565 times
-
I'm curious, though, as to why you would have to design a dialog? Is it doing something really non standard?
Well, it could be, or it might be . . .

Or, just maybe, you want them to look a bit different from the standard dialogues
and more in keeping with the aesthetic of your program:
-
Quit.jpg
-
Delete.jpg
-
AND the real problem is why Devawriter Pro did NOT save the omkara at the start of the first line of Sri Isopanisad. :roll:
-
SERIOUSLY . . . the two "dialogue stacks" in my screenshots from Devawriter Pro are NOT stacks at all;
they are 'just' layered images . . .

Each "dialogue stack" consists of one pictorial image (the "stack") and a "YES" image and a "NO" image.

this guarantees you have 100% control over what they look like and ensures nothing outwith
your control distorts or resizes them. 8)

Re: customizing the answer dialogue box

Posted: Sun Sep 22, 2019 11:06 am
by [-hh]
@paul
AlertBuilder may give you some ideas:
http://livecodeshare.runrev.com/stack/804/

It creates a draggable windowshaped dialog which disappears after a given time (with countDown).

Re: customizing the answer dialogue box

Posted: Sun Sep 22, 2019 1:12 pm
by paulalsmith1000
Hi Bogs

The reason is because I wanted the dialog boxes to match the colour scheme of the rest of the app, but I understand this isn't possible?

If it was that would be perfect.

Kind regards

Paul

PS I wil try your suggestions, many thanks

Re: customizing the answer dialogue box

Posted: Sun Sep 22, 2019 1:18 pm
by richmond62
but I understand this isn't possible
Utter Nonsense!

Go back and read my posting about how I faked dialogue boxes for my
Devawriter Pro app, and if you've still go questions come back: I'm "here" and I'm ready to help. :D

Re: customizing the answer dialogue box

Posted: Sun Sep 22, 2019 2:22 pm
by bogs
I'd agree that sounds like nonsense, but not the way Richmond was thinking :wink:

Of course, I don't play with mobile, maybe it doesn't work this way there, but you *might* try something like this ~
answerDialogBackgroundColor.png
Any color you like, as long as it is GREEN!
Mind you, this is pretty brute force~ish, if you do use this command in the IDE it will make *all* the dialogs green :P Be safer than I am, and store the original bg color first, although I think just setting the same to "" restores it.

In your case, of course you wouldn't use a name for the color, use 'to the bgcolor of {your stack your trying to match}' instead.

Re: customizing the answer dialogue box

Posted: Sun Sep 22, 2019 3:10 pm
by Newbie4
Have you tried using html in some fashion? I don’t know if this will work with the way you are doing it but it is worth a try.
See “html tricks” - https://sites.google.com/a/pgcps.org/li ... euser/html

Re: customizing the answer dialogue box

Posted: Sun Sep 22, 2019 3:49 pm
by richmond62
Screenshot 2019-09-22 at 17.47.31.png
-
Screenshot 2019-09-22 at 17.47.36.png

Re: customizing the answer dialogue box

Posted: Sun Sep 22, 2019 3:57 pm
by bogs
I should add, before it is mis-construed, I have not a thing against custom dialogs and I do make a LOT of them myself. I also want to point out that Richmond's way is certainly do-able as well, which I never had any doubt of :wink:

I was just wondering why you can't set up the default dialog to be.....well, almost anything you want it to be is all. Look at it as a curiosity question from someone that doesn't do anything on the mobile end of things :twisted: