home *** CD-ROM | disk | FTP | other *** search
/ <GEEK> 1 / GEEK1.ISO / geekko / win14.dxr / 00004_Selector.ls < prev    next >
Encoding:
Text File  |  1997-05-24  |  1.5 KB  |  52 lines

  1. global theLastactiveWindow, mainFolder
  2.  
  3. on new me
  4.   return me
  5. end
  6.  
  7. on select me, spriteNo
  8.   if (spriteNo < 1) or (spriteNo > 48) then
  9.     exit
  10.   end if
  11.   tell the activeWindow
  12.     if the memberNum of sprite spriteNo = 0 then
  13.       exit
  14.     end if
  15.     set iconName to the name of member the memberNum of sprite spriteNo
  16.     if char length(iconName) - 7 to length(iconName) of iconName = "Selected" then
  17.       unselect(me, spriteNo)
  18.       exit
  19.     else
  20.       repeat with i = 1 to 48
  21.         if the memberNum of sprite i > 0 then
  22.           set iconName to the name of member the memberNum of sprite i
  23.           if char length(iconName) - 7 to length(iconName) of iconName = "Selected" then
  24.             unselect(me, i)
  25.           end if
  26.         end if
  27.       end repeat
  28.       puppetSprite(spriteNo, 1)
  29.       set qName to the name of member the memberNum of sprite spriteNo
  30.       set the member of sprite spriteNo to member (qName & "Selected")
  31.     end if
  32.   end tell
  33. end
  34.  
  35. on unselect me, spriteNo
  36.   if (spriteNo < 1) or (spriteNo > 48) then
  37.     exit
  38.   end if
  39.   tell the activeWindow
  40.     if the memberNum of sprite spriteNo = 0 then
  41.       exit
  42.     end if
  43.     set iconName to the name of member the memberNum of sprite spriteNo
  44.     if iconName contains "Selected" then
  45.       set the member of sprite spriteNo to member char 1 to length(iconName) - 8 of iconName
  46.     end if
  47.     if not ((iconName contains "Mac") or (iconName contains "PC")) then
  48.       puppetSprite(spriteNo, 0)
  49.     end if
  50.   end tell
  51. end
  52.