Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Pnuts Layout for SWT
Pnuts Layout for SWT [message #374442] Wed, 24 September 2003 20:54 Go to next message
Eclipse UserFriend
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 #374462 is a reply to message #374442] Thu, 25 September 2003 06:16 Go to previous messageGo to next message
Eclipse UserFriend
Adam Taft wrote:

> 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.

Well, have you tried org.eclipse.swt.layout.GridLayout ? By setting the
appropriate GridData to your components (all widgets extending Control
have the setLayoutData() method that allows you to apply any kind of data
to them), you will be able to do whatever you want as in a HTML table.
Re: Pnuts Layout for SWT [message #375365 is a reply to message #374442] Sun, 12 October 2003 17:01 Go to previous message
Eclipse UserFriend
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
Previous Topic:Tracker Instructions/Example
Next Topic:ImageData/ImageLoader Extensibility
Goto Forum:
  


Current Time: Thu Sep 25 06:47:30 EDT 2025

Powered by FUDForum. Page generated in 0.04737 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top