|
|
|
Simple Radio Button Group
Added on 6/24/1999
|
Use to have all other buttons turn off when a radio button is turned on.
--Copyright 1999 Chuck Neal
--chuck@mediamacros.com
--If you find this code helpful, send me an e-mail and let me know. :-)
property defaultState, spriteNum, myGroup
on getPropertyDescriptionList me
p_list = [:]
addProp p_list, #defaultState, [#format : #boolean, #comment : "Default State:", #default : false]
addProp p_list, #myGroup, [#format : #integer, #comment : "Default Group:", #default : 1]
return p_list
end
on beginSprite me
set the hilite of member the member of sprite spriteNum = defaultState
end
on mouseUp me
set myState = the hilite of member the member of sprite spriteNum
if myState = true then
sendAllSprites(#checkState, spriteNum, myGroup)
end if
end
on checkState me, whatSprite, whatGroup
if whatSprite <> spriteNum and whatGroup = myGroup then
set the hilite of member the member of sprite spriteNum = false
end if
end
on getBehaviorDescription me
return "Drop this on your radio buttons and make all the ones in the same set have the same group number."
end
|
|