First ToolItem has raised border in SWT standalone app [message #460084] |
Mon, 22 August 2005 10:20 |
Eclipse User |
|
|
|
Originally posted by: thorsten.dithosoft.de
Hi,
I'm currently teaching myself how to use SWT in standalone applications.
I'm creating a flat toolbar on a coolbar and I have the problem that the
first button has a raised border when the application starts as if the
mouse was over it, even though it isn't.
The code is as follows:
private void initializeToolbar() {
CoolBar coolBar = new CoolBar(m_shell,SWT.FLAT);
coolBar.setLayoutData(new GridData(...));
m_toolBar = new ToolBar(coolBar,SWT.HORIZONTAL | SWT.FLAT | SWT.WRAP);
m_toolBarNew = createToolItem(m_toolBar,SWT.PUSH,m_imageNew,"New");
m_toolBarOpen = createToolItem(m_toolBar,SWT.PUSH,m_imageOpen,"Open");
...
CoolItem item1 = new CoolItem(coolBar,SWT.NONE);
item1.setControl(m_toolBar);
...
}
ToolItem createToolItem(ToolBar parent, int style, Image image, String
toolTip) {
ToolItem item = new ToolItem(parent,style);
item.setImage(image);
item.setToolTipText(toolTip);
return item;
}
How do I fix this?
Thanks
Thorsten
|
|
|
Re: First ToolItem has raised border in SWT standalone app [message #460088 is a reply to message #460084] |
Mon, 22 August 2005 10:53 |
Boris Munivrana Messages: 23 Registered: July 2009 |
Junior Member |
|
|
Hi Thorsten,
just set the focus onto another control after initializing your toolbar.
Regards,
Boris
Thorsten Dittmar wrote:
> Hi,
> I'm currently teaching myself how to use SWT in standalone applications.
> I'm creating a flat toolbar on a coolbar and I have the problem that the
> first button has a raised border when the application starts as if the
> mouse was over it, even though it isn't.
> The code is as follows:
> private void initializeToolbar() {
> CoolBar coolBar = new CoolBar(m_shell,SWT.FLAT);
> coolBar.setLayoutData(new GridData(...));
> m_toolBar = new ToolBar(coolBar,SWT.HORIZONTAL | SWT.FLAT | SWT.WRAP);
> m_toolBarNew = createToolItem(m_toolBar,SWT.PUSH,m_imageNew,"New");
> m_toolBarOpen = createToolItem(m_toolBar,SWT.PUSH,m_imageOpen,"Open");
> ...
> CoolItem item1 = new CoolItem(coolBar,SWT.NONE);
> item1.setControl(m_toolBar);
> ...
> }
> ToolItem createToolItem(ToolBar parent, int style, Image image, String
> toolTip) {
> ToolItem item = new ToolItem(parent,style);
> item.setImage(image);
> item.setToolTipText(toolTip);
> return item;
> }
> How do I fix this?
> Thanks
> Thorsten
|
|
|
|
Powered by
FUDForum. Page generated in 0.03001 seconds