control id question (1 Viewer)

A

Anonymous

Guest
What is the purpose of the control ids?
When I add a new control can I pick an arbitraty number for the id? Does it have to be unique in that one window, or across the whole application?

I'm diving into making a touchscreen friendly version of the MCE skin, so i think you can expect a whole bunch of questions from me. I'll be a guru soon enough though. :)
 

Frodo

Retired Team Member
  • Premium Supporter
  • April 22, 2004
    1,518
    121
    52
    The Netherlands
    Home Country
    Netherlands Netherlands
    control id's are used by mediaportal to make a connection
    between the layout (defined in the xml files) and the
    functionality (defined in the sourcecode)

    Say you have a play button with id = 4
    then in the source code i know that if a button with id=4 is pressed
    that we should start playing the file

    When I add a new control can I pick an arbitraty number for the id?
    Yes you can since a 'new control' has no functionality yet in the sourcecode.
    However make sure you dont use an id which already is used in the xml file

    Does it have to be unique in that one window
    In general yes. The idea is that id's are unique in one window
    However not all controls have functionality behind it
    (think of the background image) so you'll see that those ids
    can be used more then once

    Frodo
     
    A

    Anonymous

    Guest
    and for the controls for actions such as play and stop etc... Does the id for the control matter? Isn't it the action that is used to decide to play or stop etc..?
     

    MrMario64

    Retired Team Member
  • Premium Supporter
  • April 22, 2004
    822
    1
    50
    Home Country
    Netherlands Netherlands
    yes it matters.
    Each button needs it's own ID to make it possible to make the Onleft, Onright Onup and Ondown items.
    YO\ou tell MP to wich button or controll you wanna go to when going up,down.left or right.
    This needs each button to be unique
     

    Users who are viewing this thread

    Top Bottom