Pnuts Layout for SWT [message #374442] |
Wed, 24 September 2003 20:54  |
Eclipse User |
|
|
|
Originally posted by: bobsledbob.yahoo.com
Hi,
I'm real fond of the Pnuts HTML-like layout for swing. For me, it's
just so totally easy to work with!
I'm having a hard time finding anything like it in SWT. Does anyone
know of a decent SWT layout that is most like laying out HTML tables?
ie. rows, cols, colspan, rowspan, etc.
Thanks in advance!
Adam
|
|
|
|
Re: Pnuts Layout for SWT [message #375365 is a reply to message #374442] |
Sun, 12 October 2003 17:01  |
Eclipse User |
|
|
|
Adam Taft wrote:
> I'm real fond of the Pnuts HTML-like layout for swing. For me, it's
> just so totally easy to work with!
>
> I'm having a hard time finding anything like it in SWT. Does anyone
> know of a decent SWT layout that is most like laying out HTML tables?
> ie. rows, cols, colspan, rowspan, etc.
I used and modified the Pnuts layout in a project two years ago. For
fun, I dug out the old code and modified it so that you can use it for
SWT - was pretty easy. Although constraints are AWT-like, I used the
PnutsLayout#setConstraint
method instead of an extra PnutsData object. If you like, I can send
you the code.
A short example:
PnutsLayout pl = new PnutsLayout("cols=2,opad=6,pad=3,halign=left");
shell.setLayout(pl);
Label l1 = new Label(shell, SWT.LEFT);
l1.setText("Name:");
Text t1 = new Text(shell, SWT.MULTI| SWT.BORDER | SWT.V_SCROLL);
pl.setConstraints(t1, "rowspan=2,halign=fill,valign=fill,expand=xy");
Label l2 = new Label(shell, SWT.LEFT);
l2.setText("Pasword:");
Label l3 = new Label(shell, SWT.LEFT);
l3.setText("Last Line");
pl.setConstraints(l3, "colspan=2,halign=right");
bye
--
Stefan Matthias Aust // "Ist es normal, nur weil alle es tun?" -F4
|
|
|
Powered by
FUDForum. Page generated in 0.04780 seconds