Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Button at Status Bar
icon5.gif  Button at Status Bar [message #550633] Tue, 03 August 2010 23:37 Go to next message
Rencana Tarigan is currently offline Rencana TariganFriend
Messages: 56
Registered: July 2009
Location: Bandung, Indonesia
Member

How to adjust vertical align for the button, here is the screenshot

http://img203.imageshack.us/img203/739/39244616.png

And here is the code

protected Control createControl(Composite parent) {
		parent.setLayout(new GridLayout(1, false));
		Composite upgradeSpaceComposite = new Composite(parent, SWT.NONE);
		upgradeSpaceComposite.setLayout(new GridLayout(1, false));
		GridData layoutData = new GridData();
		layoutData.verticalAlignment = SWT.TOP;
		upgradeSpaceComposite.setLayoutData(layoutData);
		Button upgradeSpaceButton = new Button(upgradeSpaceComposite, SWT.FLAT);
		upgradeSpaceButton.setText("Upgrade Space");
		return upgradeSpaceComposite;
	}


Re: Button at Status Bar [message #550694 is a reply to message #550633] Wed, 04 August 2010 07:30 Go to previous messageGo to next message
T. Wilhelm is currently offline T. WilhelmFriend
Messages: 129
Registered: July 2009
Senior Member
Hey,

in your example you only set the LayoutData to the composite but not to the Button.
You should set GridLayoutData also to your button. If that doesnt work, try to remove the borderheight of your composite-gridlayout, so your button has more space.

Greetz
Thomas
Re: Button at Status Bar [message #551009 is a reply to message #550694] Wed, 04 August 2010 19:56 Go to previous message
Rencana Tarigan is currently offline Rencana TariganFriend
Messages: 56
Registered: July 2009
Location: Bandung, Indonesia
Member

Already solve with this code :

protected Control createControl(Composite parent) {
		GridLayout layout = new GridLayout(1, false);
		parent.setLayout(layout);
		Composite upgradeSpaceComposite = new Composite(parent, SWT.NONE);
		layout.marginHeight = 0;
		upgradeSpaceComposite.setLayout(layout);
		GridData layoutData = new GridData();
		upgradeSpaceComposite.setLayoutData(layoutData);
		Button upgradeSpaceButton = new Button(upgradeSpaceComposite, SWT.FLAT);
		layoutData = new GridData();
		layoutData.heightHint = 22;
		upgradeSpaceButton.setText("Upgrade Space");
		upgradeSpaceButton.setLayoutData(layoutData);
		upgradeSpaceButton.pack();
		return upgradeSpaceComposite;
	}


Previous Topic:Missing Plug-in (Flash not working)
Next Topic:Cut / Copy / Paste - Disable / Enable handlers
Goto Forum:
  


Current Time: Sat Dec 20 08:50:48 GMT 2014

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

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