Page 1 of 1

Howto wordwrap in XML dialogue text gadget?

Posted: Thu Aug 28, 2014 12:29 pm
by Kukulkan
Hello,

I like to add some explaining text in an XML dialogue like this:

Code: Select all

<text name='txtInfo' text='This is to help you setting up your e-mail account settings. Please enter your e-mail address and password. Now click on -Check- to detect your mailserver settings.' />
<button name='btnCheck' text='Check'  />
<hbox>
  <button name='btnCancel' text='Cancel' />
  <button name='btnOK' text='OK'/>
</hbox>
Obviously, txtInfo contains a very long text and the dialogue is getting way to wide trying to do all in one line. I tried to insert linebreaks but this seems not possible. Best would be to have the field hitting a maximum width and then do wordwrap. The height has to automatically fit so that the following elements are in good position.

How to do?

Kukulkan

Re: Howto wordwrap in XML dialogue text gadget?

Posted: Thu Aug 28, 2014 12:39 pm
by Fred
You can put your own tag in it, and then use Get/SetGadgetText(). I don't know if it will be properly resized tough.

Re: Howto wordwrap in XML dialogue text gadget?

Posted: Thu Aug 28, 2014 2:11 pm
by Kukulkan
Hi Fred,

There is no gadget-type available to simply display multiline text with wordwrap? I thought I only missed something. :|

But it will not auto-fit the sizes, right? It seems to respect linebreaks by using SetGadgetText(), but no auto-size and I need to know all sizes before to use width and height. But my text is multi-language and will change in size. And users may have different DPI settings so my pixel height and width will fail for this field, too.

How to solve?

Kukulkan

Re: Howto wordwrap in XML dialogue text gadget?

Posted: Thu Aug 28, 2014 2:36 pm
by Kukulkan
I just found out that using &#xA; as a linebreak in XML seems to work (at least on Windows, did not test on others yet). In such case the size seems to be automatically chosen. But no wordwrap at all. Not very satisfying as my translator is now responsive for the layout...

Kukulkan

Re: Howto wordwrap in XML dialogue text gadget?

Posted: Thu Aug 28, 2014 7:00 pm
by Little John
Kukulkan wrote:But no wordwrap at all. Not very satisfying as my translator is now responsive for the layout...
Hi,

unfortunately, I don't have any additional information about the behaviour of PB's XML dialogs.
But when your program has to do word wrap itself, then some code in this thread might be helpful.