Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ExpandItem header height?
ExpandItem header height? [message #557519] Tue, 07 September 2010 23:05 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 16
Registered: May 2010
Junior Member
Hi all,
I'm sure this is quite the newbie question, but is there an easy way to change an ExpandItem's header height? I see that there is a getHeaderHeight() method, but no setter. Can the height be adjusted somehow by using layouts?

Thanks!
Jim
Re: ExpandItem header height? [message #557832 is a reply to message #557519] Thu, 09 September 2010 07:01 Go to previous messageGo to next message
Lakshmi P ShanmugamFriend
Messages: 279
Registered: July 2009
Location: India
Senior Member
Hi,

The height of the ExpandItem's header is automatically computed and adjusted based on the font size, image size and chevron size, so that the text and image are properly displayed. So, you don't need to set the size of the header. Why do you want to change the header size?


Lakshmi P Shanmugam
Re: ExpandItem header height? [message #1061093 is a reply to message #557832] Wed, 29 May 2013 21:08 Go to previous message
Anatoliy Pogorelov is currently offline Anatoliy PogorelovFriend
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 212 times)
Previous Topic:How to detect that code is running in Development environment or in generic Eclipse using Plugins?
Next Topic:[GTK-Linux] All context disappeared when open embedded view
Goto Forum:
  


Current Time: Thu Apr 25 20:48:04 GMT 2024

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

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

Back to the top