Results 1 to 8 of 8

Thread: Multiple State Buttons?

  1. #1
    Join Date
    Nov 2005
    Location
    Redditch, UK
    Posts
    957

    Default Multiple State Buttons?

    When you add a new state to a button it says "State 1" but doesn't allow you to add any new states. It would be useful to be able to add State 2... State n... etc. I can do it with multiple buttons but would be useful to do it with a single button.

    For instance I have a button that is State 1. visible, State 2. highlighted and State 3. invisible.
    - John H
    * PROMIXIAN TO THE CORE! * (NetRemote2WholeHomePro + Girder5WholeHomePro + USB-UIRT + Touchscreens + WirelessControlSystems + ANNA) == AutomationHeaven
    - "IthinkI'mgoingtobantheuseofthespacebarinfuture..."

  2. #2
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    I'd agree with that - one for the requested features list. Although I'm not sure what should happen if you have two states that satisfy the same conditions, presumably the first one that matches should apply.
    --Rob

  3. #3
    Join Date
    Nov 2005
    Location
    Redditch, UK
    Posts
    957

    Default

    Quote Originally Posted by Rob H View Post
    I'd agree with that - one for the requested features list. Although I'm not sure what should happen if you have two states that satisfy the same conditions, presumably the first one that matches should apply.
    You could use...

    if State 1 then ...
    if State 2 then ...
    if State 3 then ...
    if State 4 then ...
    if State n then ...
    else Default

    That way no 2 states would match. I have one button that is actually using 4 states atm and I got around it with using blanking buttons.

    1. Queue
    2. UnQueue
    3. Highlights UnQueue (for when playlist is on that item)
    4. No Action (Invisible)

    It took only two buttons but with a multi-state one I could have done...

    Case Action
    == "Queue"
    == "UnQueue" and CurrentSong
    == "UnQueue"
    == "NoAction"

    As you say, something for future. It's not a priority but would make life a lot easier.

    One thing I just thought about... Can you check what state the button is in currently? If not, add it to the feature request as it would be useful to know what has been pressed.
    - John H
    * PROMIXIAN TO THE CORE! * (NetRemote2WholeHomePro + Girder5WholeHomePro + USB-UIRT + Touchscreens + WirelessControlSystems + ANNA) == AutomationHeaven
    - "IthinkI'mgoingtobantheuseofthespacebarinfuture..."

  4. #4
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    Yes, you can discover the state of a button - see the help for Lua library reference\NetRemote library. If I remember correctly it's the GetState() method of an element.
    --Rob

  5. #5
    Join Date
    Nov 2005
    Location
    Redditch, UK
    Posts
    957

    Default

    Oh yeah and allowing different fonts and sizes for each state... god knows I'm in "what I'd love" mode...

    I make the font into a monospaced version and slightly larger when it's highlighted... Unfortunately trying to get it just right means you have to use two frames with two different setups to get it right and in NRD it looks jumbled even though it's perfect at runtime...



    Not the cleanest of layouts...
    - John H
    * PROMIXIAN TO THE CORE! * (NetRemote2WholeHomePro + Girder5WholeHomePro + USB-UIRT + Touchscreens + WirelessControlSystems + ANNA) == AutomationHeaven
    - "IthinkI'mgoingtobantheuseofthespacebarinfuture..."

  6. #6
    Join Date
    Nov 2005
    Location
    Redditch, UK
    Posts
    957

    Default

    Quote Originally Posted by Rob H View Post
    Yes, you can discover the state of a button - see the help for Lua library reference\NetRemote library. If I remember correctly it's the GetState() method of an element.
    Typical... I was looking for StateGet.

    I cheated. I added a Lua script when the button is pressed before the LMAuto.. basically I set a public variable and OnPressed checks it before deciding what to do.
    - John H
    * PROMIXIAN TO THE CORE! * (NetRemote2WholeHomePro + Girder5WholeHomePro + USB-UIRT + Touchscreens + WirelessControlSystems + ANNA) == AutomationHeaven
    - "IthinkI'mgoingtobantheuseofthespacebarinfuture..."

  7. #7
    Join Date
    Apr 2006
    Location
    Munich
    Posts
    73

    Default Don't forget making the documentation consistent.

    A few months ago, I was annoyed by this, without getting my self together to complain to the forum. As far as I recall, the documentation gives the impression that the number of states is not limited to two.

    So, please either allow more states (preferred), or have the documentation state the limitation.

  8. #8
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    I think Ben's intention was to allow more than two states, but it never happened for various reasons.
    --Rob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •