Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to prevent new Shell/Button from gaining focus ?
How to prevent new Shell/Button from gaining focus ? [message #446997] Tue, 07 December 2004 14:56 Go to next message
Florian Georg is currently offline Florian GeorgFriend
Messages: 22
Registered: July 2009
Junior Member
I've got the following problem:
while the user types some text into a StyledText control, I want to open
a new, small Shell (containing commit/undo buttons).
The problem is that the shell (resp. the first button inside it) gains
the focus whenever it is triggered to show up.
How can I avoid this ? Is it possible to make buttons that can be
clicked, but never gain the focus ?

thanks in advance
Florian
Re: How to prevent new Shell/Button from gaining focus ? [message #447010 is a reply to message #446997] Tue, 07 December 2004 19:43 Go to previous messageGo to next message
Mani Ghamari is currently offline Mani GhamariFriend
Messages: 33
Registered: July 2009
Member
Hi,

How about callin Control.forceFocus() on the StyledText after creating and
opening the shell? That would force the StyledText control to gain keyboard
focus...

regards,

Mani

"Florian Georg" <FGeorg@gmx.de> wrote in message
news:cp4gbk$td4$1@www.eclipse.org...
> I've got the following problem:
> while the user types some text into a StyledText control, I want to open a
> new, small Shell (containing commit/undo buttons).
> The problem is that the shell (resp. the first button inside it) gains the
> focus whenever it is triggered to show up.
> How can I avoid this ? Is it possible to make buttons that can be clicked,
> but never gain the focus ?
>
> thanks in advance
> Florian
Re: How to prevent new Shell/Button from gaining focus ? [message #447011 is a reply to message #447010] Tue, 07 December 2004 19:50 Go to previous messageGo to next message
Fabian Wolf is currently offline Fabian WolfFriend
Messages: 96
Registered: July 2009
Member
Mani Ghamari wrote:

> Hi,
>
> How about callin Control.forceFocus() on the StyledText after creating and
> opening the shell? That would force the StyledText control to gain
> keyboard focus...

I'm having the same problem,... neither setFocus nor forceFocus could help.
What could prevent those methods from succeding?
Both methods return if they succeded, so I guess a failure does not mean one
has to file a bug report...


> regards,
>
> Mani
>
> "Florian Georg" <FGeorg@gmx.de> wrote in message
> news:cp4gbk$td4$1@www.eclipse.org...
>> I've got the following problem:
>> while the user types some text into a StyledText control, I want to open
>> a new, small Shell (containing commit/undo buttons).
>> The problem is that the shell (resp. the first button inside it) gains
>> the focus whenever it is triggered to show up.
>> How can I avoid this ? Is it possible to make buttons that can be
>> clicked, but never gain the focus ?
>>
>> thanks in advance
>> Florian
Re: How to prevent new Shell/Button from gaining focus ? [message #447013 is a reply to message #446997] Tue, 07 December 2004 20:25 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
1) Use SWT.ON_TOP and Shell.setVisible() rather than Shell.open()
2) It's not possible to make a button reject focus.

"Florian Georg" <FGeorg@gmx.de> wrote in message
news:cp4gbk$td4$1@www.eclipse.org...
> I've got the following problem:
> while the user types some text into a StyledText control, I want to open
> a new, small Shell (containing commit/undo buttons).
> The problem is that the shell (resp. the first button inside it) gains
> the focus whenever it is triggered to show up.
> How can I avoid this ? Is it possible to make buttons that can be
> clicked, but never gain the focus ?
>
> thanks in advance
> Florian
Previous Topic:table that allows only one row
Next Topic:SWT JFace Standalone Wizard
Goto Forum:
  


Current Time: Fri Apr 19 05:34:31 GMT 2024

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

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

Back to the top