Does DAZ Script have any way of detecting the user's screen dimensions

3dcheapskate3dcheapskate Posts: 2,689

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.

Post edited by 3dcheapskate on

Comments

  • 3dcheapskate3dcheapskate Posts: 2,689

    Thinks: Maybe a DzLabel is intended to be short, and not wrap ? Maybe I should be using something else...

     

  • 3dcheapskate3dcheapskate Posts: 2,689

    ...not a DzTextEdit as I just want to display the text.

    Maybe a DzTextBrowser ?

  • 3dcheapskate3dcheapskate Posts: 2,689
    edited March 2016

    Yay! Answered my own question.

    <--- What it used to say there  blush (reminder to self: change avatar - done!

    Hmmm... all of that should really have been an inner monologue. But I'm bored.

    Post edited by 3dcheapskate on
  • 3dcheapskate3dcheapskate Posts: 2,689
    edited January 2016

    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 ?

    Post edited by 3dcheapskate on
  • rbtwhizrbtwhiz Posts: 2,217

    Original (foolish) question "Make Text Wrap In A DzWidget/Dialog/BasicDialog ?"

    ...

    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.

    DzLabel::wordWrap

    If set to true, the text is wrapped where necessary at word-breaks; otherwise it is not wrapped.

    -Rob

  • rbtwhizrbtwhiz Posts: 2,217
    edited March 2016

    Does DAZ Script have any way of detecting the user's screen dimensions ?

    Global::getDesktop() returns a QDesktopWidget, which derives from QWidget. QWidget provides several dimension related properties.

    Or may the DAZ Studio window dimensions ?

    Although the documentation doesn't currently state as much, DzMainWindow is derived from QWidget.

    -Rob

    Post edited by rbtwhiz on
  • 3dcheapskate3dcheapskate Posts: 2,689

    Thanks Rob.

Sign In or Register to comment.