Post 13 made on Sunday June 2, 2019 at 11:36 |
sebastian Long Time Member |
Joined: Posts: | September 2003 93 |
|
|
I didn't know that you could extend the builtin JS classes so easily - that's useful :)
I have now added some code that checks if the number of buttons fits into the specified width and if not, increases the dialog's width accordingly. Then the message text is wrapped (using your code example - thanks again for that) to fit the message panel width, increasing its height, if necessary.
So basically, specifying a width and height of "1" should still get you a decent-sized dialog.
All within limits, of course - an "auto-sized" single button dialog will be pretty narrow, so it won't fit much text. And there's no "plan B" if you specify too many buttons or too much text to fit the screen. (maybe I should marry the word wrap code to the button placement, so one could have multiple lines of buttons.... just kidding ;-)
I'm also calling the close() function from onExit() now, as you suggested.
Sebastian
|
|
|