Kent Olsson schrieb:
Still a small problem:

If I make the canvas layout bigger than the actual area the components
take inside the canvas layout, how can I center the components
horizontally as well as vertically inside the canvas layout, i.e. I want
them in the middle.

I have tried:

layout.setVerticalAlign(QxConst.CORE_MIDDLE);
layout.setHorizontalAlign(QxConst.CORE_CENTER);
//layout.setVerticalChildrenAlign(QxConst.CORE_MIDDLE);
layout.setHorizontalChildrenAlign(QxConst.CORE_CENTER);

This is the same discussion we have already had some weeks ago, Kent. QxCanvasLayout does not support any alignments for children. This is just a canvas. You can move things where you like them. A canvas layout typically doesn't decide where the children will be placed (this is only configured in each child itself). I don't think we should change the current behavior as in my opinion we have just implemented a typical canvas layout.

Sebastian



but neither seems to work as I wish.

Kent

On Mon, 2006-03-06 at 16:13 +0100, Sebastian Werner wrote:
Kent!

After adding some auto()'s it seems to work well:

   var layout = new QxCanvasLayout();
   layout.setHeight(200);
   layout.setWidth(300);
   layout.setLocation(50, 50);
   layout.setBorder(QxBorder.presets.black);
   this.add(layout);

   // Upper
   var upperHBL = this._upperLayout = new QxHorizontalBoxLayout();
   upperHBL.auto();
   upperHBL.setBorder(QxBorder.presets.black);

   // Upper left
   var messageI = this._icon = new QxImage("icons/48/info.png", 48, 48);

   upperHBL.add(messageI);

   // Upper right
   var rightVBL = this._rightLayout = new QxVerticalBoxLayout();
   rightVBL.setBorder(QxBorder.presets.black);
   rightVBL.auto();

   // Upper right top
   var messageL1 = this._message = new QxLabel("Hi");

   rightVBL.add(messageL1);

   // Upper right bottom
   var messageL2 = this._message = new QxLabel("Hi again");
   rightVBL.add(messageL2);

   upperHBL.add(rightVBL);

   // Lower
   var buttonB = this._button = new QxButton("Click");
   buttonB.setPaddingTop(10);

   var layoutVBL = this._layout = new QxVerticalBoxLayout();
   layoutVBL.setBorder(QxBorder.presets.black);
   layoutVBL.auto();
   layoutVBL.add(upperHBL, buttonB);

   layout.add(layoutVBL);

Sebastian


Kent Olsson schrieb:
Sebastian!

I have copied an example. I want the button centered in the layout widget. I 
want the upperHBL centered in the layout widget.
I want the messageL1 and messageL2 centered in the upperRightVBL.

I have tried QxConst.CORE_AUTO, null (width/height) and 
setVerticalChildrenAlign, setHorizontalChildrenAlign, setVerticalAlign, 
setHorizontalAlign
but I do not get it working!!!!

I need your help here.

Here is an example:

  var layout = new QxCanvasLayout();
  layout.setHeight(200);
  layout.setWidth(300);

  // Upper
  var upperHBL = this._upperLayout = new QxHorizontalBoxLayout();

  // Upper left
  var messageI = this._icon = new QxImage("icons/48/info.png", 48, 48);

  upperHBL.add(messageI);

  // Upper right
  var rightVBL = this._rightLayout = new QxVerticalBoxLayout();

  // Upper right top
  var messageL1 = this._message = new QxLabel("Hi");

  rightVBL.add(messageL1);

  // Upper right bottom
  var messageL2 = this._message = new QxLabel("Hi again");
  rightVBL.add(messageL2);

  upperHBL.add(rightVBL);

  // Lower
  var buttonB = this._button = new QxButton("Click");
  buttonB.setPaddingTop(10);

  var layoutVBL = this._layout = new QxVerticalBoxLayout();
  layoutVBL.add(upperHBL, buttonB);

  layout.add(layoutVBL);
-----------------------------------------------

On Mon, 2006-03-06 at 09:42 +0100, Sebastian Werner wrote:
Kent Olsson schrieb:
I am trying to do that, but I haven't got it working yet.
If you send us an example with just these two layout types (without your button pane) which shows exactly you problem, I will take a look at.

Sebastian

Kent

On Mon, 2006-03-06 at 09:27 +0100, Sebastian Werner wrote:
Kent Olsson schrieb:
Hej Sebastian!

Can you tell me why the nested vertical and horizontal box layouts do not 
adjust? I attach an image showing what happens to the widgets. I actually only 
have values for the message and its button pane., but it overlays att (0, 0)
I can not have fixed size, because the text can be different as well as the 
icon etc. It must adjust itself.
The layouts have no default dimensions. This was changed some month ago in RENDERER. You must define "auto" for width/height where you need it.

Sebastian


Kent
------------

  // Upper
  var upperHBL = this._upperLayout = new QxHorizontalBoxLayout();

  // Upper left
  var messageI = this._icon = new QxImage(vIcon, 48, 48);

  // Upper right
  var rightVBL = this._rightLayout = new QxVerticalBoxLayout();

  // Upper right top
  var messageL = this._message = new QxLabel(vMessage);

  rightVBL.add(messageL);

  // Upper right bottom
  if(QxUtil.isValidObject(vInputWidget)) {
    this._inputWidget = vInputWidget;
    rightVBL.add(vInputWidget);
  };

  upperHBL.add(messageI, rightVBL);

  // Lower
  var buttonsBP = this._buttons = new QxButtonPane();

  var layoutVBL = this._layout = new QxVerticalBoxLayout();
  layoutVBL.add(upperHBL, buttonsBP);

  this.add(layoutVBL);




------------------------------------------------------------------------

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to