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 #56514 is a reply to message #56492] Sat, 20 March 2021 12:59 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14258
Registered: November 2005
Ultimate Member
Pradip wrote on Fri, 19 March 2021 06:23
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?


You cannot use DrawTextEllipsis there.

This is though one. If I really needed this, I would probably:

- create temporary RichText just for testing with the cell of correct width and with intended font
- measure the height of text (with GetHeight)
- put the inteded text into this cell
- keep shortening the text until the height matches (you can use binary search to make this log(len(text)))
- use this shortened text in the real table.

Not very elegant, but not that hard to implement and should work...

Mirek
 
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 20:28:43 CEST 2025

Total time taken to generate the page: 0.01004 seconds