Permalink
Browse files

Fixed bug http://bugzilla.qooxdoo.org/show_bug.cgi?id=3576

git-svn-id: https://qooxdoo-contrib.svn.sourceforge.net/svnroot/qooxdoo-contrib@20298 09f7d036-9b2a-0410-8fbe-9cff4eb17569
  • Loading branch information...
1 parent 955181f commit 9779b2aad4654be76edbee454cb6013ebe226344 cboulanger committed Jun 20, 2010
@@ -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
@@ -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();
+ }
}
});
@@ -77,14 +77,12 @@ qx.Class.define("dialog.Form",
* }
* }
* </pre>
- *
- *
- *
*/
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 );
@@ -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();
}

0 comments on commit 9779b2a

Please sign in to comment.