d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Swt Wrap Text
Add Reply New Topic New Poll
Member
Posts: 8,635
Joined: Dec 28 2007
Gold: 87.00
May 24 2012 10:07am
I would like to have Label that has minimum size of 900x100 pixels. When text is bigger (doesnt fit in the Label) I would like it to keep the maximum width given and raise the height so the text is fit in the Label.

Example now in the 900x100 Label I can have 4 lines of text, so if there was 8 lines of text I would like it to change Label size to 900x200 pixels. Text comes from database and it can vary from couple words to upto 4096 characters and I would like to have always right size of label for it.

If it matters I have a shell for Label and this shell has nothing else than one Label. (custom made tooltip)

Thanks.
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
May 24 2012 11:05am
you've been asking for swt help here for a while, but nobody has ever responded with answers iirc. I'd suggest trying some place else for swt specific stuff.

my general tips though:
1. look for a multi-line property that will word wrap. if it doesn't exist, try a text box that's read only. if this won't work either, subclass it
2. if you do not see an expandable property like you want, subclass it and override the setText(..) to resize based on a new property you add
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll