Page 1 of 1

"clip" flag for gui text labels.

Posted: Fri Mar 31, 2017 3:36 pm
by dgnuff
It's been discussed elsewhere that making gui text labels wrap is not really possible with the current library in use.

Even so, is it possible to mark a label as single line, and then clip the text if it overflows. Even cutting it in the middle of a letter is OK, I just don't want it extending past maximal_width.

The aim is to get the effect of using the Win32 API DrawText() with the DT_SINGLELINE flag and not using the DT_NOCLIP flag. https://msdn.microsoft.com/en-us/librar ... s.85).aspx

Standard Code Rant applies here: I haven't seen the source so I have no idea how hard this is, or if it's even possible. :)

Re: "clip" flag for gui text labels.

Posted: Fri Mar 31, 2017 5:06 pm
by Klonan
In 0.15 you can set labels to wrap properly across multiple lines

Re: "clip" flag for gui text labels.

Posted: Sat Apr 01, 2017 3:29 am
by dgnuff
My apologies, I didn't make it 100% clear what I want.

Firstly, it's great to hear that wrapping text is coming in 0.15. However, in my use case, I have a label that I'm using as part of a row in a scroll-pane. In this instance, I only want it to show a single line of text so that I can strictly control the height of each row in the scroll-pane. Since the text is generated at run time, it's possible that it may overflow the width I've set for the field.

I don't know the details of the library you're using, but if my hypothetical clipping was enabled, then you'd take the first point where you've split the text into multiple lines, and simply discard the second and subsequent lines.

Re: "clip" flag for gui text labels.

Posted: Sat Apr 01, 2017 9:17 am
by Klonan
dgnuff wrote:My apologies, I didn't make it 100% clear what I want.

Firstly, it's great to hear that wrapping text is coming in 0.15. However, in my use case, I have a label that I'm using as part of a row in a scroll-pane. In this instance, I only want it to show a single line of text so that I can strictly control the height of each row in the scroll-pane. Since the text is generated at run time, it's possible that it may overflow the width I've set for the field.

I don't know the details of the library you're using, but if my hypothetical clipping was enabled, then you'd take the first point where you've split the text into multiple lines, and simply discard the second and subsequent lines.
Thats also added in 0.15, where if its too long is will simply clip the string and add '...' to the end