Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14258
Registered: November 2005
Ultimate Member
Pradip wrote on Mon, 22 March 2021 06:38
Yesss, 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 Very Happy


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...
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: search in Report
Next Topic: Bugfix: Report header/footer looks good in dark mode, not dark
Goto Forum:
  


Current Time: Wed May 14 23:11:14 CEST 2025

Total time taken to generate the page: 0.03455 seconds