ControlGroup.HasFocus broken?
#1
This function doesn't seem to work anymore. It used to, but now code I have that uses it doesn't function properly.

If I do ControlGroup(9000).HasFocus(0), I always get a true.
If I do ControlGroup(9000).HasFocus(10), I always get a false.

According to the docs, a control ID of 0 should return true if any control in that group is focused, false otherwise. A control ID of a specific control (ie 10), would return true if that control in that group has focus.

"Returns true if the control group with id “group” has control id “id” as it's focused item. If “id” is not present, or is 0, then it will return true if the currently focused control is in the control group with id “group”. Note that if the control group with id “group” does not have focus, then this will still return true if the last focused item in the group had control id “id”."

At the moment I am working around it by just doing a Control(10).HasFocus, and for the "Any control", I just do a whole bunch of ORd conditions.
Reply
#2
I can't do anything unless you first give me exact code for me to reproduce it with.

i.e. tell me where in your skin you see this problem, and where the code is.
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
#3
jmarshall Wrote:I can't do anything unless you first give me exact code for me to reproduce it with.

i.e. tell me where in your skin you see this problem, and where the code is.

Ok, looking at the current Alpha 4 release of Fusion.

In NTSC\MyVideoNav.xml
Line: 250

That is the visible condition for the View Mode menu. Right now it is working by explicitly checking every control. However if i'm understanding the docs right, I should be able to do that by simply checking the control groups, like so:
Code:
<visible allowhiddenfocus="true">ControlGroup(9000).HasFocus(95) | ControlGroup(9001).HasFocus(0)</visible>
But that does not work. It won't become visible. A much simpler test case:
Code:
<visible allowhiddenfocus="true">ControlGroup(9000).HasFocus(95)</visible>
Should at least make it visible when I focus on the "View Mode" control in the top level menu, but it doesn't.

Now i'm not saying its definitely broken -- I could just be screwing something up Smile but if I am i'm not sure what.
Reply
#4
Ah - you have stumbled on a "gotcha" Wink

Use an id other than 9000, 9001, 9002 etc. for your groups. The reason is, any group *without* an id (which you ideally should never use, but I can understand that it's a pain to track from time to time!) gets an id given to them automatically starting with id 9000.

Thus, you have 2 groups (first one in VideoLibraryList2View) with id 9000. The first one is the one being referenced, thus it ain't working.

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
#5
jmarshall Wrote:Ah - you have stumbled on a "gotcha" Wink

Use an id other than 9000, 9001, 9002 etc. for your groups. The reason is, any group *without* an id (which you ideally should never use, but I can understand that it's a pain to track from time to time!) gets an id given to them automatically starting with id 9000.

Thus, you have 2 groups (first one in VideoLibraryList2View) with id 9000. The first one is the one being referenced, thus it ain't working.

Cheers,
Jonathan


Ah gotcha :p

I'll rewrite it. Half the work seems to be figuring out which IDs you can use where and then keeping track of them lol.
Reply
#6
The "assign a group an id by default" thing was primarily there for backward compatibility.

I'm not sure it's required anymore - will speak with Jezz_X about it and see if I can get it removed.
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
#7
Hmm, actually, now that I look at the code, that shouldn't be an issue assuming your skin version is at least 2.1. If you still have the issue after you change the id from 9000 to (say) 8000 let me know and I'll see if I can reproduce.
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
#8
jmarshall Wrote:Hmm, actually, now that I look at the code, that shouldn't be an issue assuming your skin version is at least 2.1. If you still have the issue after you change the id from 9000 to (say) 8000 let me know and I'll see if I can reproduce.

Changing the skin version from 2.0 to 2.1 did it :p
Reply

Logout Mark Read Team Forum Stats Members Help
ControlGroup.HasFocus broken?0