On Sun, Aug 14, 2011 at 11:41, franck34 <[email protected]> wrote:

> +1
>
> (right now, i'm trying to focus the ok button in error/warning dialog, and
> add a callback when dialog is closed)
>

Try something like this entirely untested code, for nearly equivalent
functionality:

qx.Mixin.define("my.MEnterSameAsOk",
{
  members :
  {
    // override this method to add a Command to the Ok button
    _createOkButton : function()
    {
      var okButton = this._okButton =  new qx.ui.form.Button(this.tr("OK"));
      okButton.setIcon("icon/22/actions/dialog-ok.png")
      okButton.setAllowStretchX(false);
      okButton.addListener("execute", this._handleOk, this);

      // If Enter is pressed, it should act as if the Ok button were
clicked.
      command = new qx.ui.core.Command("Enter");
      okButton.setCommand(command);

      return okButton;
    }
  }
});

Then patch Dialog to use your replacement function. Insert this line
someplace in your application. In main() is a good place:

qx.Class.patch(dialog.Dialog, my.MEnterSameAsOk);

Derrell
------------------------------------------------------------------------------
FREE DOWNLOAD - uberSVN with Social Coding for Subversion.
Subversion made easy with a complete admin console. Easy 
to use, easy to manage, easy to install, easy to extend. 
Get a Free download of the new open ALM Subversion platform now.
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to