Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Details section layout problem
Details section layout problem [message #444289] Mon, 11 October 2004 11:44 Go to next message
Leonid Mokrushin is currently offline Leonid MokrushinFriend
Messages: 25
Registered: July 2009
Junior Member
I'm creating a details page of the master/details block and I'm experiencing
layout problem. When I resize a sash between master and details, somewhere
on the edge when a section description text is about to wrap, the name and
value fields of the section disappear (see attachement). For some reason the
section does not resize the height properly. If I try to make the section
even smaller, everything becomes fine again. There is an about 5 pixels area
of abnormality.

Any idea?


  • Attachment: shot.bmp
    (Size: 155.85KB, Downloaded 114 times)
Re: Details section layout problem [message #444421 is a reply to message #444289] Tue, 12 October 2004 14:33 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Can you give some code to show how you are laying out your page?

"Leonid Mokrushin" <leom@it.uu.se> wrote in message
news:ckdr8q$28m$1@eclipse.org...
> I'm creating a details page of the master/details block and I'm
> experiencing
> layout problem. When I resize a sash between master and details, somewhere
> on the edge when a section description text is about to wrap, the name and
> value fields of the section disappear (see attachement). For some reason
> the
> section does not resize the height properly. If I try to make the section
> even smaller, everything becomes fine again. There is an about 5 pixels
> area
> of abnormality.
>
> Any idea?
>
>
>
Re: Details section layout problem [message #444453 is a reply to message #444421] Wed, 13 October 2004 08:49 Go to previous messageGo to next message
Leonid Mokrushin is currently offline Leonid MokrushinFriend
Messages: 25
Registered: July 2009
Junior Member
> 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);

}
Re: Details section layout problem [message #444464 is a reply to message #444453] Wed, 13 October 2004 15:34 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
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);
>
> }
>
>
Previous Topic:Stand-alone Help Plug-in
Next Topic:SWT for plain COM?
Goto Forum:
  


Current Time: Thu Apr 25 22:38:11 GMT 2024

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

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

Back to the top