home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / mac / FILES / SHARED.CST / 00045_Script_loadBtnObject < prev    next >
Text File  |  1997-07-24  |  3KB  |  89 lines

  1. --P5:Tool5: load btn object -- 
  2.  
  3.  
  4.  
  5. property pToolRects, pNumOfRects
  6. property pMenuCast
  7. property argClickLocPnt
  8. property pHiliteStartCast
  9. property pHiliteSprite
  10. property pQTVRsteps
  11. property pKinetoscopeCast, pKSallrects
  12.  
  13. global gModeManager, gQTVRobj, gActiveQTVRhandler, gActiveFunctionObj, gEdisonFilmed
  14. --==============================================================
  15. on mInit me
  16.   
  17.   set pKinetoscopeCast = the number of cast "TIEKSLWA.PIC"
  18.   set pKSallrects = []
  19.   return (me)
  20.   
  21. end
  22. ----------------------------------------------------------------------------ò
  23. on mSetup me
  24.   
  25. end
  26.  
  27. ----------------------------------------------------------------------------ò
  28. on mSetMenuProp me, WhatMenuCast, toolrects, hiliteSprite, ActiveFunctionalty
  29.   
  30.   set pWhatFunctActive = ActiveFunctionalty
  31.   if (WhatMenuCast = pKinetoscopeCast) then
  32.     
  33.     set pKSallrects = value(string( toolrects ))
  34.     if (not gEdisonFilmed)  then 
  35.       set pMenuCast = pKinetoscopeCast - 1
  36.       set pHiliteStartCast = pMenuCast + 2
  37.       --deleteat(toolrects,7)
  38.     else 
  39.       set toolrects = pKSallrects
  40.       set pMenuCast = WhatMenuCast
  41.       set pHiliteStartCast = pMenuCast + 1
  42.     end if
  43.     
  44.   else
  45.     set pMenuCast = WhatMenuCast
  46.     set pHiliteStartCast = pMenuCast + 1
  47.   end if
  48.   
  49.   set pToolRects = toolrects
  50.   set pHiliteSprite = hiliteSprite
  51.   set pNumOfRects = count(pToolRects)
  52.   
  53. end mSetMenuProp
  54. ----------------------------------------------------------------------------ò
  55. on mGetToolMenuCast me
  56.   
  57.   return ( pMenuCast )
  58.   
  59. end mGetToolMenuCast
  60. ----------------------------------------------------------------------------ò
  61. on mButtonClicked me
  62.   
  63.   set ClickLocPnt = the clickloc
  64.   set whatrect = mGetWhatToolRect( me, ClickLocPnt)
  65.   if  (whatrect <> 0 ) then
  66.     if objectP(gActiveFunctionObj) then mLoad( gActiveFunctionObj, whatrect)
  67.   end if
  68.   
  69.   
  70. end mButtonClicked
  71. ----------------------------------------------------------------------------ò
  72. on mGetWhatToolRect me, argClickedPnt
  73.   
  74.   set whatrect = 1
  75.   set found = #FALSE
  76.   repeat while (found = #FALSE)
  77.     if inside(argClickedPnt, getat(pToolRects,whatrect)) then 
  78.       set found = #TRUE
  79.       set the castnum of sprite pHiliteSprite = pHiliteStartCast + whatrect - 1
  80.       updatestage
  81.     else set whatrect = whatrect + 1
  82.     if (whatrect > pNumOfRects) then set found = #NEVER
  83.   end repeat
  84.   
  85.   if (found = #TRUE) then return( whatrect ) 
  86.   else  return( 0 ) 
  87.   
  88. end mGetWhatToolRect
  89. ----------------------------------------------------------------------------ò