Does DAZ Script have any way of detecting the user's screen dimensions
Thread seconded from the original (foolish) question "Make Text Wrap In A DzWidget/Dialog/BasicDialog ?" to a new question "does DAZ Script have any way of detecting the user's screen dimensions"
Original (foolish) question "Make Text Wrap In A DzWidget/Dialog/BasicDialog ?"
What the title says, preceded by "How do I..."
Hopefully the answer's really obvious and it's another case of not being able to see the tree for the woods...
var wDlg = new DzBasicDialog;
var wWbLbl = new DzLabel( wDlg );
wWbLbl.text = "Blah, blah, blah, blah, ...ad infinitum..."
If 'text' is long with no <br> then the dialog stretches over the left/right edges of the screen. Anything I try to do with width, minwidth, setWidth, etc affects the dialog but the text doesn't wrap.
Comments
Thinks: Maybe a DzLabel is intended to be short, and not wrap ? Maybe I should be using something else...
...not a DzTextEdit as I just want to display the text.
Maybe a DzTextBrowser ?
Yay! Answered my own question.
<--- What it used to say there (reminder to self: change avatar - done!
Hmmm... all of that should really have been an inner monologue. But I'm bored.
Might as well not waste this thread...
So also on the topic of making dialog width/height appropriate to both content and display size:
Does DAZ Script have any way of detecting the user's screen dimensions ? Or may the DAZ Studio window dimensions ? Or something along those lines ?
DzLabel::wordWrap
If set to true, the text is wrapped where necessary at word-breaks; otherwise it is not wrapped.
-Rob
Global::getDesktop() returns a QDesktopWidget, which derives from QWidget. QWidget provides several dimension related properties.
Although the documentation doesn't currently state as much, DzMainWindow is derived from QWidget.
-Rob
Thanks Rob.