|Re: ScrolledComposite and width of its content... [message #454221 is a reply to message #453905]
||Tue, 19 April 2005 11:29
Registered: July 2009
thank you. ;)
Am Wed, 13 Apr 2005 13:27:16 -0400 hat Veronika Irvine
> The following snippet uses a RowLayout with wrapping in a
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet166.java?rev=HEAD& amp;content-
> "Michael" <email@example.com> wrote in message
>> is it somehow possible to let the ScrolledComposite control the width of
>> its content?
>> Imagine a thumbnail viewer where the amount of thumbnails visible in a
>> row are depending on the width of the thumbnails an the width of the
>> container in which they are.
>> Or in other words, the composite containing the thumbnails should be
>> alway as wide as the ScrolledComposite. Only the hight should change.
>> My idea was to add a composite having the RowLayout in a
>> ScrolledComposite but ist seems not to work this way.
>> In Swing I would place all those controls on a JPanel (with FlowLayout
>> set) , add the JPanel in a JScrollPane and everything works as expected.
>> Here an example what I was trying
>> ScrolledComposite scrollPanel = new ScrolledComposite(parent, SWT.BORDER
>> | SWT.V_SCROLL);
>> Composite thumbPanel = new Composite(scrollPanel, SWT.NONE);
>> thumbPanel.setLayout(new RowLayout());
>> for(int i=0; i<100; i++)
>> Canvas canvas = new Canvas(thumbPanel, SWT.BORDER);
>> Any help would be appreciated,
Powered by FUDForum
. Page generated in 0.01422 seconds