[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: FormLayout

Is this what you mean:

public static void main (String [] args) {
        Display display = new Display ();
        Shell shell = new Shell (display);
        shell.setLayout(new FormLayout());
        Composite top = new Composite(shell, SWT.BORDER);
        Composite middle = new Composite(shell, SWT.BORDER);
        Composite bottom = new Composite(shell, SWT.BORDER);
        FormData data = new FormData();
        data.left = new FormAttachment(0, 5);
        data.right = new FormAttachment(100, -5);
        data.top = new FormAttachment(0, 5);
        data.height = 200;
        top.setLayoutData(data);
        data = new FormData();
        data.left = new FormAttachment(0, 5);
        data.right = new FormAttachment(100, -5);
        data.top = new FormAttachment(top, 5);
        data.bottom = new FormAttachment(bottom, -5);
        middle.setLayoutData(data);
        data = new FormData();
        data.left = new FormAttachment(0, 5);
        data.right = new FormAttachment(100, -5);
        data.bottom = new FormAttachment(100, -5);
        data.height = 200;
        bottom.setLayoutData(data);
        shell.open ();
        while (!shell.isDisposed ()) {
                if (!display.readAndDispatch ()) display.sleep ();
        }
        display.dispose ();
}

"Stephen" <swmk.stephen@xxxxxxxxx> wrote in message 
news:4ad09448e9913f6983528fd4f44acf4d$1@xxxxxxxxxxxxxxxxxx
> Hi,
>
> I'm facing some problem. I have three composite in a composite.
>
> The top and bottom composite are fixed sized in height.
> The middle one may vary in size.
> And the parent composite is resizable.
>
> The problem is ;
> when a parent composite is resized, the bottom composite comes to the area 
> of top composite.
> I use "top composite" for the "top" form attachment of middle composite 
> and don't know what to put as the "bottom" attachment of the "bottom 
> composite".
>
> The idea is like a window with title bar and status bar.
>
> --
> Thanks
>