Radio Button Behavior

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
incoronado
Senior Member
Posts: 153
Joined: Fri Mar 19, 2004 12:30 am
Location: San Diego, CA

Radio Button Behavior

Post by incoronado »

I know this is a very basic question, but I'm having a tough time figuring out a clean way to accomplish this. I have a property that has 10 different values. I want to set up 10 buttons that show the status of either selected or unselected. When I push one button I want all of these other buttons to show they are no longer selected. Like a radio button. This is what I have done. I created 10 multi-state buttons. I created 10 properties (AV Input Tuner State, AV Input DVD Selected State, etc. ) which can each take on a value of "On" or "Off". I created and additional "AV Input Selected" property with 10 values (Tuner, CD, DVD, etc.) I created a task that triggers on the "On" state of the AV Input State Properties and sets the "AV input selected property."



To further complicate matters I have a serial device that can externally affect the "AV input selected property."



I have this working, but is very slow to respond, and I think it is because I'm having some recursive events going on.



Does this make any sense?



Am I just making this way too complicated? I'm thinking there must be a better way.....



Does anyone have any ideas of how to simplify this?
PT
Senior Member
Posts: 147
Joined: Wed Apr 13, 2005 12:32 pm
Location: Hampshire.UK

Post by PT »

incoronado



I have a page which has internet radio station icons on and then indicator buttons under each.The property of the indicatoris mapped to a value for the staion so if say staion 1 is sleected then the green indicator pops underneath it, the others are not shown. Change stations and the green indicator follows the selction.The field selection can be just a text box .



Is this what you are after?
Regards

PT

If it isn't broke,fix it till it is!
incoronado
Senior Member
Posts: 153
Joined: Fri Mar 19, 2004 12:30 am
Location: San Diego, CA

Post by incoronado »

I think I'm following you. I have the indicator button working properly as you described. I created a transparent button and tried laying it over the top of my indicator button. It shows the indicator but the button doesn't work. Probably because it is directly over the indicator, and there is no ability to lay one object over another and indicate the z-order of the button. My indicator graphic is pretty much the the same size as my button.
PT
Senior Member
Posts: 147
Joined: Wed Apr 13, 2005 12:32 pm
Location: Hampshire.UK

Post by PT »

Hi

Yes I see what you mean . Ok I have mine at the side or bottom which is only a green dot/rectangle

What about a halo?
Regards

PT

If it isn't broke,fix it till it is!
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

You cannot put indicators and or buttons over eachother. You can place buttons over images though. That will work fine.

I have created some buttons where there is a transparant rectangle in the right side of the button. Exactly in that transparant rectangle an indicator is placed. When the indicator is lit up, it shows green and when the indicator does not light up, it shows the same color as the background of my button. This way I can set up source selection on my Receiver and the indicator follows the source. My indicators trigger on a NULL device which holds the status of the selected source.

So if the source switches on the receiver, a script triggers and sets the status in the NULL device status property. Called something like: Receiver.Input Source Because it is a NULL device, no labels have to be defined and it can hold just about any text you put into it. So if DVD is selected, DVD is set into the property etc etc. Now my indictor buttons all look to the same null device input source property. All indicators have two states. For example the DVD indicator shows image 1 (green) when property state = DVD and shows image 2 (background) when property state != (= not) DVD. You can imagine if you do this for all your sources, only one state will be true all the time and that indicator will light up when all others take the background color.

Works like a charm.

So, do not create multistate buttons, but standard property change buttons and have multistate indicators do the rest. And be sure to use a NULL device in stead of properties that hold labels. You will very easily get errors like: No indicator found for this state!



Hope this helps a bit.
PT
Senior Member
Posts: 147
Joined: Wed Apr 13, 2005 12:32 pm
Location: Hampshire.UK

Post by PT »

I had a similar set up for the Halo button as Richards.

So you have a few options via direct indicators or script. Either method will allow you to track via button press or your externally selected Av device.
Regards

PT

If it isn't broke,fix it till it is!
incoronado
Senior Member
Posts: 153
Joined: Fri Mar 19, 2004 12:30 am
Location: San Diego, CA

Post by incoronado »

I just thought it looks better to dynamically change the entire button in certain situations (like toggling through multiple selections). You can use the multi-state button to do this, because I'm currently using this implementation, but it only works in specific situations and lends itself to recursive calls if you're not really careful.
yaccri
HouseBot Special Member
Posts: 304
Joined: Wed May 07, 2003 2:19 pm
Location: Tel-Aviv, Israel
Contact:

Post by yaccri »

Circe640 posted a tutorial on transport controls:

http://www.meedio.com/forum/about15173.html



Is this what you are looking for?
Post Reply