General
Switch off radio buttons?
Started by iPad_User on .
Sign in or create an account to join the conversation.
Hey folks,
okay... this should be an easy thing... but I'm sitting in front of my computer like an idiot.
I have some switches in my layout which are in "radio-mode".
I added an expression:
What I now want to achieve is, that the container hides completely if I press the radio-button again (and if the radio-buttons turns off would also be nice).
Anybody?
Thanks!
Chris
okay... this should be an easy thing... but I'm sitting in front of my computer like an idiot.
I have some switches in my layout which are in "radio-mode".
I added an expression:
selTab=show(Container, firstoff(x))
By pushing one of those buttons the container next to it changes his tab. What I now want to achieve is, that the container hides completely if I press the radio-button again (and if the radio-buttons turns off would also be nice).
Anybody?
Thanks!
Chris
it seems not so simple to me. Pressing the lit radio button again normally results in nothing. Maybe it is better to have a different button to make the container vanish?
If the primary idea with the radio buttons is important, there should be some methods possible. For example, when a button is lit, an invisible Canvas object is moved there, and if you hit that Canvas object, it sets the button array to 0 and vanishes back outside the interface. And hides the container.
If the primary idea with the radio buttons is important, there should be some methods possible. For example, when a button is lit, an invisible Canvas object is moved there, and if you hit that Canvas object, it sets the button array to 0 and vanishes back outside the interface. And hides the container.
Hey!
Thanks for your answer.
It's not necessary, that the lit radio-button is pressed again. I'm cool with a separate "reset"-button.
Do you have any ideas regarding the code?
Thanks,
Chris
Thanks for your answer.
It's not necessary, that the lit radio-button is pressed again. I'm cool with a separate "reset"-button.
Do you have any ideas regarding the code?
Thanks,
Chris
I would try with Switches.x=0. If that doesn't work try Switches.x=fill(0,0,n). n is the number of switches.
Thanks! I already tried that. It disables all buttons. But the container is still visible and doesn't disappear...Phil999 wrote:I would try with Switches.x=0. If that doesn't work try Switches.x=fill(0,0,n). n is the number of switches.
If you don't mind having an extra button it's as easy as adding a second expression to the switches.
Let's say you've got 3 tabs and 4 switches. You just add this expression to the switches for tab changing:
Let's say you've got 3 tabs and 4 switches. You just add this expression to the switches for tab changing:
selTab=selecttab(Container,firstof(x)-1)
And this expression for hiding it with the first button:
showContainer=show(Container,firstof(x))
The container is only shown when the first button is pressed, because then show will have a value of less then 1 which means it's invisible. And the other three buttons show the tabs.Yeyyyyy....
great! That's working!
In my case it would be nicer to have the last one enabling / disabling the container...
Hmmmm.....
great! That's working!
In my case it would be nicer to have the last one enabling / disabling the container...
Hmmmm.....
just change the expressions to:
It now subtracts the firstof of the number of switches and only comes to zero when the firstof equals the number
selTab=selecttab(Container,firstof(x))
and:showContainer=show(Container,3-firstof(x))
with 3 being the number of the last switch, so if you have 5 switches the 3 would become 4. It now subtracts the firstof of the number of switches and only comes to zero when the firstof equals the number
Awesome! Perfect 
Thanks !!
Thanks !!
There is a way to pull this off, using Pads as pseudo-switches - no need for the extra button this way. 
Container&pseudoSwitches.jzml
Container&pseudoSwitches.jzml