Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » GridLayout not using all columns on every row
GridLayout not using all columns on every row [message #450771] Fri, 18 February 2005 09:25 Go to next message
No real name is currently offline No real nameFriend
Messages: 25
Registered: July 2009
Junior Member
Hi,

I have created a grid layout with 3 columns.
In the first column are the labels.
In the second column are the input fields.
In the third column, there are error message labels.

My problem is, that not each row has an error message label.
This leads to the problem, that when adding the column label of a new
logical row, it is added to the third row of the last logic row.

How to solve this problem? Using another layout, add a dummy label?

Regards,

Cyrill
Re: GridLayout not using all columns on every row [message #450839 is a reply to message #450771] Fri, 18 February 2005 14:39 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Create a dummy label and call Label.setVisible(false).

"Cyrill Ruettimann" <cr@innovate-it.ch> wrote in message
news:cv4c9d$2ih$1@www.eclipse.org...
> Hi,
>
> I have created a grid layout with 3 columns.
> In the first column are the labels.
> In the second column are the input fields.
> In the third column, there are error message labels.
>
> My problem is, that not each row has an error message label.
> This leads to the problem, that when adding the column label of a new
> logical row, it is added to the third row of the last logic row.
>
> How to solve this problem? Using another layout, add a dummy label?
>
> Regards,
>
> Cyrill
Re: GridLayout not using all columns on every row [message #450848 is a reply to message #450839] Fri, 18 February 2005 15:20 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 25
Registered: July 2009
Junior Member
Veronika Irvine wrote:

> Create a dummy label and call Label.setVisible(false).
>

I thought there was a more elegant way to solve that :-(

Thanks,

Cyrill
Re: GridLayout not using all columns on every row [message #450860 is a reply to message #450848] Fri, 18 February 2005 17:21 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 92
Registered: July 2009
Member
You could implement each row as a composite and drop your two or three
widgets into the composite. I did a similar thing and have a little routine
for laying out the widgets in order and re-sizing them with the shell. Very
similar to what you are doing. It's not strictly a layout manager, but a few
simple calculations and a few calls to setLocation and you're done.

Alternatively, you can think of the blank label as an "&nbsp;" or one of
those stupid one pixel images in an HTML table!

Andy


"Cyrill Ruettimann" <cr@innovate-it.ch> wrote in message
news:cv5133$769$1@www.eclipse.org...
> Veronika Irvine wrote:
>
> > Create a dummy label and call Label.setVisible(false).
> >
>
> I thought there was a more elegant way to solve that :-(
>
> Thanks,
>
> Cyrill
Re: GridLayout not using all columns on every row [message #450862 is a reply to message #450848] Fri, 18 February 2005 17:40 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Alternatively you could use FormLayout.

"Cyrill Ruettimann" <cr@innovate-it.ch> wrote in message
news:cv5133$769$1@www.eclipse.org...
> Veronika Irvine wrote:
>
>> Create a dummy label and call Label.setVisible(false).
>>
>
> I thought there was a more elegant way to solve that :-(
>
> Thanks,
>
> Cyrill
Re: GridLayout not using all columns on every row [message #450864 is a reply to message #450848] Fri, 18 February 2005 18:09 Go to previous message
Tiberiu Caprita is currently offline Tiberiu CapritaFriend
Messages: 68
Registered: July 2009
Member
Cyrill Ruettimann wrote:
> I thought there was a more elegant way to solve that :-(
it is:
set the LayoutData of the only 1 Widget to a GridData having
horizontalSpan=2.

(But from your decription I understood in fact you need a Table...).

:-)
Tiberiu
Previous Topic:"Transparent" splash screen
Next Topic:TreeItem with checkbox
Goto Forum:
  


Current Time: Thu Apr 25 13:56:19 GMT 2024

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

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

Back to the top