views:

110

answers:

1

Hi Guys , I do have a problem with IToolbarManager. I have added a combo & spinner ot toolbar of a view like this

IToolbarManager mgr = getViewSite().getActionBars().getToolBarManager();
mgr.add(spinnerCntrAction);

spinnerCntrAction = new ControContribution(){

 public Control createControl(){
        //Creates composite
        //Create a spinner and add that to composite
        //return composite
 }


};

In windows XP/Vista themes this spinner is shown correctly. But when program is run under windows classic theme , the spinner is shrinked and not shown correctly.

Is this a known problem ? Do you know any workaround/patch for this ?

Thanks Jijoy

A: 

This is a bug in SWT. See http://dev.eclipse.org/newslists/news.eclipse.platform.swt/msg44671.html

Here is a workaround:

mgr.add(new DummyAction());

private static class DummyAction extends Action {
   DummyAction() {
      setEnabled(false);
      setText("     ");
   }
}
...
mgr.add(spinnerCntrAction);

This will cause the toolbar manager to make all control contributions the same size as the Action, so adjust the number of spaces in the Action text to get the desired result.

Lars
Thanks a lot for answer. This bug is fixed in 3.5.0
Jijoy
Ok. Thanks for the info.
Lars