diff --git a/demo/default/source/class/dialog/demo/Application.js b/demo/default/source/class/dialog/demo/Application.js index a3b9c69..b7fe966 100644 --- a/demo/default/source/class/dialog/demo/Application.js +++ b/demo/default/source/class/dialog/demo/Application.js @@ -50,11 +50,6 @@ qx.Class.define("dialog.demo.Application", // support additional cross-browser console. Press F7 to toggle visibility qx.log.appender.Console; } - - /* - * initialize shortcut commands - */ - dialog.Dialog.init(); /* * button data diff --git a/source/class/dialog/Dialog.js b/source/class/dialog/Dialog.js index e99df73..f1e3678 100644 --- a/source/class/dialog/Dialog.js +++ b/source/class/dialog/Dialog.js @@ -63,51 +63,11 @@ qx.Class.define("dialog.Dialog", /** * Initialize the package + * @deprecated */ init : function() { - /* - * create shortcut methods - */ - dialog.alert = function( message, callback ) - { - (new dialog.Alert({ - "message" : message, - "callback" : callback || null - })).show(); - } - dialog.confirm = function( message, callback ) - { - (new dialog.Confirm({ - "message" : message, - "callback" : callback || null - })).show(); - } - dialog.prompt = function( message, callback ) - { - (new dialog.Prompt({ - "message" : message, - "callback" : callback || null - })).show(); - } - dialog.select = function( message, options, callback ) - { - (new dialog.Select({ - "message" : message, - "allowCancel" : true, - "options" : options, - "callback" : callback - })).show(); - } - dialog.form = function( message, formData, callback ) - { - (new dialog.Form({ - message : message, - formData : formData, - allowCancel : true, - callback : callback - })).show(); - } + qx.core.Init.getApplication().warn("Initializing the Dialog package is no longer necessary. Please remove calls to 'dialog.Dialog.init()', which is now deprecated."); } }, @@ -359,9 +319,7 @@ qx.Class.define("dialog.Dialog", }); return cancelButton; }, - - /* --------------------------------------------------------------------------- APPLY METHODS @@ -446,5 +404,56 @@ qx.Class.define("dialog.Dialog", } this.resetCallback(); } + }, + + /* + ***************************************************************************** + DEFERRED ACTION + ***************************************************************************** + */ + defer : function() + { + /* + * create shortcut methods + */ + dialog.alert = function( message, callback ) + { + (new dialog.Alert({ + "message" : message, + "callback" : callback || null + })).show(); + } + dialog.confirm = function( message, callback ) + { + (new dialog.Confirm({ + "message" : message, + "callback" : callback || null + })).show(); + } + dialog.prompt = function( message, callback ) + { + (new dialog.Prompt({ + "message" : message, + "callback" : callback || null + })).show(); + } + dialog.select = function( message, options, callback ) + { + (new dialog.Select({ + "message" : message, + "allowCancel" : true, + "options" : options, + "callback" : callback + })).show(); + } + dialog.form = function( message, formData, callback ) + { + (new dialog.Form({ + message : message, + formData : formData, + allowCancel : true, + callback : callback + })).show(); + } } }); \ No newline at end of file diff --git a/source/class/dialog/Form.js b/source/class/dialog/Form.js index 59c0c06..9f93dcb 100644 --- a/source/class/dialog/Form.js +++ b/source/class/dialog/Form.js @@ -77,14 +77,12 @@ qx.Class.define("dialog.Form", * } * } * - * - * - * */ formData : { check : "Map", nullable : true, + event : "changeFormData", apply : "_applyFormData" }, @@ -94,7 +92,18 @@ qx.Class.define("dialog.Form", model : { check : "qx.core.Object", - nullable : true + nullable : true, + event : "changeModel" + }, + + /** + * The default width of the column with the field labels + */ + labelColumnWidth : + { + check : "Integer", + nullable : false, + init : 100 } }, @@ -582,7 +591,7 @@ qx.Class.define("dialog.Form", */ var view = new dialog.FormRenderer( this._form ); view.getLayout().setColumnFlex(0, 0); - view.getLayout().setColumnMaxWidth(0, 100); // FIXME Hardcoded is BAD! + view.getLayout().setColumnMaxWidth(0, this.getLabelColumnWidth() ); view.getLayout().setColumnFlex(1, 1); view.setAllowGrowX(true); this._formContainer.add( view ); diff --git a/source/class/dialog/Wizard.js b/source/class/dialog/Wizard.js index 2ff8629..399b2a5 100644 --- a/source/class/dialog/Wizard.js +++ b/source/class/dialog/Wizard.js @@ -375,7 +375,7 @@ qx.Class.define("dialog.Wizard", this.hide(); if( this.getCallback() ) { - this.getCallback()( qx.util.Json.parse( qx.util.Serializer.toNativeObject( this.getModel() ) ) ); + this.getCallback()( qx.util.Serializer.toNativeObject( this.getModel() ) ); } this.resetCallback(); }