Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ScolledComposite with Text wrap
ScolledComposite with Text wrap [message #458591] Sat, 16 July 2005 11:42 Go to next message
Lars is currently offline LarsFriend
Messages: 32
Registered: July 2009
Member
Hi all

I have a layout problem, where I can not see the solution:

I have a lot of Text's initialized with WRAP in a composite. Each text
is lined up underneath the previous with a formlayout, and filling the
horizontal space (left = 0, right = 100).

It all looks fine. Each Text wraps perfectally (if necessay due to the
text length).

But if I take the parent composite, and puts it into a ScrolledComposite
the wrapping stops, and instead theres a horizontal scrollbar.

But if don't want to use the horizontal scrollbar, and instead have the
wrapping of each Text (only having the vertical scrollbar), how do I do
that. I have tried anything I could think of without any luck so far ...

Help is highly appreciated :-)

*/Lars
Re: ScolledComposite with Text wrap [message #458592 is a reply to message #458591] Sat, 16 July 2005 12:07 Go to previous messageGo to next message
Lars is currently offline LarsFriend
Messages: 32
Registered: July 2009
Member
Ok, I figured it out ... The computeSize in the composite should be set
correctly with a widthHint instead of just SWT.DEFAULT.

Lars skrev:
> Hi all
>
> I have a layout problem, where I can not see the solution:
>
> I have a lot of Text's initialized with WRAP in a composite. Each text
> is lined up underneath the previous with a formlayout, and filling the
> horizontal space (left = 0, right = 100).
>
> It all looks fine. Each Text wraps perfectally (if necessay due to the
> text length).
>
> But if I take the parent composite, and puts it into a ScrolledComposite
> the wrapping stops, and instead theres a horizontal scrollbar.
>
> But if don't want to use the horizontal scrollbar, and instead have the
> wrapping of each Text (only having the vertical scrollbar), how do I do
> that. I have tried anything I could think of without any luck so far ...
>
> Help is highly appreciated :-)
>
> */Lars
Re: ScolledComposite with Text wrap [message #458662 is a reply to message #458591] Mon, 18 July 2005 17:57 Go to previous message
Arun is currently offline ArunFriend
Messages: 61
Registered: July 2009
Member
To prevent horizonal scroll bars in ScrolledComposite, you have to dop the
following -

>> Do not put SWT.HORIZONTAL as a style bit for the ScrolledComposite
constructor
>> Set a maximum width
>> Set expand horizontal to true


"Lars" <larsr@xruc.dk> wrote in message
news:dbarqd$ib1$1@news.eclipse.org...
> Hi all
>
> I have a layout problem, where I can not see the solution:
>
> I have a lot of Text's initialized with WRAP in a composite. Each text
> is lined up underneath the previous with a formlayout, and filling the
> horizontal space (left = 0, right = 100).
>
> It all looks fine. Each Text wraps perfectally (if necessay due to the
> text length).
>
> But if I take the parent composite, and puts it into a ScrolledComposite
> the wrapping stops, and instead theres a horizontal scrollbar.
>
> But if don't want to use the horizontal scrollbar, and instead have the
> wrapping of each Text (only having the vertical scrollbar), how do I do
> that. I have tried anything I could think of without any luck so far ...
>
> Help is highly appreciated :-)
>
> */Lars
Previous Topic:New User problem: resizing panels
Next Topic:SelectionListener not called when setSelection invoked?
Goto Forum:
  


Current Time: Wed Nov 25 17:59:29 GMT 2020

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

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

Back to the top