Auto adjust of toolbar item [message #1109910] |
Mon, 16 September 2013 01:29  |
Eclipse User |
|
|
|
Hi,
I have one label to be displayed as tool bar item and i have added it to toolbar as ToolControl item. I am able to see it on toolbar but i want to display it on the top right corner of toolbar and it should be auto adjusted if i minimize or maximize the screen. Is it possible to do so? ..Help will be greatly appreciated.
I have used the code below for ToolControl:
final Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout(1,true));
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
Label label= new Label(comp, SWT.NONE);
label.setText("label name");
label.setLayoutData(gridData );
GridDataFactory.fillDefaults().hint(100, SWT.DEFAULT).applyTo(label);
thanks in advance
|
|
|
Re: Auto adjust of toolbar item [message #1115932 is a reply to message #1109910] |
Tue, 24 September 2013 15:46  |
Eclipse User |
|
|
|
The SWT Toolbar's layout is in control of the position / size of the embedded MToolControl. I'm relatively sure that trying to work around this is gonna lead t a world of hurt...
What you might try is to add the item directly as a ToolControl *not* embedded in a Toolbar; that way you own the layout and can put the label and associated TB anywhere you want...
|
|
|
Powered by
FUDForum. Page generated in 0.05128 seconds