SWT: Buttons in ToolBar: always focused
Hi, I'm working on a GUI application with SWT and I've got a problem with buttons in a toolbar.
This is the part that defines the ToolBar:
// Tool Bar
mainTB = new ToolBar(shell, SWT.SHADOW_OUT | SWT.WRAP);
//mainTB.setLocation(3, 3);
ToolItem connectB = new ToolItem(mainTB, SWT.FLAT | SWT.NO_FOCUS);
connectB.setImage(new Image(display, Start.class.getResourceAsStream("/images/JB_logo_24x24.ico")));
connectB.setToolTipText("Connect to JustBase.FM");
new ToolItem(mainTB, SWT.SEPARATOR);
ToolItem optionsB = new ToolItem(mainTB, SWT.FLAT | SWT.NO_FOCUS);
optionsB.setImage(new Image(display, Start.class.getResourceAsStream("/images/JB_logo_24x24.ico")));
ToolItem asd = new ToolItem(mainTB, SWT.FLAT | SWT.TRAVERSE_NONE);
asd.setImage(new Image(display, Start.class.getResourceAsStream("/images/JB_logo_24x24.ico")));
mainTB.pack();
shell.addListener(SWT.Resize, new Listener() {
public void handleEvent(Event event) {
Rectangle clientArea = shell.getClientArea();
mainTB.setSize(mainTB.computeSize(clientArea.width, SWT.DEFAULT));
}
});
What happens is, that the first Button of the toolbar, is always focused. Ican switch the focus to another Button with the arrow keys or with Tab, but I can never get rid of the focus.
Is it possible to make those buttons unfocusable?
And another thing: I've set my ToolBar to wrap around "new ToolBar(shell, SWT.SHADOW_OUT | SWT.WRAP)", but it doesn't do that.
When I make the window smaller that the width of the ToolBar, it simply hides behind the edge of the Window.
Aaand another one: As you can see, I'm using a SWT.SEPARATOR between the first and second button.
Is it possible to change the space between a buttong and the separator?
In Web development terms this would be "padding".
Cheers, and thanks in advance,
--polemon
--
% echo "cbyrzba@cbyrzba.bet" | perl -pe 'y/[0-9A-Za-z]/[5-90-4N-ZA-Mn-za-m]/'