home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / powerapp / animator.exe / ANIMATOR.DXR / 00038_RadioButtonClusterClass.ls < prev    next >
Encoding:
Text File  |  1996-05-07  |  765 b   |  22 lines

  1. property pRadioCount, pCurrentRadio, pRadioCasts
  2. global gGeneralSetting
  3.  
  4. on birth me, buttonChannels, defaultRadioButtonNum
  5.   set the pRadioCount of me to count(buttonChannels)
  6.   set the pRadioCasts of me to []
  7.   repeat with theChannel in buttonChannels
  8.     add(the pRadioCasts of me, the castNum of sprite theChannel)
  9.   end repeat
  10.   mSetRadio(me, defaultRadioButtonNum)
  11.   return me
  12. end
  13.  
  14. on mSetRadio me, whichButton
  15.   repeat with theCast = 1 to the pRadioCount of me
  16.     set the hilite of cast getAt(the pRadioCasts of me, theCast) to 0
  17.   end repeat
  18.   set the hilite of cast getAt(the pRadioCasts of me, whichButton) to 1
  19.   set the pCurrentRadio of me to whichButton
  20.   set gGeneralSetting to getAt([1: #once, 2: #nTimes, 3: #forever], the pCurrentRadio of me)
  21. end
  22.