Combining SashForm and ExpandBar [message #329644] |
Mon, 30 June 2008 15:59  |
Eclipse User |
|
|
|
Hi Folks,
Is it possible to combine SashForm with ExpandBar so I can adjust the heights of an expanded item?
So, I've been playing with Snippet223 and can get the ExpandBar working great but I'd like to be able to adjust the relative hights of the expanded items so thought a SashForm would be ideal. I can't get anything to work though and will often get the "wrong parent" error when experimenting.
Any ideas?
Cheers,
Toby
|
|
|
Re: Combining SashForm and ExpandBar [message #329646 is a reply to message #329644] |
Mon, 30 June 2008 16:37  |
Eclipse User |
|
|
|
I think I answered my own question! I was playing with a Sash rather than SashForm and can add it to the composite that the ExpandItem will display, then adjust the height based on the event's capture's Y co-ordinate.
It doesn't drag past the bottom of the compisite but is prob ok.
final ExpandItem expandable = new ExpandItem(bar, SWT.NONE, 0);
expandable.setControl(composite);
Sash sash = new Sash(composite, SWT.HORIZONTAL);
sash.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
sash.addMouseListener(new MouseAdapter() {
@Override
public void mouseUp(MouseEvent e) {
expandable.setHeight(expandable.getHeight() + e.y);
}
});
|
|
|
Powered by
FUDForum. Page generated in 0.02502 seconds