Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Control is not on focus but still visible?(How to determine this status?)
Control is not on focus but still visible? [message #1725086] Mon, 29 February 2016 15:36 Go to next message
Piero Campalani is currently offline Piero CampalaniFriend
Messages: 114
Registered: January 2015
Senior Member

Dear experts,

is there a way I can realize that an SWT control is visible to the end-user, even not being the focus of the application?

*thanks*

[Updated on: Mon, 29 February 2016 15:36]

Report message to a moderator

Re: Control is not on focus but still visible? [message #1725089 is a reply to message #1725086] Mon, 29 February 2016 16:09 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

Do you mean in another shell like in a pop-up message or something? You can do so with style bits [1]:

fShell = new Shell(display, SWT.NO_TRIM | SWT.ON_TOP | SWT.NO_FOCUS);


[1] https://dev.eclipse.org/mhonarc/lists/nebula-dev/msg02752.html
Re: Control is not on focus but still visible? [message #1725136 is a reply to message #1725089] Tue, 01 March 2016 08:07 Go to previous messageGo to next message
Piero Campalani is currently offline Piero CampalaniFriend
Messages: 114
Registered: January 2015
Senior Member

Thanks for the hint. !
No, I meant to find a way to verify that an SWT control is visible to the user.

Afaik isVisible() controls the "potential" of being visible, not is current status of actual visibility.
Otoh try isFocusControl() is too strict for my needs since I want to operate on parts which are not on focus too. !

-Piero
Re: Control is not on focus but still visible? [message #1725150 is a reply to message #1725136] Tue, 01 March 2016 09:41 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

isVisible() is what you want. The SWT book states that isVisible() returns true if it and all of its ancestors are visible. However, it could be drawn outside of the visible area (e.g. you move your window to the edge of the screen, or another control overlaps it) (or the user has switched off his monitor or closed his eyes Wink.

[Updated on: Tue, 01 March 2016 09:41]

Report message to a moderator

Re: Control is not on focus but still visible? [message #1725190 is a reply to message #1725150] Tue, 01 March 2016 14:06 Go to previous message
Piero Campalani is currently offline Piero CampalaniFriend
Messages: 114
Registered: January 2015
Senior Member

Great... -.-'
Thank you Wim!
Previous Topic:Android Not showing
Next Topic:How to customize the Classic or Default theme?
Goto Forum:
  


Current Time: Thu Apr 25 11:25:54 GMT 2024

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

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

Back to the top