Current control ID

Discussion in 'General Support' started by Rob Hexenmeister, March 12, 2019.

  1. Rob Hexenmeister
    • Premium Supporter

    Rob Hexenmeister MP Donator

    Joined:
    May 12, 2011
    Messages:
    102
    Likes Received:
    14
    Gender:
    Male
    Location:
    Slaithwaite
    Ratings:
    +23 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    I would like to put a label control in my xml to tell me which control currently has focus (for debugging purposes/movement around the screen), but I can't find a skin variable. Is there something like #skin.control.focusedID by any other name?

    Thank you :)


     
    • Like Like x 1
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. catavolt
    • Team MediaPortal
    • Administrator

    catavolt Design Group Manager

    Joined:
    August 13, 2007
    Messages:
    12,240
    Likes Received:
    4,982
    Gender:
    Male
    Occupation:
    Technical Documentation, Translation
    Location:
    Lanzarote
    Ratings:
    +7,396 / 38
    Home Country:
    Germany Germany
    Show System Specs
    Easy. Give it an ID like 12345, then ask for visibility with <visible>control.isvisible(12345)</visible>.
    Asking for focus in case of any button: control.hasfocus(12345).

    via tapatalk
     
  4. Rob Hexenmeister
    • Premium Supporter

    Rob Hexenmeister MP Donator

    Joined:
    May 12, 2011
    Messages:
    102
    Likes Received:
    14
    Gender:
    Male
    Location:
    Slaithwaite
    Ratings:
    +23 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Thank you catavolt :) I think you may have misunderstood. I am trying to report the ID number of whichever control is active and display it in a label.

    Something along the lines of:

    <control>
    <id>1</id>
    <description>whatisactive</description>
    <type>label</type>
    <Xpos>50</Xpos>
    <Ypos>50</Ypos>
    <font>font9</font>
    <value>.....whatever control ID is active elsewhere on the screen....</value>

    etc

    </control>
     
  5. 123vak123

    123vak123 Portal Pro

    Joined:
    December 13, 2010
    Messages:
    176
    Likes Received:
    70
    Gender:
    Male
    Location:
    Minsk
    Ratings:
    +136 / 2
    Home Country:
    Belarus Belarus
    Show System Specs
    Perhaps, catavolt, meant to do so.
    1. Set an ID for each item you want to control, eg :
    Code (Text):
    1.     <control>
    2.         <description>Refresh Button</description>
    3.         <type>button</type>
    4.         <id>5</id>
    5.         <label></label>
    6.     </control>
    2. Make a hint for each specific item, eg :
    Code (Text):
    1.     <control>
    2.             <description>Refresh label</description>
    3.             <type>label</type>
    4.             <id>0</id>
    5.             <label>ID = 5</label>
    6.             <visible>control.HasFocus(5)</visible>
    7.     </control>
    3. Tips will need to be done for all controlled items.
     
    • Like Like x 2
  6. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,698
    Likes Received:
    2,688
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,650 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    I wanted to add such a property, but a group of designers said that it was not needed, but there are such options:
    ...
     
    • Like Like x 2
  7. Rob Hexenmeister
    • Premium Supporter

    Rob Hexenmeister MP Donator

    Joined:
    May 12, 2011
    Messages:
    102
    Likes Received:
    14
    Gender:
    Male
    Location:
    Slaithwaite
    Ratings:
    +23 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    That's really clever AJS, so if I am right, what you are doing here is telling each control to set a skin setting called #focusedcontrol to the control ID when it gets focus. My label in the top left hand corner can report the current value of #focusedcontrol.

    I need to put #focusedcontrol somewhere in the defines don't I.

    R.
     
  8. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,698
    Likes Received:
    2,688
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,650 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    This is not currently implemented. and this idea is closed. Those will not be implemented.

    --
    WBR, ajs :):whistle::coffee:
     
  9. Rob Hexenmeister
    • Premium Supporter

    Rob Hexenmeister MP Donator

    Joined:
    May 12, 2011
    Messages:
    102
    Likes Received:
    14
    Gender:
    Male
    Location:
    Slaithwaite
    Ratings:
    +23 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    :cry:

    Catavolt's solution seems to be a good idea though using onfocus and a skin setting. If only I knew where to put the define for #focusedcontrol, in skin settings or in the xml I am editing. :(:confused:
     
  10. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,698
    Likes Received:
    2,688
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,650 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    Try simply add onfocus event to button :)

    --
    WBR, ajs :):whistle::coffee:
     
    • Like Like x 1
  11. Rob Hexenmeister
    • Premium Supporter

    Rob Hexenmeister MP Donator

    Joined:
    May 12, 2011
    Messages:
    102
    Likes Received:
    14
    Gender:
    Male
    Location:
    Slaithwaite
    Ratings:
    +23 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Will do, I understand that. I don't understand if I need to define #focusedcontrol in a skin settings xml as well
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!