Problem: Updating a skin setting with #(skin.setstring()) when list control has focus (2 Viewers)

Rob Hexenmeister

MP Donator
  • Premium Supporter
  • May 12, 2011
    207
    49
    Slaithwaite
    Home Country
    United Kingdom United Kingdom
    Good evening,

    I have a basic understanding of using skin.setstring and am able to set a skin property when a control gets focus. My problem is updating the setting when moving between items within a listcontrol. The code I have below only works when the listcontrol first gets focus, not when I move to a different list item within the control.

    Can anyone suggest a different event (other than onfocus) or suggest a work-around for me? This is the problem code:

    <control>
    <description>group element</description>
    <type>group</type>

    <control>
    <description>composite control</description>
    <type>facadeview</type>
    <id>50</id>

    <control>
    <description>listcontrol</description>
    <type>listcontrol</type>
    <onfocus>#(skin.setstring('keep.thumb',#selectedthumb))</onfocus>
    .
    .
    .
    <control>
    .
    .
    etc

    I am trying to pass the file location of the previously selected thumb when moving to a new window.

    Many thanks
    RH
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,875
    1,804
    Southampton
    Home Country
    United Kingdom United Kingdom
    I ... am able to set a skin property when a control gets focus. My problem is updating the setting when moving between items within a listcontrol.
    I think that the problem here is that a listcontrol is regarded as a single entity by the skin engine, even though it may contain multiple lines in a textual list, or multiple thumbnails in a thumbnail view. So onfocus is executed only when the listcontrol receives the focus, and not when the user moves between items in the list.

    The variable #selectedthumb contains the identity of the current thumbnail, but can the value be inherited by the window that is displayed next? Does that variable still have a value when the next window is displayed, or is the variable reset to the null string? I don't know. You would need to experiment.

    @catavolt is the acknowledged world expert on MP skins. He may have an idea of how you can achieve what you want.

    -- from CyberSimian in the UK
     

    Rob Hexenmeister

    MP Donator
  • Premium Supporter
  • May 12, 2011
    207
    49
    Slaithwaite
    Home Country
    United Kingdom United Kingdom
    So onfocus is executed only when the listcontrol receives the focus, and not when the user moves between items in the list.
    Sums up the problem I am having. Sorry if I wasn't clear.

    No, #selectedthumb is not preserved on going to the next window. That's exactly what I am trying to solve. An example is moving from mytvrecordedtv.xml to mytvRecordedInfo. The variable changes from a screen grab thumbnail from the video file to a channel logo during transition between windows.

    It's a shame there isn't an OnClose event for the window, because then I could save the variables I wanted on exiting the window. Maybe an idea for a future release to put this at the start of the window with the defines?

    Any help from anyone that can assist in the meantime would be gratefully received,
    Thanks

    RH
     

    Users who are viewing this thread

    Top Bottom