Hey, you fooled me! :D (I hope the text is correct, bad bad school
english...)

At bugzilla (hadn't found it before, sorry) is a bug entry for that case:
http://bugzilla.qooxdoo.org/show_bug.cgi?id=197

Til Schneider had written a workaround:

labelMainText._changeInnerWidth = function(newValue, oldValue) {
  var node = this._copyStyles();
  node.innerHTML = this.getHtml();
  node.style.width = newValue + "px";
  this.setHeight(node.offsetHeight);

  return qx.ui.basic.Label.prototype._changeInnerWidth.call(this, newValue,
oldValue);
}


It doesn't work for me this way because _changeInnerWidth   is never
called here when I used it (as I understand it I would overwrite an
internal function, so in didn't call it by myself), but as separate code
after creation

var node = labelMainText._copyStyles();
node.innerHTML = labelMainText.getHtml();
node.style.width = "300px";
lalert(node.offsetHeight);
labelMainText.setHeight(node.offsetHeight);

it works, the label got the right height.

Screenshot: http://www.running-gag.de/solvedlabelqooxdoo.png

Greetings,
  Leander Hanwald

Sebastian Werner schrieb:
> Hi!
>
> multi line labels (with auto width) do not correctly support the 
> calculation of preferred height. A workaround is to insert "<br/>" in 
> the places where you want to have a line break. But this is manual and 
> is not the same than auto matic wrapping. This features is definitely on 
> our list for qx 0.8.
>
> Sebastian
>
>
>
>
> Leander Hanwald schrieb:
>   
>> Hello all,
>>
>> I have a problem with multiline labels.
>>
>> Example screenshot:
>> http://www.running-gag.de/labelproblemqooxdoo.png
>>
>> As you can see the label in the middle (which is multilined) hasn't a
>> right height set. Height is set to auto , width to 300px. I need
>> multiline and don't know the line count (html is possible there, too).
>>
>> I know that there are older mails in the mailing list about this, but no
>> solution is said there. Is this still not working, or had I simply not
>> found the right solution?
>>
>> Exmaplecode:
>>
>> ...
>> var labelInfo1 = new qx.ui.basic.Label("<h1>Überschrift 1</h1>");
>> this._middleGrid.add(labelInfo1);  
>>   
>> var labelMainText = new qx.ui.basic.Label("LONG LABEL TEXT CUTTED");
>>
>> labelMainText.setWidth(300);
>> labelMainText.setHeight("auto");
>> labelMainText.setWrap(true);
>> labelMainText.setFontPropertiesProfile("multiline"); 
>> labelMainText.setBorder(new qx.renderer.border.Border(1, "inset",
>> "black")); 
>>    
>> this._middleGrid.add(labelMainText);    
>>
>> var labelInfo2 = new qx.ui.basic.Label("<h1>Überschrift 2</h1>");
>> this._middleGrid.add(labelInfo2);     
>> ...
>>
>>
>>
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share your
>> opinions on IT & business topics through brief surveys-and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>     
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>   


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to