Kodi Community Forum
Is there a way to reset a list's position? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Is there a way to reset a list's position? (/showthread.php?tid=92239)

Pages: 1 2


Is there a way to reset a list's position? - Hitcher - 2011-01-27

As in you enter Movies and stop on a certain one, back out, then re-enter and it's still focused on the same movie.
What I want to do it reset that position back to the beginning so when I scroll through the various options (as seen in the video below) they always start at the first entry.

http://www.youtube.com/watch?v=DB47-XkOxao

I've tried using <onfocus>Control.SetFocus(51,0)</onfocus> but that does nothing.

Thanks.


- igotdvds - 2011-01-27

Great question, but sorry I cant help. Also, if you get an answer I will likely implement this very thing.


- Hitcher - 2011-01-27

Do I remember you wanting do the same thing recently?


- igotdvds - 2011-01-27

Hitcher Wrote:Do I remember you wanting do the same thing recently?

Dont think so, but it is something I've wanted to do.


- eumel - 2011-01-27

You can change the focused position with:
Code:
<control type="button" id="111">
                <description>Fake Button to set correct focus</description>
                <posx>-150</posx>
                <posy>-150</posy>
                <width>0</width>
                <height>0</height>
                [b]<onfocus>Control.Move(51,-1)</onfocus>
                <onfocus>SetFocus(51)</onfocus>[/b]
                <visible>stringcompare(Container.Viewmode,InfoList)</visible>
</control>

but you have to know which item is focused (number) .


- ronie - 2011-01-27

igotdvds Wrote:Great question

ditto!
been struggling with the same last week and couldn't find a way to make it work either.

Control.SetFocus() seemed to behave a bit buggy at my end.
if you exit a list somewhere at the top, let's say at position 2, it will be reset on re-enter,
but when exiting a list somewhere near the bottom, you'll return at more or less the same position as where you left.


- jmarshall - 2011-01-27

Hmm, didn't Basic Vision or somesuch do something like this? Maybe that was using grouplists instead. Jezz_X may know a trick or two - not sure.

I'm not sure from the video why it's an issue exactly? Are you jumping to separate screens there when clicking on Movies?

Cheers,
Jonathan


- Jezz_X - 2011-01-27

lol Don't look at me my guess is the internal go to last active code is getting fired off after the setfocus code on window open


- Hitcher - 2011-01-27

jmarshall Wrote:Hmm, didn't Basic Vision or somesuch do something like this? Maybe that was using grouplists instead. Jezz_X may know a trick or two - not sure.

I'm not sure from the video why it's an issue exactly? Are you jumping to separate screens there when clicking on Movies?

Cheers,
Jonathan

Yes, what I have is Movie titles when you first enter the Movies section from Home. Then when you press Up to select 'Recently Added Movies' that part of the library is automatically activated (I've found a way to activate it without having to press a button) but because it's using the same list control (and the same id) it starts at the position you were in for Movie Titles.

The weird thing is if I change the fixedlist to a normal list <onfocus>Control.SetFocus(51,0)</onfocus> works.


- jmarshall - 2011-01-27

Right, so I presume that entering the library from home using Confluence et. al. shows the same problem?

If not, what is different?


- Hitcher - 2011-01-27

jmarshall Wrote:Right, so I presume that entering the library from home using Confluence et. al. shows the same problem?

Yes it does, but as I'm trying to emulate the behaviour on the Xbox 360 I'd really like to be able to reset this position memory if it's possible.


- Jezz_X - 2011-01-28

I'm probably wrong here but a fixed list probably doesn't allow setfocus anyway because its setfocus to a position number not a item number right ? and a fixed list always only has 1 position number focusable you can't setfocus to the 345 item in a list if only 10 items show on the screen at once because you can only set focus to item 0 to 9 in the positions

Right jmarshall ?
its visible list positions not item count positions


- Jezz_X - 2011-01-28

btw hitcher a good hack workaround is to have an extra hidden list with the same id Smile remember if you have 2 lists of the same id with different visible conditions in the one window it always reset to the top instead of remembering lol (I think the hidden one needs to above the non hidden in the xml)


- pecinko - 2011-01-28

Hitcher Wrote:Yes it does, but as I'm trying to emulate the behaviour on the Xbox 360 I'd really like to be able to reset this position memory if it's possible.

It seams to me at this behavior isn't limited to fixedlist only. I have:

PHP Code:
<onfocus>Control.SetFocus(301,0)</onfocus

with panel container and it behaves the same way.

@Jezz_X As for you can't set focus on fixedlist. It seams logical enough, nevertheless if I have:

PHP Code:
<focusposition>3</focusposition


it isn't respected if that fixedlist have history. Seams "XBMC always remembers last window, position etc.." thing to, as you mentioned is earlier post.

Practically, XBMC forces logic other than what's being demanded by skin code.


- Jezz_X - 2011-01-28

<focusposition>3</focusposition>
just means that the 4 item (0,1,2,3) is the one that the list is fixed on so 3 other items can be visible past it it has nothing to do with what content of position 3 is

Maybe I'm misunderstanding the whole thing