andreasg
Topic Author
Posts: 8
Joined: 22 Nov 2013, 08:44

Multiple panels - focus handling

26 Feb 2015, 23:13

I'm using several panels to show one main UI and a couple of sub UIs located in the 3d world.

By clicking at elements, one element per panel is getting focus.
This gives strange behavior, for example, when entering text.

Is there any way to "De"-focus elements in the other panels?
 
User avatar
jsantos
Site Admin
Posts: 2563
Joined: 20 Jan 2012, 17:18
Contact:

Re: Multiple panels - focus handling

27 Feb 2015, 03:11

There are three properties in NoesisGUIPanel (_enableKeyboard, _enableMouse and _enableTouch) that control the kind of inputs events that are active.

Could you try to enable and disable those properties to handle your scenario? If it works we could think a better way to expose it.
 
andreasg
Topic Author
Posts: 8
Joined: 22 Nov 2013, 08:44

Re: Multiple panels - focus handling

27 Feb 2015, 07:08

That will maybe solve the event handling, but what about the visual effects of focusing?
 
User avatar
jsantos
Site Admin
Posts: 2563
Joined: 20 Jan 2012, 17:18
Contact:

Re: Multiple panels - focus handling

27 Feb 2015, 18:12

Yes, we need a new function to "unfocus" a panel. Please, try the solution I gave you and if everything is right we will improve the API to support this in a clean way.
 
andreasg
Topic Author
Posts: 8
Joined: 22 Nov 2013, 08:44

Re: Multiple panels - focus handling

28 Feb 2015, 11:21

 
User avatar
sfernandez
Site Admin
Posts: 1628
Joined: 22 Dec 2011, 19:20

Re: Multiple panels - focus handling

02 Mar 2015, 20:42

Can't be done directly, but you can do it with current API:
void ClearFocus(NoesisGUIPanel gui)
{
  var content = (UIElement)gui.GetContent();
  var keyboard = content.GetKeyboard();
  keyboard.Focus(null);
}
This should do the trick ;)

Who is online

Users browsing this forum: No registered users and 4 guests