custom dialog, controls not getting focus
#1
I want to activate a warning type dialog based on whether mouse input is enabled and whether a certain window is active.

I made a custom dialog with the following conditions:

PHP Code:
<visible>system.getbool(input.enablemouse) + [Window.IsActive(appearancesettings) | Window.IsActive(home)]</visible>
<
defaultcontrol always="true">11</defaultcontrol

In the custom window that is called I have two buttons. One button that should close the custom dialog and take the user to the system settings window, the other should just close the dialog and prevent the custom window to reappear by using a setbool (which would be added to the visibility conditions above)

However the buttons in the dialog window will not get focused, it stays in the underlying window. I tried to use <zorder> but that didn't make a difference.

Is this possible at all?
Reply
#2
Can you add an <onfocus>SetFocus(11)</onfocus> control to the underlying window?
Reply
#3
Hitcher Wrote:Can you add an <onfocus>SetFocus(11)</onfocus> control to the underlying window?

You mean like using a "fake" invisble button to pass that on? I tried that but It didn't work. I don't think a window can pass an action on to another window like that.

However, as I am typing this I remember there's also SendClick(windowid,id) which might be of use...


I also tried to go a similar route first. However then I run into trouble with bypassing the window when the conditions should no longer apply.
I mean, how do you tell xbmc not to open the dialog then and which control to focus on instead?

So I tried to give the parent window:

<defaultcontrol>888</defaultcontrol>

and use conditional includes like:

PHP Code:
<include condition="system.getbool(input.enablemouse)">mouseActivated</include>
<include 
condition="!system.getbool(input.enablemouse)">mouseDeActivated</include> 

where both includes are buttons with id 888 and where one would use <onfocus>ActivateWindow(60)</onfocus> as an action, and the other would close the dialog and setfocus to a control in the parent window instead.

But instead it would just open the custom dialog regardless of the conditions.
Reply
#4
I take it you only want this to show up on home and appearancesettings, then why not code it into those windows?
Reply
#5
Hitcher Wrote:I take it you only want this to show up on home and appearancesettings, then why not code it into those windows?

Good point Laugh

I can see some potential problems with getting focus back to the homemenu for instance and i think I'll have to use quite some conditionals, but I'll see if that works out. Thanks
Reply
#6
Windows activated via <visible> are modeless. The only way to get a window activated modal is to use ActivateWindow.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
custom dialog, controls not getting focus0