Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » restrict Composite size
restrict Composite size [message #485073] Thu, 10 September 2009 13:29 Go to next message
Rahul Yadav is currently offline Rahul YadavFriend
Messages: 65
Registered: July 2009
Member
HI All,
Is there any way to limit the Composite size?? I have a Parent composite
say "A", adding one more composite "B" to it....i add CheckBoxTableViewer
"ctv" to it,elements in ctv are added at run time from a property file it
has some 100 elements.The Problem is size of UI, due to large number of
elemnts in ctv it is expanding to full length making Dialog to expand from
top to bottom of screen and then adding scrollbar to it which is ok.
Due to some limitations i can't use shell.setSize(), only way for me is to
limit the size of composite "B" so that ctv does't expand beyond B's
height.
Re: restrict Composite size [message #485396 is a reply to message #485073] Fri, 11 September 2009 15:29 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
A Table's preferred size (which is what pack() gives you) is to show all of
its items, so to keep it from doing this you have to set a size or size hint
on the Table or its parent. For example, if your Composite B uses a
GridLayout then you can give it width and height hints in its GridData, and
the Table will be sized to fit within it (and will show scrollbars if
needed).

Grant


"Rahul Yadav" <rahulyadav20@gmail.com> wrote in message
news:98d500bc346c39ef49c7200b185c8f08$1@www.eclipse.org...
> HI All,
> Is there any way to limit the Composite size?? I have a Parent composite
> say "A", adding one more composite "B" to it....i add CheckBoxTableViewer
> "ctv" to it,elements in ctv are added at run time from a property file it
> has some 100 elements.The Problem is size of UI, due to large number of
> elemnts in ctv it is expanding to full length making Dialog to expand from
> top to bottom of screen and then adding scrollbar to it which is ok.
> Due to some limitations i can't use shell.setSize(), only way for me is to
> limit the size of composite "B" so that ctv does't expand beyond B's
> height.
>
>
>
>
>
>
>
Previous Topic:Is it possible to have a tree with only some items with checkboxes
Next Topic:Frequent update of image
Goto Forum:
  


Current Time: Thu Apr 25 13:30:53 GMT 2024

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

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

Back to the top