How to put the toolbar text beside the image [message #457136] |
Fri, 17 June 2005 17:49  |
Eclipse User |
|
|
|
Hi there,
I have a toolbar with buttons, some of which have text, all of which have
icons.
I would like the text to appear to the left of the image. By default the
text appears below the image.
Is there any way to do this in SWT?
Here's some sample code of how I'm building the toolbar:
ToolBar toolbar = new ToolBar (parent, SWT.HORIZONTAL | SWT.FLAT);
ToolItem button = new ToolItem (toolbar, SWT.NONE);
button.setText ("MyButton");
button.setToolTipText( "This is my button");
button.setImage (Images.getMyImage());
GridData gridData = new GridData (GridData.FILL_HORIZONTAL);
toolbar.setLayoutData (gridData);
Thanks
Damian
|
|
|
|
Re: How to put the toolbar text beside the image [message #457196 is a reply to message #457165] |
Mon, 20 June 2005 19:15   |
Eclipse User |
|
|
|
Thanks, SWT.RIGHT worked.
Although, it seemed to be needed in the constructor of the toolbar, rather
than the ToolItem constructor:
ToolBar toolbar = new ToolBar (parent, SWT.HORIZONTAL | SWT.FLAT |
SWT.RIGHT);
"Grant Gayed" <grant_gayed@ca.ibm.com> wrote in message
news:d96hfa$b83$1@news.eclipse.org...
> The closest you can get is to have your text appear to the right of your
> image. To do this create your ToolItems with style SWT.RIGHT.
>
> Grant
>
> "Damian" <damian_biollo@hotmail.com> wrote in message
> news:d8vgho$t92$1@news.eclipse.org...
> > Hi there,
> >
> > I have a toolbar with buttons, some of which have text, all of which
have
> > icons.
> > I would like the text to appear to the left of the image. By default the
> > text appears below the image.
> >
> > Is there any way to do this in SWT?
> >
> >
> > Here's some sample code of how I'm building the toolbar:
> >
> > ToolBar toolbar = new ToolBar (parent, SWT.HORIZONTAL |
SWT.FLAT);
> >
> > ToolItem button = new ToolItem (toolbar, SWT.NONE);
> > button.setText ("MyButton");
> > button.setToolTipText( "This is my button");
> > button.setImage (Images.getMyImage());
> >
> > GridData gridData = new GridData (GridData.FILL_HORIZONTAL);
> > toolbar.setLayoutData (gridData);
> >
> > Thanks
> > Damian
> >
> >
>
>
|
|
|
Re: How to put the toolbar text beside the image [message #457204 is a reply to message #457196] |
Tue, 21 June 2005 09:28  |
Eclipse User |
|
|
|
Right, my mistake. It is applied to all items within a ToolBar, not
individual items.
"Damian" <damian_biollo@hotmail.com> wrote in message
news:d97ilo$kuk$1@news.eclipse.org...
> Thanks, SWT.RIGHT worked.
>
> Although, it seemed to be needed in the constructor of the toolbar, rather
> than the ToolItem constructor:
> ToolBar toolbar = new ToolBar (parent, SWT.HORIZONTAL | SWT.FLAT |
> SWT.RIGHT);
>
>
> "Grant Gayed" <grant_gayed@ca.ibm.com> wrote in message
> news:d96hfa$b83$1@news.eclipse.org...
> > The closest you can get is to have your text appear to the right of your
> > image. To do this create your ToolItems with style SWT.RIGHT.
> >
> > Grant
> >
> > "Damian" <damian_biollo@hotmail.com> wrote in message
> > news:d8vgho$t92$1@news.eclipse.org...
> > > Hi there,
> > >
> > > I have a toolbar with buttons, some of which have text, all of which
> have
> > > icons.
> > > I would like the text to appear to the left of the image. By default
the
> > > text appears below the image.
> > >
> > > Is there any way to do this in SWT?
> > >
> > >
> > > Here's some sample code of how I'm building the toolbar:
> > >
> > > ToolBar toolbar = new ToolBar (parent, SWT.HORIZONTAL |
> SWT.FLAT);
> > >
> > > ToolItem button = new ToolItem (toolbar, SWT.NONE);
> > > button.setText ("MyButton");
> > > button.setToolTipText( "This is my button");
> > > button.setImage (Images.getMyImage());
> > >
> > > GridData gridData = new GridData (GridData.FILL_HORIZONTAL);
> > > toolbar.setLayoutData (gridData);
> > >
> > > Thanks
> > > Damian
> > >
> > >
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 2.93265 seconds