Hello,

I'm using the Dialog contribution to create a login window, but I cannot get
the thing to center in the page and it's frustrating me.  I changed the
image to a slightly bigger one, and if I resize the page it'll center, but
it won't center when I initially render it.

Here is my code:

createLogin : function()
  {
    var loginWidget = new dialog.Login({
      image       : "foo_small.gif", 
      text        : "Welcome to Foofoo..",
      callback    : this.loginCallbackFunc,
      context     : this,
      maxWidth    : 600
    });
    loginWidget.addListener("loginSuccess", function(e){
      dialog.Dialog.alert( "You are now logged in. Or at least we pretend."
);
    });
    loginWidget.addListener("loginFailure", function(e){
      dialog.Dialog.alert(e.getData());
    });
    var self = this;
    loginWidget.addListener("registerRequest", function(e) {
      self.registerWizard();
    });
    qx.ui.core.queue.Manager.flush();
    loginWidget.setAlignX("center");
    loginWidget.setAlignY("center");
    var bounds = loginWidget.getBounds();
    loginWidget.set({
      marginTop: Math.round( ( qx.bom.Document.getHeight() -bounds.height )
/ 2),
      marginLeft : Math.round( ( qx.bom.Document.getWidth() -bounds.width) /
2)
    });
    
    loginWidget.show();
  },

I tried setAlign and also by setting the margins manually, but that doesn't
work.  I tried loginWidget.center() but that's not supported.  Can anyone
assist?  It's about 100 pixels off from center and it's driving me nuts. 
Thank you.

It's invoked with a simple createLogin(); from the main function.
-- 
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Centering-Window-with-Dialog-Contribution-tp5987271p5987271.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to