Eclipse Forms section and reflow its parent -> No Scrollbars [message #439200] |
Wed, 07 July 2004 06:05 |
Andreas Martin Messages: 6 Registered: July 2009 |
Junior Member |
|
|
Hallo!
My Name is Andreas Martin, this is my first post to this newsgroup. At
the moment I try build a standalone program with the new Eclipse forms api.
I created a MasterDetails formular and in the details page an normal
section and an expandable section. Next you can see the createContents
of the details page.
public void createContents(Composite parent) {
GridLayout gridLayout = new GridLayout();
gridLayout.marginWidth = gridLayout.marginHeight = 5;
gridLayout.numColumns = 1;
parent.setLayout(gridLayout);
// mform is the parent ManagedForm
FormToolkit toolkit = mform.getToolkit();
Section s1 = toolkit.createSection(parent, Section.DESCRIPTION);
s1.marginWidth = 10;
s1.setText("Details");
s1.setDescription("Eigenschaften des ausgewählten Containers.");
GridData gd;
gd = new GridData();
s1.setLayoutData(gd);
Composite client1 = toolkit.createComposite(s1);
gridLayout = new GridLayout();
gridLayout.marginWidth = gridLayout.marginHeight = 5;
gridLayout.numColumns = 2;
client1.setLayout(gridLayout);
toolkit.createLabel(client1, "Bezeichnung:");
txtBezeichnung = toolkit.createText(client1, "", SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
txtBezeichnung.setLayoutData(gd);
.... some more time again .....
s1.setClient(client1);
toolkit.paintBordersFor(client1);
Section s2 = toolkit.createSection(parent, Section.TWISTIE |
Section.DESCRIPTION);
s2.marginWidth = 10;
s2.setText("Details2");
s2.setDescription("Eigenschaften des ausgewählten Containers.2");
gd = new GridData();
// gd = new GridData(GridData.FILL_HORIZONTAL);
s2.setLayoutData(gd);
Composite client2 = toolkit.createComposite(s2);
gridLayout = new GridLayout();
gridLayout.marginWidth = gridLayout.marginHeight = 5;
gridLayout.numColumns = 2;
client2.setLayout(gridLayout);
toolkit.createLabel(client2, "Bezeichnung:");
txtBezeichnung = toolkit.createText(client2, "kaese", SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
txtBezeichnung.setLayoutData(gd);
.... some more time again .....
s2.addExpansionListener(new ExpansionAdapter() {
public void expansionStateChanged(ExpansionEvent e) {
ScrolledForm sForm = mform.getForm();
sForm.reflow(true);
}
});
s2.setClient(client2);
toolkit.paintBordersFor(client2);
toolkit.paintBordersFor(s1);
toolkit.paintBordersFor(s2);
}
For better explanation of the problem I made some screenshots:
http://www.perfectwww.de/temp/Picture1.jpg
http://www.perfectwww.de/temp/Picture2.jpg
http://www.perfectwww.de/temp/Picture3.jpg
In picture one you can see the state of the details page when I run the
program. When I expand the second section the result is in picture two,
no scrollbars are created when the managed parent form is reflowed cause
of the expansionStateChanged event.
On the upper right side I have two buttons to change the sashform
direction (of the masterdetails form) from vertical to horizontal and
back like in the Eclipse Forms examples. When I switch one time to
horizontal and back to vertical my details page is right, it has now
scrollbars. Look at picture three.
Has somebody any idea why the details page gets no scrollbars directly
when I only expand the section?
Many thanks
Andreas
|
|
|
|
Powered by
FUDForum. Page generated in 0.02471 seconds