Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Minimumn Size for a component inside SashForm
Minimumn Size for a component inside SashForm [message #455005] Wed, 04 May 2005 21:24 Go to next message
Eclipse UserFriend
Originally posted by: Parthasarathy.Ramachandran.siebel.com

Hi,

I have two components in a SashForm. My sash form sits inside the editor
area in the Eclipse workbench. I want the top component (a table with
one row) to always have a certain size (to ONLY show this row in the
table), irrespective of what size the editor area is. (The bottom
component can take up all the remaining space). The user can resize the
editor area all he wants, but I want the top table to always be = (say)
40 pixels in height.

[Of course if the Editor area is sized to be smaller than the size
required to show the table, this wont work, but I am not worrying about
that now]

Is this possible? setWeights doesnt work since it always maintains the
relative ratio.

Thanks
Partha
Re: Minimumn Size for a component inside SashForm [message #455017 is a reply to message #455005] Thu, 05 May 2005 08:21 Go to previous message
Eclipse UserFriend
If you always want the top part to be the same size, I would not use a
SashForm since the purpose of the SashForm is to allow the user to resize
the top part. Why not use a Composite with a GridLayout and set the
heightHint on the GridData for the top part to be a fixed height and set the
GridData for the bottom part to fill and grab:

Composite c = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginWidth = layout.marginHeight = 0;
c.setLayout(layout);
Button top = new Button(c, SWT.PUSH);
top.setText("TOP");
GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
data.heightHint = 50;
top.setLayoutData(data);
Button bottom = new Button(c, SWT.PUSH);
bottom.setText("BOTTOM");
bottom.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));


"Partha Ramachandran" <Parthasarathy.Ramachandran@siebel.com> wrote in
message news:d5bsvd$ptf$1@news.eclipse.org...
> Hi,
>
> I have two components in a SashForm. My sash form sits inside the editor
> area in the Eclipse workbench. I want the top component (a table with one
> row) to always have a certain size (to ONLY show this row in the table),
> irrespective of what size the editor area is. (The bottom component can
> take up all the remaining space). The user can resize the editor area all
> he wants, but I want the top table to always be = (say) 40 pixels in
> height.
>
> [Of course if the Editor area is sized to be smaller than the size
> required to show the table, this wont work, but I am not worrying about
> that now]
>
> Is this possible? setWeights doesnt work since it always maintains the
> relative ratio.
>
> Thanks
> Partha
Previous Topic:Drag and Drop (DND) broken in Tiger
Next Topic:How to remove children from a Composite?
Goto Forum:
  


Current Time: Sun Nov 09 05:44:32 EST 2025

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

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

Back to the top