Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Combining SashForm and ExpandBar
Combining SashForm and ExpandBar [message #329644] Mon, 30 June 2008 19:59 Go to next message
Toby Weston is currently offline Toby WestonFriend
Messages: 22
Registered: July 2009
Junior Member
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 20:37 Go to previous message
Toby Weston is currently offline Toby WestonFriend
Messages: 22
Registered: July 2009
Junior Member
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);
    }
});
Previous Topic:Ant editor outline view support for ant-contrib?
Next Topic:Running Selected Ant target
Goto Forum:
  


Current Time: Thu Jul 18 21:34:16 GMT 2024

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

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

Back to the top