|
|
|
Re: Details section layout problem [message #444464 is a reply to message #444453] |
Wed, 13 October 2004 11:34  |
Eclipse User |
|
|
|
The bug seems to be in ExpandableLayout.layout. When determining the height
of the description for allocating the space required, it uses one width but
when it actually sets the size of the description label it recomputes the
size and uses a width that is about 10 pixels smaller. As a result, the
smaller width causes the label to wrap and the label becomes taller than
expected.
Please enter a bug report against Platform UI.
"Leonid Mokrushin" <leom@it.uu.se> wrote in message
news:ckippj$h8$1@eclipse.org...
>> Can you give some code to show how you are laying out your page?
>
> Here it comes:
>
> public void createContents(Composite parent) {
>
> TableWrapLayout layout = new TableWrapLayout();
> layout.topMargin = 0;
> layout.leftMargin = 5;
> layout.rightMargin = 0;
> layout.bottomMargin = 0;
> parent.setLayout(layout);
>
> Section section = toolkit.createSection(parent, Section.TITLE_BAR |
> Section.DESCRIPTION);
> section.setText(title);
> section.setDescription(description);
> section.marginWidth = 5;
> section.marginHeight = 5;
> TableWrapData td = new TableWrapData(TableWrapData.FILL,
> TableWrapData.TOP);
> td.grabHorizontal = true;
> section.setLayoutData(td);
>
> Composite client = toolkit.createComposite(section);
> GridLayout glayout = new GridLayout();
> glayout.marginWidth = 2;
> glayout.marginHeight = 4;
> glayout.numColumns = 2;
> client.setLayout(glayout);
> section.setClient(client);
>
> Label label = toolkit.createLabel(client, label);
> GridData gd = new GridData(GridData.VERTICAL_ALIGN_CENTER);
> label.setLayoutData(gd);
>
> Text text = toolkit.createText(client, "");
> gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
> gd.horizontalSpan = 1;
> gd.grabExcessHorizontalSpace = true;
> text.setLayoutData(gd);
> text.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
>
> }
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.20174 seconds