hilitedButtonName propertie (radio btt)[SOLVED]

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

hilitedButtonName propertie (radio btt)[SOLVED]

Post by atout66 » Tue Apr 22, 2014 9:08 am

Hi to all,

I've followed the lesson "Using Radio Buttons" (which doesn't work for me :oops: ) at this URL:
http://lessons.runrev.com/s/lessons/m/4 ... io-buttons.
I've followed the topic well named "Radio buttons" here: http://forums.runrev.com/viewtopic.php?f=7&t=20081 and done some other search without success...

So here is my problem.
I've 3 buttons, named whatever, let say: aa,bb,cc, right ? I select all of them and make a group of this 3 buttons.
In the properties of that new group, I'm aware that the <Hilite one radio button at a time> propertie is checked.
In each button I code the mouseUp handler to this:

Code: Select all

 --     Setting the hilitedButtonName of a group sets the hilite property of the rest of the buttons to false FROM the dictionnary
     set the hilitedButtonName of group leGrp to the short name of me
Nothing happens :roll:
The group needs no script, right ?

Kind regards, Jean-Paul.
Last edited by atout66 on Tue Apr 22, 2014 11:32 am, edited 1 time in total.
Discovering LiveCode Community 6.5.2.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: hilitedButtonName propertie (radio btt)

Post by jmburnod » Tue Apr 22, 2014 9:57 am

Hi Jean-Paul,
You don't need scripts in buttons, take them off and it should work
Also you don't need :

Code: Select all

 set the hilitedButtonName of group leGrp to tNameBtn 
I use this to save the state of the group

Kind regards
Jean-Marc
https://alternatic.ch

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

Re: hilitedButtonName propertie (radio btt)

Post by atout66 » Tue Apr 22, 2014 10:46 am

Hi Jean-Marc, thanks for your tips.

I'm going crasy with this radio buttons ! Mine doesn't work at all, even by removing the code inside.
But if I create a new subStack, make one radio button, duplicate twice, and group them, it works :shock:

I wonder if my main stack is not corrupted somewhere ?
I've tried severall save as to rebuild the job (like with TBK :wink: ), but nothing changes...
Should I uncheck a special button in the group Inspector ? Don't think so...

Anyway, why my code shouldn't be working, even if I don't need it ? :D I like to understand instead to believe...
I mean, if I want to control the states on the buttons by myself (I know, the engine thinks for me very well, Klaus told me 8) ), this <hilitedButtonName> has been done for that, no ?
Setting the hilitedButtonName of a group sets the hilite property of the rest of the buttons to false. It's FROM the dictionnary!!!
Am I missing something with this property ? Where ?

Thanks for reading me,

Kind regards, Jean-Paul.
Discovering LiveCode Community 6.5.2.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: hilitedButtonName propertie (radio btt)[SOLVED]

Post by jmburnod » Tue Apr 22, 2014 11:35 am

Hi Jean-Paul,
I wonder if my main stack is not corrupted somewhere ?
Maybe and that is very useful to share problems to confirm
I feel sometimes becoming crazy because I often see myself fight my foot :shock:
Setting the hilitedButtonName of a group sets the hilite property of the rest of the buttons to false. It's FROM the dictionnary!!!
Yes,
Sorrry I was not clear in my first post and my english is on building step :D
That is very useful to change the state of the group something like

Code: Select all

on opencard
set the hilitedButtonName of group "MyLangage" to "Français"
end opencard

on closecard
get the hilitedButtonName of group "MyLangage"
setLangage it
end closecard

on setLangage pLangage
-- do what you want
end setLangage
Kind regards
Jean-Marc
https://alternatic.ch

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

Re: hilitedButtonName propertie (radio btt)[SOLVED]

Post by atout66 » Tue Apr 22, 2014 11:42 am

I apologize for this topic. The <hilitedButtonName> property does it's job very well to switch the states of radio buttons in a group.
I found that in my message path, I had an handler which was setting off the hilite of buttons and in my mouseLeave handler, I had a call to it. :roll:
Anyway this peace of code:

Code: Select all

     set the hilitedButtonName of group leGrp to tNameBtn 
from Jean-Marc will be very usefull for me in the future. :wink:

Kind regards, Jean-Paul.
Discovering LiveCode Community 6.5.2.

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

Re: hilitedButtonName propertie (radio btt)[SOLVED]

Post by atout66 » Tue Apr 22, 2014 11:43 am

Ooops, Jean-Marc, nos messages se sont croisés !
:wink:

Anyway, very interresting your way to manage the init and states of the buttons. I won't forget it, thanks to you.

Kind regards, Jean-Paul.
Discovering LiveCode Community 6.5.2.

Post Reply