Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Toogle Button NO_FOCUS
Toogle Button NO_FOCUS [message #890170] Thu, 21 June 2012 11:11 Go to next message
David Casas is currently offline David CasasFriend
Messages: 58
Registered: November 2011
Location: Barcelona
Member


I have a problem with Focusable Buttons on Eclipse Rap. I have defined some Toogle buttons with some css style when your mouse is over it, with it is selected and when it is not. The thing is the focus on the button is making it look odd.

I have tried
btnAnimals = new Button(panel, SWT.TOGGLE | SWT.NO_FOCUS);

with no exit. And finally I decided to implement a FocusAdapter for the buttons:

FocusListener focusListener = new FocusAdapter() {
        @Override
        public void focusGained(FocusEvent event) {
            txtStreet.setFocus();
        }
    };
    btnAnimals.addFocusListener(focusListener);


The strange issue that this listener is only called ONCE. Do you know what I am doing wrong? Is it a bug?

Thanks in advance
Re: Toogle Button NO_FOCUS [message #891508 is a reply to message #890170] Mon, 25 June 2012 06:19 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
according to the documentation SWT.NO_FOCUS is not available for Button.
Ofcourse, you could remove the focus related styling by overriding the
Button-FocusIndicator definitions.
HTH,
Ivan


On 6/21/2012 2:11 PM, David Casas wrote:
>
> I have a problem with Focusable Buttons on Eclipse Rap. I have defined
> some Toogle buttons with some css style when your mouse is over it,
> with it is selected and when it is not. The thing is the focus on the
> button is making it look odd.
>
> I have tried
>
> btnAnimals = new Button(panel, SWT.TOGGLE | SWT.NO_FOCUS);
>
> with no exit. And finally I decided to implement a FocusAdapter for
> the buttons:
>
>
> FocusListener focusListener = new FocusAdapter() {
> @Override
> public void focusGained(FocusEvent event) {
> txtStreet.setFocus();
> }
> };
> btnAnimals.addFocusListener(focusListener);
>
>
> The strange issue that this listener is only called ONCE. Do you know
> what I am doing wrong? Is it a bug?
>
> Thanks in advance
>

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Toogle Button NO_FOCUS [message #891554 is a reply to message #891508] Mon, 25 June 2012 08:29 Go to previous message
David Casas is currently offline David CasasFriend
Messages: 58
Registered: November 2011
Location: Barcelona
Member

Thank you so much Ivan, I did'nt realised that. You help me a lot Smile
Previous Topic:The RAP incubator multi-header table controls, like to the Nebula Grid widget?
Next Topic:Webapplication content parsable by Google
Goto Forum:
  


Current Time: Thu Apr 25 10:46:41 GMT 2024

Powered by FUDForum. Page generated in 0.03359 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top