Layouting and component size calculation [message #71742] |
Fri, 25 January 2008 09:23 |
Eclipse User |
|
|
|
Originally posted by: steffen.euch.cas.de
Hi,
is there a know bug concerning the layouting in RWT, handling of margins or
size calculation? My problem is an empty space at the right side of my
components.
This is the Layout (I tried FillLayout and GridLayout also):
RowLayout layout = new RowLayout(SWT.HORIZONTAL);
layout.marginLeft = 0;
layout.marginRight = 0;
layout.marginTop = 0;
layout.marginWidth = 0;
layout.marginHeight = 0;
layout.spacing = 0;
this.composite = new Composite(this, SWT.NONE);
this.composite.setLayout(layout);
I also tried to add these lines:
layout.justify = false;
layout.pack = true;
layout.fill = false;
When I add Labels to the composite, I want them to touch each other without
any gap. But the texts have an empty space between them.
When I activate the border of the Labels, I see a space at the right side of
each Label, inside of the border.
Do you know the reason for that behaviour?
Regards,
Steffen
|
|
|
Re: Layouting and component size calculation [message #71896 is a reply to message #71742] |
Mon, 28 January 2008 10:14 |
Eclipse User |
|
|
|
Originally posted by: rsternberg.innoopract.com
Hi Steffen,
this is not a layout problem. When you set a background color on the Labels
you'll see that there is no gap between them. The problem lies in the Label
#computeSize() method, where we add an extra space of 8 px to the width of
the Label. This is a leftover from times when we estimated the text size. I
will evaluate if we can safely drop this extra space.
Thanks for the hint,
Ralf
> is there a know bug concerning the layouting in RWT, handling of margins
> or size calculation? My problem is an empty space at the right side of my
> components.
>
> This is the Layout (I tried FillLayout and GridLayout also):
>
> RowLayout layout = new RowLayout(SWT.HORIZONTAL);
> layout.marginLeft = 0;
> layout.marginRight = 0;
> layout.marginTop = 0;
> layout.marginWidth = 0;
> layout.marginHeight = 0;
> layout.spacing = 0;
> this.composite = new Composite(this, SWT.NONE);
> this.composite.setLayout(layout);
>
> I also tried to add these lines:
> layout.justify = false;
> layout.pack = true;
> layout.fill = false;
>
> When I add Labels to the composite, I want them to touch each other
> without any gap. But the texts have an empty space between them.
> When I activate the border of the Labels, I see a space at the right side
> of each Label, inside of the border.
>
> Do you know the reason for that behaviour?
>
> Regards,
>
> Steffen
|
|
|
Powered by
FUDForum. Page generated in 0.02554 seconds