|
|
Re: ExpandItem header height? [message #1061093 is a reply to message #557832] |
Wed, 29 May 2013 21:08 |
Anatoliy Pogorelov Messages: 10 Registered: April 2013 |
Junior Member |
|
|
Hi, when I'm change the size of the font or set image, heigth in header computed. But expandbar control does not fall (see pictures).
My code is:
FormToolkit toolkit = new FormToolkit(parent.getDisplay());
ScrolledForm form = toolkit.createScrolledForm(parent);
form.setText("Реестр оказанных услуг");
setStyleForScrolledForm(form);
final Composite container = form.getBody();
container.setLayout(new FormLayout());
final ExpandBar expBarFilters = new ExpandBar(container, SWT.V_SCROLL);
final FormData fdExpBarFilters = new FormData();
fdExpBarFilters.top = new FormAttachment(0, 0);
fdExpBarFilters.left = new FormAttachment(0, 10);
fdExpBarFilters.right = new FormAttachment(100, -10);
expBarFilters.setLayoutData(fdExpBarFilters);
expBarFilters.setData(RWT.CUSTOM_VARIANT,"Seach");
Composite expBarComposite = new Composite (expBarFilters, SWT.NONE);
final FormData fdExpBarComposite = new FormData();
fdExpBarComposite.top = new FormAttachment(0, 0);
fdExpBarComposite.left = new FormAttachment(0, 0);
fdExpBarComposite.right = new FormAttachment(100, 0);
expBarComposite.setLayout(new FormLayout());
expBarComposite.setLayoutData(fdExpBarComposite);
expBarComposite.setData(RWT.CUSTOM_VARIANT,"Seach");
ExpandItem expItemFilters = new ExpandItem(expBarFilters, SWT.NONE, 0);
expItemFilters.setText("Filters");
expItemFilters.setControl(expBarComposite);
expItemFilters.setData(RWT.CUSTOM_VARIANT,"Seach");
expItemFilters.setExpanded(true);
expBarFilters.addExpandListener(new ExpandListener() {
private static final long serialVersionUID = -7185326081415952521L;
@Override
public void itemExpanded(ExpandEvent arg0) {
expBarFilters.layout(true);
container.layout(true);
}
@Override
public void itemCollapsed(ExpandEvent arg0) {
container.layout(true);
}
});
expItemFilters.setExpanded(true);
Label lblProfile = BaseWidgets.createLabel(expBarComposite, "Profile", SWT.NONE, null, 12, null, 10);
etc...
expItemFilters.setHeight(expBarComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + 10);
Please, Help.
Thanks.
-
Attachment: pict.jpg
(Size: 34.79KB, Downloaded 226 times)
|
|
|
Powered by
FUDForum. Page generated in 0.02380 seconds