No hints for me?
One way to do this could go this way:
var d = qx.ui.core.ClientDocument.getInstance();
d.add(window);
window.addEventListener("appear", function() {
var left = (d.getClientWidth() - window.getBoxWidth()) / 2;
var top = (d.getClientHeight() - window.getBoxHeight()) / 2;
window.setLeft(left < 0 ? 0 : left);
window.setTop(top < 0 ? 0 : top);
}
This works in general, but there are missed two things: I do not want to
center the window above the whole browser screen, we only need the visible
area. And if the scrollbars are moved down or right I have to add the
scrolled value.
But d.getScrollTop() brings up "0" at any point (at least in Firefox).
Some help would be nice.
westor wrote:
>
> how can I center a window if I use qooxdoo inside html (inline widget)?
> window.centerToBrowser() does not work well.
> And by the way: is it correct to add the popup window to
> qx.ui.basic.Inline() or better to qx.ui.core.ClientDocument.getInstance()?
> Thnx Torsten
>
>
--
View this message in context:
http://www.nabble.com/centerToBrowser-and-qx.ui.basic.Inline-tp15791991p15833987.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel