Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
git-svn-id: https://qooxdoo-contrib.svn.sourceforge.net/svnroot/qooxdoo-contrib@20298 09f7d036-9b2a-0410-8fbe-9cff4eb17569
  • Loading branch information
cboulanger committed Jun 20, 2010
1 parent 955181f commit 9779b2a
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 55 deletions.
5 changes: 0 additions & 5 deletions demo/default/source/class/dialog/demo/Application.js
Expand Up @@ -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
Expand Down
97 changes: 53 additions & 44 deletions source/class/dialog/Dialog.js
Expand Up @@ -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.");
}
},

Expand Down Expand Up @@ -359,9 +319,7 @@ qx.Class.define("dialog.Dialog",
});
return cancelButton;
},



/*
---------------------------------------------------------------------------
APPLY METHODS
Expand Down Expand Up @@ -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();
}
}
});
19 changes: 14 additions & 5 deletions source/class/dialog/Form.js
Expand Up @@ -77,14 +77,12 @@ qx.Class.define("dialog.Form",
* }
* }
* </pre>
*
*
*
*/
formData :
{
check : "Map",
nullable : true,
event : "changeFormData",
apply : "_applyFormData"
},

Expand All @@ -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
}
},

Expand Down Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion source/class/dialog/Wizard.js
Expand Up @@ -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();
}
Expand Down

0 comments on commit 9779b2a

Please sign in to comment.