|
Re: FormLayout and child relative height [message #509881 is a reply to message #508719] |
Mon, 25 January 2010 16:28 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Hi Pietro, is this what you mean?
public static void main (String [] args) {
Display display = new Display ();
final Shell shell = new Shell (display);
shell.setBounds(10,10,200,200);
Composite composite1 = new Composite(shell, SWT.BORDER);
Composite composite2 = new Composite(shell, SWT.BORDER);
Composite composite3 = new Composite(shell, SWT.BORDER);
FormLayout formLayout = new FormLayout ();
shell.setLayout (formLayout);
FormData labelData = new FormData ();
labelData.left = new FormAttachment (0);
labelData.right = new FormAttachment (30);
labelData.top = new FormAttachment (0);
labelData.bottom = new FormAttachment (100);
composite1.setLayoutData (labelData);
labelData = new FormData ();
labelData.left = new FormAttachment (30);
labelData.right = new FormAttachment (60);
labelData.top = new FormAttachment (0);
labelData.bottom = new FormAttachment (100);
composite2.setLayoutData (labelData);
labelData = new FormData ();
labelData.left = new FormAttachment (60);
labelData.right = new FormAttachment (90);
labelData.top = new FormAttachment (0);
labelData.bottom = new FormAttachment (100);
composite3.setLayoutData (labelData);
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
Grant
"Pietro Santurelli" <santurelli@inwind.it> wrote in message
news:hj5f1r$c73$1@build.eclipse.org...
> Hi all,
> I've a parent composite with formlayout.
> I'd like to create three other composite on it and I want that everyone
> take up 30% of parent. Tha last 10% of parent is filled by another
> composite.
> How can I do this task?
>
> I'm on Windows XP and I'm using SWT 3.448
>
> Thanls in advance,
> Pietro
|
|
|
Powered by
FUDForum. Page generated in 0.03584 seconds