Permalink
Browse files

- Fixed layout bug where left column would take to much space

- Fixed layout bug where form message would not wrap
- Fixed bug in form creation concerning the radiogroup widget 

git-svn-id: https://qooxdoo-contrib.svn.sourceforge.net/svnroot/qooxdoo-contrib@20236 09f7d036-9b2a-0410-8fbe-9cff4eb17569
  • Loading branch information...
1 parent 0799bc3 commit 10052003a2e90902c5b58c40385b06981df6c924 cboulanger committed Jun 12, 2010
@@ -75,7 +75,7 @@ qx.Class.define("dialog.Alert",
this._message.setRich(true);
this._message.setWidth(200);
this._message.setAllowStretchX(true);
- hbox.add( this._message );
+ hbox.add( this._message, {flex:1} );
/*
* Ok Button
@@ -141,7 +141,7 @@ qx.Class.define("dialog.Confirm",
this._message.setRich(true);
this._message.setWidth(200);
this._message.setAllowStretchX(true);
- hbox.add( this._message );
+ hbox.add( this._message, {flex:1} );
var _this = this;
@@ -159,14 +159,14 @@ qx.Class.define("dialog.Form",
this._message.setRich(true);
this._message.setMinWidth(200);
this._message.setAllowStretchX(true);
- hbox.add( this._message );
+ hbox.add( this._message, {flex:1} );
/*
* Form container
*/
this._formContainer = new qx.ui.container.Composite;
this._formContainer.setLayout( new qx.ui.layout.Grow() );
- groupboxContainer.add( this._formContainer );
+ groupboxContainer.add( this._formContainer, {flex: 1} );
/*
* buttons pane
@@ -409,7 +409,7 @@ qx.Class.define("dialog.Form",
formElement, "selection", key, true, {
"converter" : qx.lang.Function.bind( function( value )
{
- var selectables = formElement.getSelectables();
+ var selectables = this.getSelectables();
var selection = [];
if ( value )
{
@@ -558,6 +558,9 @@ qx.Class.define("dialog.Form",
* render the form
*/
var view = new dialog.FormRenderer( this._form );
+ view.getLayout().setColumnFlex(0, 0);
+ view.getLayout().setColumnMaxWidth(0, 100); // FIXME Hardcoded is BAD!
+ view.getLayout().setColumnFlex(1, 1);
view.setAllowGrowX(true);
this._formContainer.add( view );
@@ -91,7 +91,7 @@ qx.Class.define("dialog.Prompt",
this._message.setRich(true);
this._message.setWidth(200);
this._message.setAllowStretchX(true);
- hbox.add( this._message );
+ hbox.add( this._message, {flex:1} );
/*
* textfield
@@ -1,120 +0,0 @@
-/* ************************************************************************
-
- qcl - the qooxdoo component library
-
- http://qooxdoo.org/contrib/project/qcl/
-
- Copyright:
- 2007-2009 Christian Boulanger
-
- License:
- LGPL: http://www.gnu.org/licenses/lgpl.html
- EPL: http://www.eclipse.org/org/documents/epl-v10.php
- See the LICENSE file in the project's top-level directory for details.
-
- Authors:
- * Christian Boulanger (cboulanger)
-
-************************************************************************ */
-
-/**
- * A wizard-type widget that constructs the wizard pages on-the-fly, using
- * functionality from dialog.Form. In contrast to dialog.Wizard,
- * this wizard sends each page result back to the server and gets new page data
- */
-qx.Class.define("dialog.RemoteWizard",
-{
- extend : dialog.Wizard,
-
- /*
- *****************************************************************************
- PROPERTIES
- *****************************************************************************
- */
- properties :
- {
- serviceName :
- {
- check : "String",
- nullable : false
- },
-
- serviceMethod :
- {
- check : "String",
- nullable : false
- }
- },
-
-
- /*
- *****************************************************************************
- MEMBERS
- *****************************************************************************
- */
- members :
- {
-
- /*
- ---------------------------------------------------------------------------
- API METHODS
- ---------------------------------------------------------------------------
- */
-
- /**
- * Goes to the previous wizard button
- */
- goBack : function()
- {
- var page = this.getPage();
- if ( page == 0 )
- {
- this.error("Cannot go back!");
- }
- this.getApplication().executeService(
- this.getServiceName(),
- this.getServiceMethod(),
- [ page-1, qx.util.Serializer.toJson( this.getModel() ) ],
- function ( data ){
- this.set( data );
- },
- this
- );
- },
-
- /**
- * Goes to the next wizard page
- */
- goForward : function()
- {
- var page = this.getPage();
- if ( page > this.getPageData().length -2 )
- {
- this.error("Cannot go forward!");
- }
- this.getApplication().executeService(
- this.getServiceName(),
- this.getServiceMethod(),
- [ page+1, qx.util.Serializer.toJson( this.getModel() ) ],
- function ( data ){
- this.set( data );
- },
- this
- );
- },
-
- /**
- * Finishes the wizard. Calls callback with the result data map
- * @return {Object}
- */
- finish : function()
- {
- this.hide();
- this.getApplication().executeService(
- this.getServiceName(),
- this.getServiceMethod(),
- [ null, qx.util.Serializer.toJson( this.getModel() ) ]
- );
- }
- }
-});
@@ -89,7 +89,7 @@ qx.Class.define("dialog.Select",
this._message.setRich(true);
this._message.setWidth(200);
this._message.setAllowStretchX(true);
- hbox.add( this._message );
+ hbox.add( this._message, {flex:1} );
/*
* buttons pane
@@ -1,197 +0,0 @@
-/* ************************************************************************
-
- qcl - the qooxdoo component library
-
- http://qooxdoo.org/contrib/project/qcl/
-
- Copyright:
- 2007-2009 Christian Boulanger
-
- License:
- LGPL: http://www.gnu.org/licenses/lgpl.html
- EPL: http://www.eclipse.org/org/documents/epl-v10.php
- See the LICENSE file in the project's top-level directory for details.
-
- Authors:
- * Christian Boulanger (cboulanger)
-
-************************************************************************ */
-
-/* ************************************************************************
-#embed(qx.icontheme/48/status/dialog-information.png)
-************************************************************************ */
-
-
-/**
- * Alert popup singleton
- */
-qx.Class.define("dialog.Upload",
-{
- extend : dialog.Dialog,
-
- /*
- *****************************************************************************
- MEMBERS
- *****************************************************************************
- */
- members :
- {
-
- /*
- ---------------------------------------------------------------------------
- WIDGET LAYOUT
- ---------------------------------------------------------------------------
- */
-
- /**
- * Create the main content of the widget
- */
- _createWidgetContent : function()
- {
-
- /*
- * groupbox
- */
- var groupboxContainer = new qx.ui.groupbox.GroupBox().set({
- contentPadding: [16, 16, 16, 16]
- });
- groupboxContainer.setLayout( new qx.ui.layout.VBox(10) );
- this.add( groupboxContainer );
-
- var hbox = new qx.ui.container.Composite;
- hbox.setLayout( new qx.ui.layout.HBox(10) );
- groupboxContainer.add( hbox );
-
- /*
- * add image
- */
- this._image = new qx.ui.basic.Image("icon/48/status/dialog-information.png");
- hbox.add( this._image );
-
- /*
- * Add message label
- */
- this._message = new qx.ui.basic.Label();
- this._message.setRich(true);
- this._message.setWidth(200);
- this._message.setAllowStretchX(true);
- hbox.add( this._message );
-
-
- /*
- * upload widget
- */
- var form = new uploadwidget.UploadForm('uploadFrm', url );
- form.set({
- top : 0,
- left : 0,
- right : 0,
- bottom : 0,
- width : null
- });
-
- /*
- * parameters
- */
- if ( params !== undefined )
- {
- for ( var k in params )
- {
- form.setParameter( k, params[k] );
- }
- }
-
- /*
- * file upload field
- */
- var file = new uploadwidget.UploadField('uploadfile',"Choose File",null);
- file.set({
- top : 0,
- left : 0,
- right : 0,
- bottom : 0,
- width : null
- });
- form.add(file);
- cv.add(form);
-
- /*
- * event listeners
- */
- form.addEventListener('sending',function(e) {
- this.debug('sending');
- });
-
- form.addEventListener('completed',function(e) {
- var response = this.getIframeHtmlContent();
- var path = file.getValue();
- callback.call( context, path, response );
- window.setTimeout(function(){
- w.close();
- w.dispose();
- w.destroy();
- },100);
- });
-
- /*
- * button panel
- */
- var p = new qx.ui.layout.HorizontalBoxLayout;
- p.setSpacing(10);
- p.setHorizontalChildrenAlign("center");
- p.add(c, b);
- controls = [cv,p];
-
- /*
- * window
- */
- var w = this._createWindow(this.tr("Select a file"), msg, 'icon/16/actions/document-save.png', 'icon/32/actions/document-save.png', controls);
-
- /*
- * add event listener for OK Button
- */
- b.addEventListener("execute", function()
- {
- // send form if an url has been passed
- this.setLabel("Uploading...");
- this.setEnabled(false);
- if (url)
- {
- form.send();
- }
- else
- {
- var path = file.getValue();
- w.close();
- w.dispose();
- callback.call(context, path );
- }
- });
-
- /*
- * add event listener for cancel Button
- */
- c.addEventListener("execute", function()
- {
- w.close();
- w.dispose();
- callback.call(context, false);
- });
-
- /*
- * Ok Button
- */
- var okButton = this._createOkButton();
-
- /*
- * buttons pane
- */
- var buttonPane = new qx.ui.container.Composite;
- var bpLayout = new qx.ui.layout.HBox();
- bpLayout.setAlignX("center");
- buttonPane.setLayout(bpLayout);
- buttonPane.add(okButton);
- groupboxContainer.add(buttonPane);
- }
- }
-});
Oops, something went wrong.

0 comments on commit 1005200

Please sign in to comment.