home *** CD-ROM | disk | FTP | other *** search
/ GU 15 - Background Photo Collection - Hanabi / gu15.iso / pc / browser.exe / browser.DXR / 00036_FileIconLister.ls < prev    next >
Encoding:
Text File  |  1996-09-12  |  5.8 KB  |  242 lines

  1. property pcnt, picon1, picon2, picon3, psp
  2. global gkategorie, gno
  3.  
  4. on birth me, sp
  5.   set the psp of me to sp
  6.   set the pcnt of me to 0
  7.   set the picon1 of me to 0
  8.   set the picon2 of me to 0
  9.   set the picon3 of me to 0
  10.   return me
  11. end
  12.  
  13. on destroy me
  14.   deleteAll(me)
  15. end
  16.  
  17. on append me
  18.   if not objectp(the picon1 of me) then
  19.     set f to birth(script "FileIcon", gkategorie, gno)
  20.     set the picon1 of me to f
  21.     location(the picon1 of me, 45, 35, 348)
  22.     set the pcnt of me to (the pcnt of me + 1) mod 3
  23.   else
  24.     if not objectp(the picon2 of me) then
  25.       set f to birth(script "FileIcon", gkategorie, gno)
  26.       set the picon2 of me to f
  27.       location(the picon2 of me, 46, 160, 348)
  28.       set the pcnt of me to (the pcnt of me + 1) mod 3
  29.     else
  30.       if not objectp(the picon3 of me) then
  31.         set f to birth(script "FileIcon", gkategorie, gno)
  32.         set the picon3 of me to f
  33.         location(the picon3 of me, 47, 286, 348)
  34.         set the pcnt of me to (the pcnt of me + 1) mod 3
  35.       else
  36.         if the pcnt of me = 0 then
  37.           deletebyno(me, 0)
  38.           set f to birth(script "FileIcon", gkategorie, gno)
  39.           set the picon1 of me to f
  40.           location(the picon1 of me, 45, 35, 348)
  41.           set the pcnt of me to (the pcnt of me + 1) mod 3
  42.         else
  43.           if the pcnt of me = 1 then
  44.             deletebyno(me, 1)
  45.             set f to birth(script "FileIcon", gkategorie, gno)
  46.             set the picon2 of me to f
  47.             location(the picon2 of me, 46, 160, 348)
  48.             set the pcnt of me to (the pcnt of me + 1) mod 3
  49.           else
  50.             if the pcnt of me = 2 then
  51.               deletebyno(me, 2)
  52.               set f to birth(script "FileIcon", gkategorie, gno)
  53.               set the picon3 of me to f
  54.               location(the picon3 of me, 47, 286, 348)
  55.               set the pcnt of me to (the pcnt of me + 1) mod 3
  56.             end if
  57.           end if
  58.         end if
  59.       end if
  60.     end if
  61.   end if
  62. end
  63.  
  64. on show me
  65.   if objectp(the picon1 of me) then
  66.     location(the picon1 of me, 45, 35, 348)
  67.   end if
  68.   if objectp(the picon2 of me) then
  69.     location(the picon2 of me, 46, 160, 348)
  70.   end if
  71.   if objectp(the picon3 of me) then
  72.     location(the picon3 of me, 47, 286, 348)
  73.   end if
  74. end
  75.  
  76. on hide me
  77.   if objectp(the picon1 of me) then
  78.     hide(the picon1 of me)
  79.   end if
  80.   if objectp(the picon2 of me) then
  81.     hide(the picon2 of me)
  82.   end if
  83.   if objectp(the picon3 of me) then
  84.     hide(the picon3 of me)
  85.   end if
  86. end
  87.  
  88. on showp me
  89.   if objectp(the picon1 of me) then
  90.     show(the picon1 of me)
  91.   end if
  92.   if objectp(the picon2 of me) then
  93.     show(the picon2 of me)
  94.   end if
  95.   if objectp(the picon3 of me) then
  96.     show(the picon3 of me)
  97.   end if
  98. end
  99.  
  100. on delete me, f
  101.   if the picon1 of me = f then
  102.     if objectp(the picon1 of me) then
  103.       deletebyno(me, 0)
  104.     end if
  105.   else
  106.     if the picon2 of me = f then
  107.       if objectp(the picon2 of me) then
  108.         deletebyno(me, 1)
  109.       end if
  110.     else
  111.       if the picon3 of me = f then
  112.         if objectp(the picon3 of me) then
  113.           deletebyno(me, 2)
  114.         end if
  115.       end if
  116.     end if
  117.   end if
  118. end
  119.  
  120. on deletebyno me, n
  121.   if n = 0 then
  122.     if objectp(the picon1 of me) then
  123.       hide(the picon1 of me)
  124.       destroy(the picon1 of me)
  125.       set the picon1 of me to 0
  126.     end if
  127.   else
  128.     if n = 1 then
  129.       if objectp(the picon2 of me) then
  130.         hide(the picon2 of me)
  131.         destroy(the picon2 of me)
  132.         set the picon2 of me to 0
  133.       end if
  134.     else
  135.       if n = 2 then
  136.         if objectp(the picon3 of me) then
  137.           hide(the picon3 of me)
  138.           destroy(the picon3 of me)
  139.           set the picon3 of me to 0
  140.         end if
  141.       end if
  142.     end if
  143.   end if
  144. end
  145.  
  146. on deleteAll me
  147.   repeat with i = 0 to 2
  148.     deletebyno(me, i)
  149.   end repeat
  150. end
  151.  
  152. on deletebycastnum me, cst
  153.   if objectp(the picon1 of me) then
  154.     set cst2 to the pcast of the picon1 of me
  155.     if cst = cst2 then
  156.       deletebyno(me, 0)
  157.       exit
  158.     end if
  159.   end if
  160.   if objectp(the picon2 of me) then
  161.     set cst2 to the pcast of the picon2 of me
  162.     if cst = cst2 then
  163.       deletebyno(me, 1)
  164.       exit
  165.     end if
  166.   end if
  167.   if objectp(the picon3 of me) then
  168.     set cst2 to the pcast of the picon3 of me
  169.     if cst = cst2 then
  170.       deletebyno(me, 2)
  171.       exit
  172.     end if
  173.   end if
  174. end
  175.  
  176. on whichbrowser me, sp
  177.   if sp = 45 then
  178.     if objectp(the picon1 of me) then
  179.       return the pkate of the picon1 of me
  180.     end if
  181.   else
  182.     if sp = 46 then
  183.       if objectp(the picon2 of me) then
  184.         return the pkate of the picon2 of me
  185.       end if
  186.     else
  187.       if sp = 47 then
  188.         if objectp(the picon3 of me) then
  189.           return the pkate of the picon3 of me
  190.         end if
  191.       end if
  192.     end if
  193.   end if
  194.   return EMPTY
  195. end
  196.  
  197. on whatpictno me, sp
  198.   if sp = 45 then
  199.     if objectp(the picon1 of me) then
  200.       return the pno of the picon1 of me
  201.     end if
  202.   else
  203.     if sp = 46 then
  204.       if objectp(the picon2 of me) then
  205.         return the pno of the picon2 of me
  206.       end if
  207.     else
  208.       if sp = 47 then
  209.         if objectp(the picon3 of me) then
  210.           return the pno of the picon3 of me
  211.         end if
  212.       end if
  213.     end if
  214.   end if
  215.   return 0
  216. end
  217.  
  218. on iswithin me, anitem
  219.   global gdragitem
  220.   if (anitem = gdragitem) and objectp(gdragitem) then
  221.     set mousexy to point(the mouseH, the mouseV)
  222.     if inside(mousexy, the rect of sprite the psp of me) then
  223.       append(me)
  224.       erasedragedobject(gdragitem)
  225.       set gdragitem to 0
  226.     end if
  227.   end if
  228. end
  229.  
  230. on iswithout me, anitem
  231.   global gdragfileicon
  232.   if (anitem = gdragfileicon) and objectp(gdragfileicon) then
  233.     set mousexy to point(the mouseH, the mouseV)
  234.     if not inside(mousexy, the rect of sprite the psp of me) then
  235.       set cst to the pBaseCast of gdragfileicon
  236.       erasedragedobject(gdragfileicon)
  237.       set gdragfileicon to 0
  238.       deletebycastnum(me, cst)
  239.     end if
  240.   end if
  241. end
  242.