subr sdoselectwaves_cb
 ;the first 2 are special cases
 if $radio_button le 1 then {
   if $radio_state eq 0 then return
   $sdowaveschoose = zero($sdowaveschoose)
   mode = 0    $sdoaiawavesall = 0
   if $radio_button then { $sdowaveschoose =$sdowaveschoose + 1  mode = 1
    $sdoaiawavesall = 1
    xmtogglesetstate,$sdowavescbox(1),0,0 } else { xmtogglesetstate,$sdowavescbox(2),0,0 }
   for i=3,num_elem($sdowaveschoose)+2 do xmtogglesetstate,$sdowavescbox(i),mode,0
   return
 }
 $sdoaiawavesall = 0
 ;other case add to or delete from the list and also clear the first 2
 i = $radio_button - 2
 $sdowaveschoose(i) = $radio_state
 xmtogglesetstate,$sdowavescbox(1),0
 xmtogglesetstate,$sdowavescbox(2),0
 endsubr
;---------------------------------------------------------------
