Page 1 of 1

Multiple panels - focus handling

Posted: 26 Feb 2015, 23:13
by andreasg
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?

Re: Multiple panels - focus handling

Posted: 27 Feb 2015, 03:11
by jsantos
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.

Re: Multiple panels - focus handling

Posted: 27 Feb 2015, 07:08
by andreasg
That will maybe solve the event handling, but what about the visual effects of focusing?

Re: Multiple panels - focus handling

Posted: 27 Feb 2015, 18:12
by jsantos
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.

Re: Multiple panels - focus handling

Posted: 28 Feb 2015, 11:21
by andreasg

Re: Multiple panels - focus handling

Posted: 02 Mar 2015, 20:42
by sfernandez
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 ;)