I want to wrap the text in a table cell and used the following approach,
since there is no qx.ui.table.cellrenderer.Label:

1) split the text into words
2) calculate the width of each word
3) check if it fits in the cell using the cellWidth and the total of the
preceding words
4) add a <br/> when it does not fit anymore

Basically this works fine, and since I only use it for a single row in my
table, there is no issue with performance.
The problem is, that the cellWidth is expressed in pixels and the width of a
word in some other unit.

For 2) I do the following:
(this refres to an extended class of qx.table.cellrenderer.Abstract)
style = this._getCellStyle(cellInfo);
width = qx.bom.Label.getTextSize(words[i], style).width; (note that
getHtmlSize gives the same result)

It looks to me that the current font is not used. Is there a way to obtain
this? Should I change the content of my variable "style"? And if so, with
what values?

Or should I use a different approach?

Rob
-- 
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Wrap-text-in-a-tablecell-tp5509630p5509630.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to