Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » restrict Composite size
restrict Composite size [message #485073] Thu, 10 September 2009 09:29 Go to next message
Eclipse UserFriend
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 11:29 Go to previous message
Eclipse UserFriend
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: Tue Jul 22 21:18:28 EDT 2025

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

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

Back to the top