|
Re: ScrolledComposite drives me crazy ! [message #643052 is a reply to message #636478] |
Fri, 03 December 2010 13:11  |
Eclipse User |
|
|
|
Hi Sebastian,
Try the SWT group.
--
Best Regards,
Wim Jongman
-- In vacation. May the internet survive without me
Lars Vogel
> Hey guys,
>
> I'm trying to create a ScrolledComposite inside a GridLayout and it freaks
me out. It sizes the Composite so it can accomodate all components inside of
it in one row that totally outgrows the space available. I checked the
snippets and did exactly the same thing but it won't work!
>
> Here is some code.
> final ScrolledComposite scrolledComposite = new ScrolledComposite(_parent,
SWT.BORDER | SWT.V_SCROLL);
>
> AuthorizedAreasCompositeBuilder builder = new
AuthorizedAreasCompositeBuilder(scrolledComposite, SWT.NONE, 40, 40);
>
> // composite bauen
> _authorizedAreaComposite = builder.build();
> scrolledComposite.setContent(_authorizedAreaComposite);
> scrolledComposite.setExpandVertical(true);
> scrolledComposite.setExpandHorizontal(true);
> scrolledComposite.addControlListener(new ControlAdapter()
> {
> @Override
> public void controlResized(ControlEvent e)
> {
> Rectangle clientArea = scrolledComposite.getClientArea();
>
scrolledComposite.setMinSize(_authorizedAreaComposite.comput eSize(clientArea.width,
SWT.DEFAULT));
> }
> });
>
>
> The constructor of AuthorizedAreaComposite looks like this:
> RowLayout layout = new RowLayout(SWT.HORIZONTAL);
> layout.spacing = 10;
> layout.wrap = true;
> layout.justify = false;
> layout.center = true;
> setLayout(layout);
>
> I don't know why this doesn't work. So please advise :)..
>
> Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.03514 seconds