Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT Table
SWT Table [message #463148] Fri, 28 October 2005 00:16 Go to next message
Eclipse User
Originally posted by: davidyoung_2001.yahoo.co.uk

Is it possible to setWeights to define the relative sizes of colums in a
table? Also when I have added colums, there is a space to right hand side
that is undefined, how do I get the colums to absorb this space?
Re: SWT Table [message #463171 is a reply to message #463148] Fri, 28 October 2005 09:01 Go to previous messageGo to next message
Yves Harms is currently offline Yves Harms
Messages: 80
Registered: July 2009
Member
Relative sizes are not supported, just pixel sizes.
You could attach a resize listener to the table.
(The resize event occurs at table creation, too.)
This would be the only possibility to get rid of the blind extra column
and implent relative sizes.


> Is it possible to setWeights to define the relative sizes of colums in a
> table? Also when I have added colums, there is a space to right hand
> side that is undefined, how do I get the colums to absorb this space?
>
Re: SWT Table [message #463183 is a reply to message #463171] Fri, 28 October 2005 12:09 Go to previous messageGo to next message
Eclipse User
Originally posted by: davidyoung_2001.yahoo.co.uk

Thanks Yves - how do I find out the size of the composite area, so that I
can implement relative sizes?
Re: SWT Table [message #463189 is a reply to message #463183] Fri, 28 October 2005 18:46 Go to previous messageGo to next message
Eclipse User
Originally posted by: friederich.kupzog.de

Hi,

given your Table object is called table:

table.getSize().x gives you the width your columns can use.

Hope that helped,
Friederich


david young wrote:
> Thanks Yves - how do I find out the size of the composite area, so that
> I can implement relative sizes?
>


--
Friederich Kupzog
Elektronik & Software
Neusser Str. 5-7
50670 Köln
Tel 0241 160696-1
Fax 0221 726670
www.kupzog.de/fkmk
Re: SWT Table [message #463197 is a reply to message #463189] Sat, 29 October 2005 15:11 Go to previous messageGo to next message
Daniel Spiewak is currently offline Daniel Spiewak
Messages: 263
Registered: July 2009
Senior Member
You actually might want to use the table.getClientArea().width instead since some platforms could put trim around the Table (and getClientArea() includes any borders, etc...)

Daniel
Re: SWT Table [message #463205 is a reply to message #463148] Sun, 30 October 2005 13:54 Go to previous message
Sebastian Machhausen is currently offline Sebastian Machhausen
Messages: 6
Registered: July 2009
Junior Member
Hi David,

my antecessor already proposed some good advice on this topic. I just wanted to add another option to address this problem. I always handle it this way:

1) Define a default width for all table columns
2) Add the user option to resize all colums that way that they adopt the width of the widest cell by using <i>TableColumn.pack()</i>. Add an accelerator for this as done in windows explorer (ctrl + plus) for example.

I switched to this solution since it doesn't restrict the user so much. Experience taught me that many users do not want a table to auto resize as the enclosing component, e.g. the window is resized.

Greetings
Sebastian
Previous Topic:Persistent Expanded Tree
Next Topic:Missing grip on resizable dialogs on XP
Goto Forum:
  


Current Time: Thu Aug 21 14:23:51 EDT 2014

Powered by FUDForum. Page generated in 0.01726 seconds