|
|
Re: Does a Form with TableWrapLayout allow child FigureCanvas? [message #211464 is a reply to message #211456] |
Mon, 13 March 2006 05:42 |
Nathan Snapp Messages: 14 Registered: July 2009 |
Junior Member |
|
|
Once again, stepping through the code in all its gory detail has yielded
an answer :)
The problem is the Section extends ExpandableComposite which ignores the
SWT.WRAP flag if it's child is a Composite and instead looks to see if the
Composite's layout implements ILayoutExtension (which is used for wrapping
calculations). So I ended up rolling my own layout (just copying
FillLayout and FillData into my own classes since they are final and
non-public respectively). In the class representing FillLayout you need
to implement ILayoutExtension and provide functions computeMaximumWidth
and computeMinimumWidth.
Here are my implementations if anyone cares:
public int computeMaximumWidth(Composite parent, boolean changed) {
return computeSize(parent, SWT.DEFAULT, SWT.DEFAULT, changed).x;
}
public int computeMinimumWidth(Composite parent, boolean changed) {
return computeSize(parent, 0, SWT.DEFAULT, changed).x;
}
Hopes this helps someone who may tread down this same confusing path!
|
|
|
Powered by
FUDForum. Page generated in 0.03639 seconds