[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.swt] Form Section height and content with RowLayout
|
- From: mgordienko@xxxxxxx (Maxim Gordienko)
- Date: Sun, 12 Nov 2006 17:33:47 +0000 (UTC)
- Newsgroups: eclipse.platform.swt
- Organization: Eclipse
- User-agent: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)
Hello!
I really stuck with RowLayout. Is it possible to force widget to
recalculate height when its width changes, and child controls wrap
around?
For example Section displayed with following code only have single row
which does not change height.
-----------
final Section section = toolkit.createSection(body, Section.TWISTIE |
Section.EXPANDED | Section.TITLE_BAR);
final Composite composite = new Composite(section, SWT.NONE);
RowLayout rowLayout = new RowLayout();
rowLayout.wrap = true;
composite.setLayout(rowLayout);
section.setClient(composite);
for(int i = 0; i < 10; i++) {
Button button = new Button(composite, SWT.NONE);
button.setText("button" + i);
}
composite.addListener(SWT.Resize, new Listener() {
public void handleEvent(Event e) {
Point size = composite.getSize();
Point size2 = composite.computeSize(size.x, SWT.DEFAULT);
section.setSize(size2);
}
});
-----------
I find in this newsgroup a solution for ExpandBar (changing ExpandItem
height
upon resize) but the solution does not work with Section.
Really appreciate your help!