Control.SetFocus(id,position) is not working for panel?

  Thread Rating:
  • 1 Votes - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
slinuxgeek Offline
Senior Member
Posts: 219
Joined: Feb 2012
Reputation: 0
Post: #1
In MyMusicNav.xml I have writen:
<onload condition="isVisible(51)">Control.SetFocus(51,2)</onload>

That means I want that when the songs are visible in list panel container , highlight 2nd item of list.
2nd item is 1st song in the view because 1st item is ".." .

I want instead of ".." the item next to ".." should be highlighted when ever the window opens.

Control.SetFocus(51,2) is not working.

51 is id of panel container.

how can I do that?

Thanks of help.
find quote
Hitcher Offline
Skilled Skinner
Posts: 10,263
Joined: Aug 2007
Reputation: 80
Location: Eastleigh, UK
Post: #2
Use this instead so it only moves when focused on the Parent Folder item -

Code:
<onload condition="StringCompare(ListItem.Label,..) + Control.IsVisible(51)">Control.Move(51,1)</onload>
find quote
Jezz_X Offline
Team-XBMC Skinner
Posts: 5,284
Joined: Jun 2006
Reputation: 57
Location: Earth
Post: #3
You do know that this is going to screw with people who actually go and turn off the show parent items thing right ? not to mention when you go to full screen playback and back again you will lose the current focus
find quote
slinuxgeek Offline
Senior Member
Posts: 219
Joined: Feb 2012
Reputation: 0
Post: #4
Then how can we do it Jezz_x?

I don't understand why this function is not working ?
Control.SetFocus(51,2)
is it for any other purpose?


Thanks for Help.
find quote
pecinko Offline
Donor
Posts: 3,670
Joined: Dec 2008
Reputation: 48
Location: Prague / Belgrade
Post: #5
Try just setfocus. (without control. )

My skins:

Amber
Quartz

find quote
slinuxgeek Offline
Senior Member
Posts: 219
Joined: Feb 2012
Reputation: 0
Post: #6
@pecinko it did not work !!
find quote
Hitcher Offline
Skilled Skinner
Posts: 10,263
Joined: Aug 2007
Reputation: 80
Location: Eastleigh, UK
Post: #7
I know my method works with no problems because I tested it.
(This post was last modified: 2012-04-16 17:16 by Hitcher.)
find quote
butchabay Offline
Skilled Skinner
Posts: 3,670
Joined: Mar 2010
Reputation: 71
Location: Planet Crematoria
Post: #8
(2012-04-16 11:42)slinuxgeek Wrote:  In MyMusicNav.xml I have writen:
<onload condition="isVisible(51)">Control.SetFocus(51,2)</onload>

That means I want that when the songs are visible in list panel container , highlight 2nd item of list.
2nd item is 1st song in the view because 1st item is ".." .

I want instead of ".." the item next to ".." should be highlighted when ever the window opens.

Control.SetFocus(51,2) is not working.

51 is id of panel container.

how can I do that?

Thanks of help.

You wrote:

<onload condition="isVisible(51)">Control.SetFocus(51,2)</onload>

Forgot something ? Just to be sure ... maybe ?

PHP Code:
<onload condition="Control.IsVisible(51)">Control.SetFocus(51,2)</onload
find quote
slinuxgeek Offline
Senior Member
Posts: 219
Joined: Feb 2012
Reputation: 0
Post: #9
Hi every one Thanks for reply , but none of the above code worked for me Sad .
Code of MyMusicNav.xml:
PHP Code:
<window id="502">
<
onload>Skin.SetString(choice1,"Music")</onload> <!-- for other purpose-->

<!-- 
I wrote only one out of three which is below at a time but no help-->
<!--
This did not work-->
<
onload condition="StringCompare(ListItem.Label,..) + Control.IsVisible(51)">Control.Move(51,1)</onload>

<!--
This also did not work-->
<
onload condition="Control.IsVisible(51)">Control.SetFocus(51,2)</onload

<!-- 
Not even this-->
<
onload>Control.Move(51,2)</onload>

    <
defaultcontrol always="true">19</defaultcontrol> <!-- I tried to comment it also but no help -->
    <
allowoverlay>no</allowoverlay>
    <
views>51,53</views>
    <
controls>
        <
control type="group">
            <!-- 
panel control to display songs-->
            <include>
ViewVisibleEffect</include>
            <include>
CommonExtra_Info</include>
            <include>
CommonRootView_Info</include> <!-- view id 51 -->
            <include>
ThumbnailView</include> <!-- view id 53 -->
            <include>
ScrollOffsetLabel</include>
        </
control>
        <include>
TopControlsPanel</include>
        <include>
BottomControlsPanel</include>
    </
controls>
</
window

Thanks.
(This post was last modified: 2012-04-17 07:39 by slinuxgeek.)
find quote
Hitcher Offline
Skilled Skinner
Posts: 10,263
Joined: Aug 2007
Reputation: 80
Location: Eastleigh, UK
Post: #10
It'll only work if CommonRootView_Info is the first view you see when opening Music, if drill down deeper into the folders (ie Albums, Songs) it wont because MyMusicNav is already open.
find quote
slinuxgeek Offline
Senior Member
Posts: 219
Joined: Feb 2012
Reputation: 0
Post: #11
I agree but it is not working even first time when CommonRootView_Info is the first view.

Also when drill down deeper into the folders (ie Albums, Songs) I want it to work in the same way ,
this will not work here because of <onload> because window is already loaded but then there should be some other way.

Thank You.
find quote
Hitcher Offline
Skilled Skinner
Posts: 10,263
Joined: Aug 2007
Reputation: 80
Location: Eastleigh, UK
Post: #12
Best to forget about it and let the user decide if they want to hide the parent folder item altogether.
find quote
slinuxgeek Offline
Senior Member
Posts: 219
Joined: Feb 2012
Reputation: 0
Post: #13
Sad Sad
find quote
`Black Offline
Team-XBMC Member
Posts: 2,358
Joined: Apr 2009
Reputation: 62
Location: Germany
Post: #14
Why do you want to force users to have ".." hidden? You shouldn't do that, everyone can disable it in the settings if he doesn't need it. Just add this to your skin description that you have your own buttons for going back and users should hide parent folder items if they want the best skin experience.

[Image: xp1080-21.png]
find quote
slinuxgeek Offline
Senior Member
Posts: 219
Joined: Feb 2012
Reputation: 0
Post: #15
OK `Black .

Oh wait this thread was not about hiding the ".." item but , it was about how to highlight the first actual item when user enters the window.
instead of highlighting ".." the item next to ".." should be focused / highlighted .
If ".." is not there (hidden by user) no problem , the first actual item should be focused always.

Please help , I need it.
(This post was last modified: 2012-04-18 06:47 by slinuxgeek.)
find quote
Post Reply