Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » ScrolledComposite drives me crazy !
ScrolledComposite drives me crazy ! [message #636478] Mon, 01 November 2010 14:17 Go to next message
Sebastian  is currently offline Sebastian
Messages: 22
Registered: September 2010
Junior Member
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.computeSize(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 Smile..

Thanks
Re: ScrolledComposite drives me crazy ! [message #643052 is a reply to message #636478] Fri, 03 December 2010 18:11 Go to previous message
Wim Jongman is currently offline Wim Jongman
Messages: 418
Registered: July 2009
Senior Member
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
Previous Topic:Acsess Status line
Next Topic:Eclipse RCP and java web start
Goto Forum:
  


Current Time: Mon Sep 22 08:31:31 GMT 2014

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

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