Home » U++ Library support » RichText,QTF,RTF... » Text wrapping in QTF Table
Re: Text wrapping in QTF Table [message #56530 is a reply to message #56529] |
Mon, 22 March 2021 07:58   |
 |
mirek
Messages: 14258 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: Wed May 14 17:18:03 CEST 2025
Total time taken to generate the page: 0.03247 seconds
|