#1233 Widget.layout

andy Sat 25 Sep 2010

Add a layout field to fwt::Widget.

class Widget
{
  Obj? layout := null
}

andy Sat 25 Sep 2010

Promoted to ticket #1233 and assigned to andy

andy Mon 27 Sep 2010

Ticket resolved in 1.0.56

Widget.layout now available. This should open the door for some more interesting Panes. Most notably a MigLayout implementation should now be feasible.

qualidafial Mon 27 Sep 2010

Is this analogous to SWT's Composite.layout property or to Control.layoutData?

andy Mon 27 Sep 2010

Is this analogous to SWT's Composite.layout property or to Control.layoutData

I have not used that specifically in SWT - but from looking at the javadoc, yes looks like the same thing.

qualidafial Mon 27 Sep 2010

I have not used that specifically in SWT - but from looking at the javadoc, yes looks like the same thing.

That was an either-or question. :)

Composite.layout controls the layout of the composite's children, whereas Control.layoutData advises the control's parent container how it should be placed out in the container's layout.

I'll assume it is analogous to Control.layoutData since the field is declared in fwt::Widget and not fwt::Pane. Thus:

HBox {
  Label { text = "Description" },
  Text {
    text = model.description ?: "<description>"
    multiLine = true
    layout = HBoxLayout { hExpand = true; vAlign = VAlign.fill }
  },
}

Here the layout property is just advising the container on how the Text control should be aligned.

Is this the intended purpose of this new field?

brian Tue 28 Sep 2010

The intention is that its a hint that may be used by the container Pane. In the case of a MigPane, it would be the string encoding of how its laid out.

Login or Signup to reply.