Mutually Exclusive Multi-State Buttons

Hi…

I am trying to create mutually exclusive multi-state buttons, but there seems to be an issue I can’t get past. Not sure if it’s a bug or ‘by-design’. What I have done to test is:

:diamonds: Created two 2-State Toggle Buttons named StateToggle1 and StateToggle2
:diamonds: Created a Memory Tag called ToggleTag
:diamonds: Bind this one tag to both buttons
:diamonds: In Style Customizer:
• set Driving Property to Control Value
• choose Bkgrd Color and Border as the only Used Properties
• set these properties to anything
- (my setting) State 0 is No Border and No Bkgrd
- (my setting) State 1 is 4pt Blk Border and 50% Alpha Wht
• on StateToggle1 - set Value on State 1 to 0, and State 2 to 51
• on StateToggle2 - set Value on State 1 to 0, and State 2 to 52
:diamonds: In Property Editor: (settings changed from default listed)
• Opaque = False
• Rollover = False
• State 2 Value
- on StateToggle1 set to 51
- on StateToggle2 set to 52
• Background 3D? = False
• Text =

Expected behavior:
1. When StateToggle1 is pressed, State 2 Value (51) is passed to bound Control Value (ToggleTag).
2. Control Value (51) == StateToggle1 Style Customizer Value for State 1 (51)
3. Control Value (51) != StateToggle2 Style Customizer Value for State 1 (52)
4. StateToggle1 visual style from Style Customizer State 1 (4pt Blk Border) is displayed.
5. StateToggle2 visual style from Style Customizer State 1 (4pt Blk Border) is not displayed.
6. When StateToggle2 is pressed, State 2 Value (52) is passed to bound Control Value (ToggleTag).
7. Control Value (52) == StateToggle2 Style Customizer Value for State 1 (52)
8. Control Value (52) != StateToggle1 Style Customizer Value for State 1 (51)
9. StateToggle2 visual style from Style Customizer State 1 (4pt Blk Border) is displayed.
10. StateToggle1 visual style from Style Customizer State 1 (4pt Blk Border) is not displayed.

Actual Behavior:
1. When StateToggle1 is pressed, State 2 Value (51) is passed to bound Control Value (ToggleTag).
2. Control Value (51) == StateToggle1 Style Customizer Value for State 1 (51)
3. Control Value (51) != StateToggle2 Style Customizer Value for State 1 (52)
4. StateToggle1 visual style from Style Customizer State 1 (4pt Blk Border) is displayed.
5. StateToggle2 visual style from Style Customizer State 1 (4pt Blk Border) is not displayed.
6. When StateToggle2 is pressed, State 2 Value (52) is passed to bound Control Value (ToggleTag).
7. Control Value (52) == StateToggle2 Style Customizer Value for State 1 (52)
8. Control Value (52) != StateToggle1 Style Customizer Value for State 1 (51)
9. StateToggle2 visual style from Style Customizer State 1 (4pt Blk Border) is displayed.
10. StateToggle1 visual style from Style Customizer State 1 (4pt Blk Border) is displayed.

Notice the difference in expected and actual on items 9 and 10. It looks like instead of the Control Value firing on equal to is is firing on equal to or greater than. The components act correctly when Toggle1 is pressed because 51 is not greater that 52, but when Toggle2 is pressed they both display 4pt border because 52 is greater than 51? I would expect that equal to would be the behavior on this method.

Although, this is writing the correct value from either toggle to a single tag (what I wanted) the display behavior is a bit confusing.

Bug, or ‘feature’?

Cheers… and kind regards for any helpful information,
Steve

I’d say you’re running afoul of the underlying program of a toggle.

While some may say to use a Multistate button, which covers all the functionality you would need except for the transparent background, I think you would be better off using standard buttons. With the style customizer, you can make as many states as you wish on a single button.

This should be closer to what you are wanting. Extra goodies to look at are:
Custom properties
Component scripts
Style Customizer
Binding on “state” value.

I bound everything to work within the three components to make it portable.

test_2button radio_2017-05-18_1349.proj (7.7 KB)

Thanks Jordan… I will try the proj later to see if it fits my needs.

I am still confused as to why the example I used does not display as expected. If the State Value matches the Control Value, then that should be the only criteria required for displaying State 2 styles… not if it matches or is greater than. Odd.

Cheers,
Steve

Hi Jordan…

I was able to test your solution, but unfortunately the set-up for the 145 mutually exclusive buttons I require would be quite tedious. I did find another solution using one-shot buttons that I can live with, but they exhibit the same “greater than or equal to” bug when setting styles via a value. I am calling it a bug because the behavior is not consistent with a matched style value.

Thank you for taking the time to assist.

Kind Regards,
Steve

Just so I can clarify, is there a reason the Multistate button won’t work for you?

A more helpful response could be check if there is bug

Hey Jordan… Sorry for the delayed response. Vacation and then crammed work schedule.

The multi-state button was my original control of choice, however, after considerable testing the behavior explained in my post is the same for toggle, multi-state, and one-shot buttons. I accept the behavior exhibited may not be a bug, but it sure is not the kind of behavior that is logical… at least from my perspective.

As you were…
Steve