Current control ID (1 Viewer)

Rob Hexenmeister

MP Donator
  • Premium Supporter
  • May 12, 2011
    207
    49
    Slaithwaite
    Home Country
    United Kingdom United Kingdom
    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 :)
     

    catavolt

    Design Group Manager
  • Team MediaPortal
  • August 13, 2007
    14,426
    10,451
    Königstein (Taunus)
    Home Country
    Germany Germany
    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
     

    Rob Hexenmeister

    MP Donator
  • Premium Supporter
  • May 12, 2011
    207
    49
    Slaithwaite
    Home Country
    United Kingdom United Kingdom
    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>
     

    123vak123

    Portal Pro
    December 13, 2010
    207
    161
    Minsk
    Home Country
    Belarus Belarus
    Perhaps, catavolt, meant to do so.
    1. Set an ID for each item you want to control, eg :
    Code:
        <control>
            <description>Refresh Button</description>
            <type>button</type>
            <id>5</id>
            <label></label>
        </control>
    2. Make a hint for each specific item, eg :
    Code:
        <control>
                <description>Refresh label</description>
                <type>label</type>
                <id>0</id>
                <label>ID = 5</label>
                <visible>control.HasFocus(5)</visible>
        </control>
    3. Tips will need to be done for all controlled items.
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,625
    10,554
    Kyiv
    Home Country
    Ukraine Ukraine
    I wanted to add such a property, but a group of designers said that it was not needed, but there are such options:
    We have already the property #highlightedbutton ;)
    #highlightedbutton return Label of button,
    You are correct that #highlightedbutton only returns the label but catavolt is correct when he says you can report the current control id to a setting which is what i do in Ares.
    ...
    If you want the ID of a control, make it like this:
    <onfocus>#(skin.setstring('#focusedcontrol',ID_of_That_Control))</onfocus>
     

    Rob Hexenmeister

    MP Donator
  • Premium Supporter
  • May 12, 2011
    207
    49
    Slaithwaite
    Home Country
    United Kingdom United Kingdom
    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.
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,625
    10,554
    Kyiv
    Home Country
    Ukraine Ukraine
    This is not currently implemented. and this idea is closed. Those will not be implemented.

    --
    WBR, ajs :):whistle::coffee:
     

    Rob Hexenmeister

    MP Donator
  • Premium Supporter
  • May 12, 2011
    207
    49
    Slaithwaite
    Home Country
    United Kingdom United Kingdom
    :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:
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,625
    10,554
    Kyiv
    Home Country
    Ukraine Ukraine
    Try simply add onfocus event to button :)

    --
    WBR, ajs :):whistle::coffee:
     

    Users who are viewing this thread

    Top Bottom