Home » U++ Library support » RichText,QTF,RTF... » Text wrapping in QTF Table
Text wrapping in QTF Table [message #56492] |
Fri, 19 March 2021 06:23  |
 |
Pradip
Messages: 109 Registered: February 2019 Location: India
|
Experienced Member |
|
|
Hi guys,
I'm trying to make a QTF table, and it's needed to have all rows with exactly same row height, without wrapping Strings in the cells but truncating and probably adding an ellipsis character. I found DrawTextEllipsis() routine but not sure how could I use it in QTF.
Any ideas?
Regards,
Pradip
[Updated on: Fri, 19 March 2021 06:23] Report message to a moderator
|
|
|
|
|
Re: Text wrapping in QTF Table [message #56530 is a reply to message #56529] |
Mon, 22 March 2021 07:58   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
Pradip wrote on Mon, 22 March 2021 06:38Yesss, I had started working in that line! Thanks a lot Mirek!
I think you meant to measure the width, not height, with GetWidth(), I've seen this works! I'm planning to measure the width of the intended ellipsis character as well and shorten the text and add the ellipsis to fit in the cell width. It will suffice as long as it works, needn't be too elegant 
I really meant Height. I guess width will work too, but maybe less reliably and more complicated.
Quote:
But how to implement the binary search with log(len(text)) (which I think will save few iterations)?
Think of it as function - the parameter is the number of characters you have to remove. This goes from 0 to len(text).
To maximize it, you start at len/2. If it fits, the correct number is in len/2, len range. If not, in 0 to len/2. Rinse and repeat...
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 20:32:48 CEST 2025
Total time taken to generate the page: 0.00948 seconds
|