Problem making section content scrollable [message #526654] |
Mon, 12 April 2010 14:08 |
Oliver Kolling Messages: 24 Registered: April 2010 |
Junior Member |
|
|
Hi, I created a form containing several sections, where some of the section are created with a TableWrapLayout, that have a dynamic size. I would like to keep all sections the same size and make them scrollable as soon as the content exceeds the space I reserved for the sections height. Unfortunatelly I tried already everything like scrolled forms or scrollabelcomposite in any combination. But it looks like that anything that can be scrollable has to have as parent a shell. If I put a scrollabel composite in a form or in a section of a form where section or form is the parent , the scrolling does not work.
I'm missing any point here, or is it simply not possible to have the content of a section scrollable ???
Below my code that creates the sections dynamic content.
Thanks...
TableWrapLayout section_layout = new TableWrapLayout();
section_layout.numColumns = 2;
GridData section_layoutData;
section_layoutData = new GridData(GridData.FILL);
section_layoutData.grabExcessHorizontalSpace = true;
section_layoutData.grabExcessVerticalSpace =true;
section_layoutData.minimumWidth = MINSECTION_WITH;
section_layoutData.heightHint = SECTION_HIGHT;
section_layoutData.horizontalAlignment = org.eclipse.swt.layout.GridData.CENTER;
section_layoutData.verticalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;
Section section = formToolkit.createSection(dtcForm.getBody(), Section.DESCRIPTION | Section.TITLE_BAR | Section.TWISTIE |Section.EXPANDED);
Composite sectionClient = formToolkit.createComposite(section, SWT.NONE);
section.setClient(sectionClient);
sectionClient.setLayout(section_layout);
section.setLayoutData(section_layoutData);
section.setText("Commentaire de l'utilisateur");
section.setDescription("");
Label label;
TableWrapData td;
for (Cmt cmt : cmtLst)
{
td = new TableWrapData();
td.rowspan = 2;
td.maxWidth = 60;
td.grabHorizontal=true;
//label = formToolkit.createLabel(parent, cmt.getDatcre(), SWT.CENTER);
label = new Label(parent, SWT.CENTER);
label.setText(cmt.getDatcre());
label.setFont(UIConstants.CMT_DATE_FONT);
//label.setBackground(UIConstants.LIGHT_GREY_235);
label.setLayoutData(td);
td = new TableWrapData();
td.maxWidth = 200;
td.grabHorizontal=true;
//label = formToolkit.createLabel(parent, cmt.getUtl(), SWT.NONE );
label = new Label(parent, SWT.CENTER);
label.setText(cmt.getUtl());
label.setFont(UIConstants.CMT_CRE_FONT);
//label.setBackground(UIConstants.LIGHT_GREY_235);
label.setLayoutData(td);
td = new TableWrapData();
td.maxWidth = 200;
td.grabHorizontal=true;
//label = formToolkit.createLabel(parent, cmt.getTxt(), SWT.WRAP );
label = new Label(parent, SWT.CENTER);
label.setText( cmt.getTxt());
label.setFont(UIConstants.CMT_TXT_FONT);
label.setLayoutData(td);
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.03293 seconds