Control.SetFocus(id,position) is not working for panel?
#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.
Reply
#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>
Reply
#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
Reply
#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.
Reply
#5
Try just setfocus. (without control. )
My skins:

Amber
Quartz

Reply
#6
@pecinko it did not work !!
Reply
#7
I know my method works with no problems because I tested it.
Reply
#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

Reply
#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.
Reply
#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.
Reply
#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.
Reply
#12
Best to forget about it and let the user decide if they want to hide the parent folder item altogether.
Reply
#13
Sad Sad
Reply
#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
Reply
#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.
Reply

Logout Mark Read Team Forum Stats Members Help
Control.SetFocus(id,position) is not working for panel? 1